From a951348003a2fbd37e6890f9733af12634494a49 Mon Sep 17 00:00:00 2001 From: Mateus Ortiz Date: Tue, 6 Oct 2015 17:23:04 -0300 Subject: [PATCH] Add instructions install on top #493 fix local install Fix order section and grammatical Fix the comments Fix command line mustache --- README.md | 78 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index ecb5ce5..63b775a 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,54 @@ And this will be your templates after you use Mustache: !['stache](https://cloud.githubusercontent.com/assets/288977/8779228/a3cf700e-2f02-11e5-869a-300312fb7a00.gif) +## 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? 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 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 In order to run the tests you'll need to install [node](http://nodejs.org/).