Mustache for Dart

A simple implementation of Mustache for the Dart language. At the moment this project serves as an excuse to better explore the language. Although it is still in development you can have a look at what is capable of at the tests

Using it

In order to use the library, just add it to your pubspec.yalm as a dependency

dependencies:
  mustache4dart: any

and you are good to go. You can use the render toplevel function to render your template. For example:

var salutation = render('Hello {{name}}!', {name: 'Bob'});
print(salutation); //shoud print Hello Bob!

Compiling to functions

If you have a template that you are going to reuse with different contextes you can compile it to a function using the toplevel function compile:

var salut = compile('Hello {{name}}!');
print(salut('Alice')); //should print Hello Alice! 

Running the tests

Build Status At the moment the project is under heavy development but pass all the Mustache specs. If you want to run the tests yourself, the following commands should be enough

git clone git://github.com/valotas/mustache4dart.git
git submodule init
git submodule update 
pub install
test/run.sh

Versioning

The library will follow dart's versioning (x.x.x) and until a final release of the language will be followed by the latest dart language it has been tested against. For example 0.0.7+0.4.1.0 means that the libraries version is 0.0.7 and has been tested against dart version 0.4.1.0

Libraries

mustache4dart