| @@ -49,19 +49,19 @@ contains the data and code needed to render the template. | |||||
| A [mustache](http://mustache.github.com/) template is a string that contains | A [mustache](http://mustache.github.com/) template is a string that contains | ||||
| any number of mustache tags. Tags are indicated by the double mustaches that | any number of mustache tags. Tags are indicated by the double mustaches that | ||||
| surround them. *{{person}}* is a tag, as is *{{#person}}*. In both examples we | |||||
| refer to *person* as the tag's key. | |||||
| surround them. `{{person}}` is a tag, as is `{{#person}}`. In both examples we | |||||
| refer to `person` as the tag's key. | |||||
| There are several types of tags available in mustache.js. | There are several types of tags available in mustache.js. | ||||
| ### Variables | ### Variables | ||||
| The most basic tag type is a simple variable. A *{{name}}* tag renders the value | |||||
| of the *name* key in the current context. If there is no such key, nothing is | |||||
| The most basic tag type is a simple variable. A `{{name}}` tag renders the value | |||||
| of the `name` key in the current context. If there is no such key, nothing is | |||||
| rendered. | rendered. | ||||
| All variables are HTML-escaped by default. If you want to render unescaped HTML, | All variables are HTML-escaped by default. If you want to render unescaped HTML, | ||||
| use the triple mustache: *{{{name}}}*. You can also use *&* to unescape a | |||||
| use the triple mustache: `{{{name}}}`. You can also use `&` to unescape a | |||||
| variable. | variable. | ||||
| Template: | Template: | ||||
| @@ -115,15 +115,15 @@ Output: | |||||
| Sections render blocks of text one or more times, depending on the value of the | Sections render blocks of text one or more times, depending on the value of the | ||||
| key in the current context. | key in the current context. | ||||
| A section begins with a pound and ends with a slash. That is, *{{#person}}* | |||||
| begins a *person* section, while *{{/person}}* ends it. The text between the two | |||||
| A section begins with a pound and ends with a slash. That is, `{{#person}}` | |||||
| begins a `person` section, while `{{/person}}` ends it. The text between the two | |||||
| tags is referred to as that section's "block". | tags is referred to as that section's "block". | ||||
| The behavior of the section is determined by the value of the key. | The behavior of the section is determined by the value of the key. | ||||
| #### False Values or Empty Lists | #### False Values or Empty Lists | ||||
| If the *person* key exists and has a value of `null`, `undefined`, or `false`, | |||||
| If the `person` key exists and has a value of `null`, `undefined`, or `false`, | |||||
| or is an empty list, the block will not be rendered. | or is an empty list, the block will not be rendered. | ||||
| Template: | Template: | ||||
| @@ -145,7 +145,7 @@ Output: | |||||
| #### Non-Empty Lists | #### Non-Empty Lists | ||||
| If the *person* key exists and is not `null`, `undefined`, or `false`, and is | |||||
| If the `person` key exists and is not `null`, `undefined`, or `false`, and is | |||||
| not an empty list the block will be rendered one or more times. | not an empty list the block will be rendered one or more times. | ||||
| When the value is a list, the block is rendered once for each item in the list. | When the value is a list, the block is rendered once for each item in the list. | ||||
| @@ -298,7 +298,7 @@ They also inherit the calling context. Whereas in ERB you may have this: | |||||
| Mustache requires only this: | Mustache requires only this: | ||||
| {{> next_more}} | |||||
| {{> next_more}} | |||||
| Why? Because the `next_more.mustache` file will inherit the `size` and `start` | Why? Because the `next_more.mustache` file will inherit the `size` and `start` | ||||
| variables from the calling context. In this way you may want to think of | variables from the calling context. In this way you may want to think of | ||||