Simple, lightweight template engine for Rust.
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
use tinytemplate::TinyTemplate;
Rendering a simple template with a context.
use tinytemplate::TinyTemplate;
use serde::Serialize;
#[derive(Serialize)]
struct Context {
name: String,
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut tt = TinyTemplate::new();
tt.add_template("hello", "Hello {{name}}!")?;
let ctx = Context { name: "World".into() };
let rendered = tt.render("hello", &ctx)?;
println!("{}", rendered);
Ok(())
}
Debug
Known footguns
No known footguns recorded.
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.