mustache4dart 0.0.7 copy "mustache4dart: ^0.0.7" to clipboard
mustache4dart: ^0.0.7 copied to clipboard

outdatedDart 1 only

A mustache implementation for Dart language

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
0
likes
0
pub points
41%
popularity

Publisher

unverified uploader

A mustache implementation for Dart language

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

unittest

More

Packages that depend on mustache4dart