mustache template library for rust
Rust
Switch branches/tags
Nothing to show
Pull request Compare This branch is 151 commits behind erickt:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
spec @ 9b1bc7a
.gitignore
.gitmodules
LICENSE
README.md
base.mustache
mustache.rc
mustache.rs
test.mustache
user.mustache

README.md

Mustache

Inspired by ctemplate and et, Mustache is a framework-agnostic way to render logic-free views.

As ctemplates says, "It emphasizes separating logic from presentation: it is impossible to embed application logic in this template language."

rust-mustache is a rust implementation of Mustache.

Documentation

The different Mustache tags are documented at mustache(5).

Install It

cargo install mustache

Use It

use std;
use mustache;

import std::io;
import std::map;

fn main() {
    let ctx = map::new_str_hash();
    ctx.insert("planet", mustache::str("world"));
    let s = mustache::render_str("hello {{planet}}", ctx);
    io::println(s);
}