|
|
@@ -22,6 +22,54 @@ And this will be your templates after you use Mustache: |
|
|
|
|
|
|
|
|
 |
|
|
 |
|
|
|
|
|
|
|
|
|
|
|
## Install |
|
|
|
|
|
|
|
|
|
|
|
You can get Mustache via npm. |
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
|
|
|
$ npm install mustache --save |
|
|
|
|
|
``` |
|
|
|
|
|
or install with bower: |
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
|
|
|
$ bower install --save mustache |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
## Command line tool |
|
|
|
|
|
|
|
|
|
|
|
mustache.js is shipped with a node based command line tool. It might be installed as a global tool on your computer to render a mustache template of some kind |
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
|
|
|
$ npm install -g mustache |
|
|
|
|
|
|
|
|
|
|
|
$ mustache dataView.json myTemplate.mustache > output.html |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
also supports stdin. |
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
|
|
|
$ cat dataView.json | mustache - myTemplate.mustache > output.html |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
or as a package.json `devDependency` in a build process maybe? |
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
|
|
|
$ npm install mustache --save-dev |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
```json |
|
|
|
|
|
{ |
|
|
|
|
|
"scripts": { |
|
|
|
|
|
"build": "mustache dataView.json myTemplate.mustache > public/output.html" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
``` |
|
|
|
|
|
```bash |
|
|
|
|
|
$ npm run build |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
The command line tool is basically a wrapper around `Mustache.render` so you get all the features. |
|
|
|
|
|
|
|
|
## Who uses mustache.js? |
|
|
## Who uses mustache.js? |
|
|
|
|
|
|
|
|
An updated list of mustache.js users is kept [on the Github wiki](http://wiki.github.com/janl/mustache.js/beard-competition). Add yourself or your company if you use mustache.js! |
|
|
An updated list of mustache.js users is kept [on the Github wiki](http://wiki.github.com/janl/mustache.js/beard-competition). Add yourself or your company if you use mustache.js! |
|
|
@@ -468,36 +516,6 @@ These may be built using [Rake](http://rake.rubyforge.org/) and one of the follo |
|
|
$ rake yui3 |
|
|
$ rake yui3 |
|
|
$ rake qooxdoo |
|
|
$ rake qooxdoo |
|
|
|
|
|
|
|
|
## Command line tool |
|
|
|
|
|
|
|
|
|
|
|
mustache.js is shipped with a node based command line tool. It might be installed as a global tool on your computer to render a mustache template of some kind |
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
|
|
|
$ npm install -g mustache |
|
|
|
|
|
$ mustache dataView.json myTemplate.mustache > output.html |
|
|
|
|
|
|
|
|
|
|
|
# also supports stdin |
|
|
|
|
|
$ cat dataView.json | mustache - myTemplate.mustache > output.html |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
or as a package.json `devDependency` in a build process maybe? |
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
|
|
|
$ npm install mustache --save-dev |
|
|
|
|
|
``` |
|
|
|
|
|
```json |
|
|
|
|
|
{ |
|
|
|
|
|
"scripts": { |
|
|
|
|
|
"build": "mustache dataView.json myTemplate.mustache > public/output.html" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
``` |
|
|
|
|
|
```bash |
|
|
|
|
|
$ npm run build |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
The command line tool is basically a wrapper around `Mustache.render` so you get all the aforementioned features. |
|
|
|
|
|
|
|
|
|
|
|
## Testing |
|
|
## Testing |
|
|
|
|
|
|
|
|
In order to run the tests you'll need to install [node](http://nodejs.org/). |
|
|
In order to run the tests you'll need to install [node](http://nodejs.org/). |
|
|
|