boilerplate 0.1.0

Minimal compile-time Rust template engine
Documentation

boilerplate is a minimal compile-time Rust text template engine. boilerplate's HTML escaping has not been scrutinized, and should not be used in production environments with untrusted input.

Quick Start

Add boilerplate to your project's Cargo.toml:

[dependencies]
boilerplate = "*"

Create a template in templates/my-template.txt:

Foo is {{self.n}}!

Define, instantiate, and render the template context:

use boilerplate::Boilerplate;

#[derive(Boilerplate)]
struct MyTemplate {
  n: u32,
}

assert_eq!(MyTemplate { n: 10 }.to_string(), "Foo is 10!\n");

See the docs for more information and examples.