templatetags.django_docutils
¶
Django template tag and filter for docutils (rendering reStructuredText as HTML).
- class django_docutils.templatetags.django_docutils.ReStructuredTextNode(content, args=None, kwargs=None, asvar=None)[source]¶
Bases:
Node
Implement the actions of the rst tag.
- exception django_docutils.templatetags.django_docutils.MalformedArgumentsToRSTTag(*args, **kwargs)[source]¶
Bases:
TemplateSyntaxError
Invalid arguments to rst django template tag.
- django_docutils.templatetags.django_docutils.rst(parser, token)[source]¶
Django template tag to render reStructuredText as HTML.
Supports arguments, see below.
- Return type:
Examples
{% rst content %}
{% rst content toc_only=True %}
{% rst content show_title=False %}
{% rst %} **Hello world** {% endrst %}
Render table of contents:
{% rst toc_only=True %} Welcome to my site! =================== My header --------- Some text Additional information ---------------------- Thank you {% endrst %}