Tests
Test: size-and-fill
Template
{% for row in items|batch(3, '-') -%}
{% for column in row %} {{ column }} {% endfor %} |
{% endfor %}
Data
{
"items": ["a", "b", "c", "d", "e", "f", "g"]
}
Output Django (error) v1.10.1
'for' statements should use the format 'for x in y': for row in items|batch(3, '-') -
Output Jinja2 v2.8.0
a b c |
d e f |
g - - |
Output Liquid v3.0.6
a |
b |
c |
d |
e |
f |
g |
Output Nunjucks v2.5.0
a b c |
d e f |
g - - |
Output Swig (error) v1.4.2
Invalid filter "batch".
Output Twig v1.24.2
a b c |
d e f |
g - - |
Output Twigjs v0.9.5
a b c |
d e f |
g - - |
Test: size-only
Template
{% for row in items|batch(3) -%}
{% for column in row %} {{ column }} {% endfor %} |
{% endfor %}
Data
{
"items": ["a", "b", "c", "d", "e", "f", "g"]
}
Output Django (error) v1.10.1
'for' statements should use the format 'for x in y': for row in items|batch(3) -
Output Jinja2 v2.8.0
a b c |
d e f |
g |
Output Liquid v3.0.6
a |
b |
c |
d |
e |
f |
g |
Output Nunjucks v2.5.0
a b c |
d e f |
g |
Output Swig (error) v1.4.2
Invalid filter "batch".
Output Twig v1.24.2
a b c |
d e f |
g |
Output Twigjs v0.9.5
a b c |
d e f |
g |