The syntax for printing output in Jinja is using the double curly braces, for example . Statements which set variables in jinja or those which do not have an output can be wrapped within {% and %}, using the set keyword. For example {% set foo = 42 %} sets a variable called foo with a value of 42. Similar to above, comments in jinja can be written using a number sign (#) instead of a percentage (%), for example, {# helpful comment #}. The syntax for creating a filter in Jinja is a
vertical bar (|), for example . A variable can have multiple filters, for example ). The syntax for creating a test in Jinja is the keyword is as well as the conditions for evaluating the validity of a test, such as for example {% if variable is divisibleby 10 %}do something{% endif %}).
For loops can be used to iterate over sequences, while retaining their object properties. The following example demonstrates iterating over a list of users with and fields. {% for user in users %} {% endfor %} Although and are not allowed inside loops, sequences can be filtered. == Example ==