srtemplate 0.3.3

Template String blazing fast with dependencyless
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use srtemplate::SrTemplate;

fn main() {
    let ctx = SrTemplate::default();
    ctx.add_variable("var", &"World");
    ctx.add_variable("otherVar", &"Other");
    ctx.add_variable("number", &85u8);

    let template = String::from(
        "Hello {{ var }}! This is {{ otherVar }} and this is number: {{ add_u8(number, 10) }}",
    );
    println!("Rendered: {}", ctx.render(template).unwrap());
}