-
Notifications
You must be signed in to change notification settings - Fork 49
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
Generated docs are incorrectly formatted with Flask 0.11.1 #26
Comments
Actually it would be wonderful if autodoc could parse markdown from the docstring. It's far more easy and useful then giant Spynx or Doxygen. And parsing markdown is EVERYTHING we need for documentation. |
This happens also in 0.11.0 |
markdown may rendered without any patches in flask-autodoc:
[...]
import markdown
from flask import Markup
def md2html(text):
import textwrap
res = Markup(markdown.markdown(
textwrap.dedent(text),
[
'markdown.extensions.codehilite',
'markdown.extensions.nl2br',
'markdown.extensions.extra',
'markdown.extensions.admonition'
], extension_configs={'markdown.extensions.codehilite': {
'noclasses': True,
'pygments_style': 'colorful'
}}))
return res
def create_app():
app = Flask(__name__, static_url_path='/doc')
[...]
app.jinja_env.filters['markdown'] = md2html
[...]
I'm take some css strings from sphinx, but you welcome to create your own. |
going off of @stanislavvv 's response, with respect to the original issue if you just want flask-autodoc to format html using tags embedded in docstrings (less all the markdown business) you can use |
I'm having the same issue, I'm not using a custom template. Just return auto.html() per the basic examples. |
Confirmed with Flask 0.12.2 as well. |
as a workaround you can copy the default template from afterwards change the line when you use auto.html() define the project template to use it |
The formatting works fine with Flask 0.10.1 but with 0.11.1 the embedded HTML tags are displayed instead of being processed as HTML.
The text was updated successfully, but these errors were encountered: