exhibition.filters.jinja2 module¶
Jinja2 template filter
To use, add the following to your configuration file:
filter: exhibition.filters.jinja2
-
class
exhibition.filters.jinja2.
Mark
(environment)[source]¶ Bases:
jinja2.ext.Extension
Marks a section for use later:
{% mark intro %} <p>My Intro</p> {% endmark %} <p>Some more text</p>
This can then be referenced via
Node.marks
.-
identifier
= 'exhibition.filters.jinja2.Mark'¶
-
parse
(parser)[source]¶ If any of the
tags
matched this method is called with the parser as first argument. The token the parser stream is pointing at is the name token that matched. This method has to return one or a list of multiple nodes.
-
-
class
exhibition.filters.jinja2.
RaiseError
(environment)[source]¶ Bases:
jinja2.ext.Extension
Raise an exception during template rendering:
{% raise "This is an error" %}
-
identifier
= 'exhibition.filters.jinja2.RaiseError'¶
-
parse
(parser)[source]¶ If any of the
tags
matched this method is called with the parser as first argument. The token the parser stream is pointing at is the name token that matched. This method has to return one or a list of multiple nodes.
-