Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown support breaks normal rst docs #9

Open
andeaseme opened this issue Oct 21, 2021 · 0 comments
Open

Markdown support breaks normal rst docs #9

andeaseme opened this issue Oct 21, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@andeaseme
Copy link
Member

I've disabled the markdown support because it messes with the rst code blocks and numbered lists. You can find examples on this page when you compile the docs:
https://i2mint.github.io/epythet/module_docs/epythet.html

This code needs to change
epythet/_static/docsrc/conf.py

import commonmark


def docstring(app, what, name, obj, options, lines):
    md = '\n'.join(lines)
    ast = commonmark.Parser().parse(md)
    rst = commonmark.ReStructuredTextRenderer().render(ast)
    lines.clear()
    lines += rst.splitlines()


def setup(app):
    app.connect('autodoc-process-docstring', docstring)

The markdown parser should not be blindly applied to the entire document.

One possible solution is to have some kind of sentinel or keyword show where md starts and finishes and only apply it to those sections. Even better if you can tell the difference between md and rst without the users knowledge.

Documentation must be added for whatever the solution ends up being.

@andeaseme andeaseme added the bug Something isn't working label Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants