tera 2.0.0-alpha.3

A template engine for Rust based on Jinja2/Django
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
{% for name in data.names %}{{ name }}||{% endfor %}
{% for key, val in product %}{{ key }}:{{ val }}||{% endfor %}
{% for i in data.names %}{{loop.index}}.{{loop.index0}}: {{loop.first}}? {{loop.last}}?||{% endfor %}
{% for i in data.names %}{% if loop.index0 == 1 %}{% break %}{% else %}{{i}}{% endif %}{% endfor %}
{% for i in data.names %}{% if loop.index0 == 0 %}{% continue %}{% else %}{{i}}{% endif %}{% endfor %}
{% for vector in vectors %}{% for j in vector %}{{ j }}{% endfor %}{% endfor %}
{% for i in [1, 2] %}{% for i in ["a", "b"] %}{{ i }}{% endfor %}{% endfor %}
{% for name in data.names %}{% set counter = loop.index0 + 1 %}{{counter}}{% endfor %}
{% for name in data.names %}{% set_global counter = loop.index0 + 1 %}{{counter}}{% endfor %} -> {{counter}}
{% for i in empty %}{{i}}{% else %}Empty forloop{% endfor %}
{% for i in empty %}{{i}}{% endfor %}
{% for x in [1, ] %}{{loop.index0}} -> {% if loop.first %}First{% endif %}-{% if loop.last %}Last{% endif %}{% endfor %}