7 releases
new 0.1.6 | Apr 19, 2024 |
---|---|
0.1.5 | Apr 17, 2024 |
0.1.4 | Mar 16, 2024 |
0.1.2 | Feb 21, 2024 |
#169 in Template engine
349 downloads per month
Used in llmclient
21KB
359 lines
Yet Another Simple template engine
Inspired by %nix shell and Java version from some years ago and some code influenced by other Rust templating engines.
Features:
- Default delimiters "${" and "}". Can be overridden to anything.
- Default values with :- syntax.
- Nesting of variables allowed (to 8 levels).
- Can use environment variables.
- Value lookup order: supplied HashMap, Environment, Default (if supplied).
- Plays nicely with serde HashMaps.
- Can include files (which can nest). With .inc extension only.
- Zero dependencies.
- Fast.
- Can use multi-valued variables for lists etc. (only through HashMap).
- Can check existence of a value and if true give it a default. Useful for HTML forms when variable has a particular value, and this value should be the default selected value.
Please read the API documentation
https://docs.rs/stemplate/