boilerplate 0.2.4

Minimal compile-time Rust template engine
Documentation

boilerplate is a minimal Rust text template engine with no runtime dependencies.

boilerplate uses Rust as the template language, so all templates are checked for errors at compile time, and any Rust type that implements Display can be used in a template context.

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.