its a ruby tool and installing is easy as:
sudo gem install mustache
this the data represented as YAML (test.yml)
---
"names": [ {name: chris}, {"name": "mark"}, {name: scott} ]
---
A template can be a text file containing special tags marked with {{ and }}
{{#names}}
Hi {{name}}!
{{/names}}
> mustache test.yml templ.mustache
Hi chris!
Hi mark!
Hi scott!
for a detailed description about the mustache syntax see the docs
There is also a javascript api for it
Mustache.to_html(ddoc.templates.restaurant, {"rests":rests})
where the first parameter the template, and the second is the 'model'.
No comments:
Post a Comment