incrust 0.0.3

Rust template engine inspired by Jinja2.
Documentation

Incrust

Incrust is a template engine written in Rust, inspired by Jinja2.

The implementation is at a very early stage.

Installation

incrust is available on crates.io and can be included in your Cargo enabled project like this:

[dependencies]
incrust = "0.0"

Then include it in your code like this:

extern crate incrust;

Examples

Variables

use incrust::Incrust;

fn main() {
    let incrust = Incrust::new();
    let result = incrust.render_text("Hello, {{name}}!", hashmap!{ "name" => "World", }).unwrap();
    assert_eq!(result, "Hello, World!");
}

Comments

use incrust::Incrust;

fn main() {
    let tpl = "<p>Visible {# partially #} paragraph</p>";
    let incrust = Incrust::new();
    let result = incrust.render_text(tpl, hashmap!{ "name" => "World", }).unwrap();
    assert_eq!(result, "<p>Visible  paragraph</p>");
}

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.