-
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Sergio Alejandro Ribera Costa edited this page Oct 15, 2023
·
1 revision
- Super fast
- Efficient
- Renders variables of all types
- Function system
- Easy implementation of custom functions
- Minimum possible dependencies
- Feature-based implementations, use only what you need
- Using the same variables renders multiple times
use srtemplate::SrTemplate;
fn main() {
let mut ctx = SrTemplate::default();
ctx.add_variable("var", &"World");
ctx.add_variable("otherVar", &"Other");
ctx.add_variable("number", &85u8);
let template = "Hello {{ var }}! This is {{ otherVar }} and this is number: {{number}}";
println!("Rendered: {}", ctx.render(template).unwrap());
}