Permalink
Browse files

docs

  • Loading branch information...
1 parent 6da2888 commit aaf4b3edef3dac6488cbebcc67bf6ea8ec1b125b @tj tj committed Sep 5, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 Readme.md
View
@@ -17,7 +17,7 @@
hello.mustache:
```
-Hello {{name}}!
+Hello {{name}}! {{^authenticated}}<a href="/login">login</a>{{/authenticated}}
```
convert it:
@@ -29,16 +29,16 @@ $ minstache < hello.mustache > hello.js
hello.js:
```js
-module.exports = function(obj) {
+module.exports = function anonymous(obj) {
function escape(html) {
return String(html)
.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
};
- return "Hello " + escape(obj.name) + "!"
-};
+ return "Hello " + escape(obj.name) + "! " + (!obj.authenticated ? "<a href=\"/login\">login</a>" : "") + ""
+}
```
## API

0 comments on commit aaf4b3e

Please sign in to comment.