Expand description
Filters for the Tera engine, useful for ascii-text file generation.
To generate a Markdown-Table like this:
| No | *Name* | Score |
|----|--------------------|--------|
| 1. | Charly | 3000 |
| 2. | Alexander | 800 |
| 3. | Josephine | 760 |
A Tera-template could look like:
| No | *Name* | Score |
|----|--------------------|--------|
{% for member in team | slice(end=10) %}
| {{ loop.index ~ '.' | left_align(length=4) }} | {{
member.name | center(length=20) }} | {{
member.score | right_align(length=10) }} |
{% endfor %}
Functionsยง
- center
- Centers the token to a given length.
- left_
align - Left-aligns the token to a given length.
- right_
align - Right-aligns the token to a given length.