wijjit.tags.display.ListViewExtension
- class wijjit.tags.display.ListViewExtension(environment)[source]
Jinja2 extension for listview tag.
Syntax:
{% listview id="tasks" items=state.tasks bullet="bullet" show_dividers=true width=60 height=20 border="single" title="Tasks" %} {% endlistview %} Or with static items:: {% listview bullet="dash" %} Task 1 Task 2 Task 3 {% endlistview %} Or with details (2-tuples or dicts):: {% listview bullet="number" items=items %} {% endlistview %}
- Parameters:
environment (Environment)
- __init__(environment)
- Parameters:
environment (Environment)
- Return type:
None
Methods
__init__(environment)attr(name[, lineno])Return an attribute node for the current extension.
bind(environment)Create a copy of this extension bound to another environment.
call_method(name[, args, kwargs, dyn_args, ...])Call a method of the extension.
filter_stream(stream)It's passed a
TokenStreamthat can be used to filter tokens returned.parse(parser)Parse the listview tag.
preprocess(source, name[, filename])This method is called before the actual lexing and can be used to preprocess the source.
Attributes
prioritythe priority of that extension.
if this extension parses this is the list of tags it's listening to.
- tags: t.Set[str] = {'listview'}
if this extension parses this is the list of tags it’s listening to.
- parse(parser)[source]
Parse the listview tag.
- Parameters:
parser (
jinja2.parser.Parser) – Jinja2 parser- Returns:
Parsed node tree
- Return type: