Simple templating engine.
renderix renders a template file by replacing placeholders like {{ variable_name }} with values loaded from a TOML file named renderix.toml in the current working directory.
Features#
- Tiny, no-dependency templating
- Variables loaded from
renderix.toml - Replaces placeholders in the form:
{{ name }} - Output to stdout by default, or write to a file
- Verbose mode for debugging
- For loops
Installation#
uv tool install renderix
Or:
git clone https://codeberg.org/nietarne/renderix.git
cd renderix
uv tool install .
Quick start#
- Create a
renderix.tomlin your working directory:
name = "John Doe"
- Create a template file, e.g.
template.txt:
Hello {{ name }}
- Render it to stdout:
renderix -t template.txt
For loops#
Suppose you want to print a list of employees an their age.
renderix.toml:
[[employees]]
name = "Jhon"
age = 40
[[employees]]
name = "Jane"
age = 42
[[employees]]
name = "Joe"
age = 46
In your template:
{{ for employee in employees }}
- {{ employee.name }} is {{ employee.age }} years old
{{ endfor }}
