Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 19a877b3a1
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (29 sloc) 0.982 kB

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);
}
Jump to Line
Something went wrong with that request. Please try again.