A minimal templating engine that renders a string from the template, replacing all instances of {placeholder}
with given values.
The engine is strict:
- all placeholders must have values provided (use
template_default
to use default value for placeholders), - all provided values must have matching placeholder (when using
template_strict
), - a single placeholder can be used multiple times and will be expanded in all places.
Values are provided as an iterable object that provides placeholder name and value pairs.
use template;
assert_eq!;
Also comes with simple CLI utility:
echo "Hello my name is {name}" | nanotemplate name=nanotemplate