Templating
Last updated
Last updated
Atuin uses for rendering templates, enabling flexible output customization.
Basic Syntax
Variables: {{ var.variable_name }}
Variables can be set by Script blocks
Filters: {{ text | upper }}
, {{ list | join(", ") }}
Conditionals:
Loops:
Built-in Functions
range(n)
: Generates a sequence → {% for i in range(3) %}{{ i }}{% endfor %}
length(list)
: Gets list length → {{ length(users) }}
default(value, fallback)
: Uses fallback if None
→ {{ user.name | default("Guest") }}
The template system has full access to the entire document - blocks, text, etc.
We are still iterating on this API, and it is likely to change in future releases
First, give a block a name. Click the pencil icon next to the default name in the top left.
Then, it can be referred to via the {{ doc.named }}
map, within the template system