You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use flask-themer in a project to let users extend the Jinja templates and put it at their color, customize the wording etc.
I would like to document the templates, write a few lines about what they do, which context vars are available etc.
I have forked the old unmaintained sphinxcontrib.jinjadomain into a new quick and dirty project: jinja-autodoc.
Currently jinja-autodoc expect a comment at the start of templates and considers it is a docstring. To achieve this it uses a regex.
While it works for simple use cases, I wish it could do more, such as documenting macros or blocks, but currently it seems jinja does not handle docstrings:
>>>fromjinja2importTemplate>>>t=Template('{# foo #}{% macro foo() %}{# bar #}42{% endmacro %}')
>>>m=t.module>>>m.__doc__'Represents an imported template. All the exported names of the\n template are available as attributes on this object. Additionally\n converting it into a string renders the contents.\n '>>>m.foo.__doc__'Wraps a macro function.'
I would suggest to read the first comment in templates, macros and block, and use them as docstrings.
I am not familiar with the jinja code. Are there technical blockers? Would a PR be welcome?
The text was updated successfully, but these errors were encountered:
I use flask-themer in a project to let users extend the Jinja templates and put it at their color, customize the wording etc.
I would like to document the templates, write a few lines about what they do, which context vars are available etc.
I have forked the old unmaintained sphinxcontrib.jinjadomain into a new quick and dirty project: jinja-autodoc.
Currently jinja-autodoc expect a comment at the start of templates and considers it is a docstring. To achieve this it uses a regex.
While it works for simple use cases, I wish it could do more, such as documenting macros or blocks, but currently it seems jinja does not handle docstrings:
I would suggest to read the first comment in templates, macros and block, and use them as docstrings.
I am not familiar with the jinja code. Are there technical blockers? Would a PR be welcome?
The text was updated successfully, but these errors were encountered: