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

Download history 327/week @ 2024-02-19 58/week @ 2024-02-26 65/week @ 2024-03-04 242/week @ 2024-03-11 45/week @ 2024-03-18 89/week @ 2024-03-25 11/week @ 2024-04-01 3/week @ 2024-04-08 245/week @ 2024-04-15

349 downloads per month
Used in llmclient

MIT/Apache

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:

  1. Default delimiters "${" and "}". Can be overridden to anything.
  2. Default values with :- syntax.
  3. Nesting of variables allowed (to 8 levels).
  4. Can use environment variables.
  5. Value lookup order: supplied HashMap, Environment, Default (if supplied).
  6. Plays nicely with serde HashMaps.
  7. Can include files (which can nest). With .inc extension only.
  8. Zero dependencies.
  9. Fast.
  10. Can use multi-valued variables for lists etc. (only through HashMap).
  11. 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/

No runtime deps