| Crates.io | nanotemplate |
| lib.rs | nanotemplate |
| version | 0.3.0 |
| created_at | 2021-05-04 11:58:09.8951+00 |
| updated_at | 2022-09-22 12:55:17.542095+00 |
| description | A minimal templating engine that renders a string from the template, replacing all instances of {placeholder} with given values |
| homepage | https://sr.ht/~jpastuszek/nanotemplate/ |
| repository | https://git.sr.ht/~jpastuszek/nanotemplate |
| max_upload_size | |
| id | 392969 |
| size | 17,940 |
A minimal templating engine that renders a string from the template, replacing all instances of {placeholder} with given values.
The engine is strict:
template_default to use default value for placeholders),template_strict),Values are provided as an iterable object that provides placeholder name and value pairs.
use nanotemplate::template;
assert_eq!(
template("Hello, my name is {name}!", &[("name", "nanotemplate")]).unwrap(),
"Hello, my name is nanotemplate!".to_owned());
Also comes with simple CLI utility:
echo "Hello my name is {name}" | nanotemplate name=nanotemplate