...
+...
-...
+...
```
Attributes from dynamic attribute tags are combined from left to right, after
normal attributes, with later attribute values overwriting previous ones.
Multiple values for the same attribute are not merged in any way, so if `attrs1`
-specifies a value for the `class` attribute, it will overwrite `{{|myClass}}`.
+specifies a value for the `class` attribute, it will overwrite `{{dstache}}myClass}}`.
As always, Spacebars takes care of recalculating the element's attributes if any
of `myClass`, `attrs1`, or `attrs2` changes reactively.
@@ -232,7 +231,7 @@ Triple-braced tags are used to insert raw HTML into a template:
```
+
...
```
@@ -308,11 +307,11 @@ depending on the value of its data argument. Any falsy JavaScript value
well as the empty array, while any other value is considered true.
```
-{{|#if something}}
+{{#if something}}
It's true
-{{|else}}
+{{else}}
It's false
-{{|/if}}
+{{/if}}
```
`#unless` is just `#if` with the condition inverted.
@@ -324,19 +323,19 @@ The properties of the data context object are where Spacebars looks when
resolving template tag names.
```
-{{|#with employee}}
-
Name: {{|name}}
-
Age: {{|age}}
-{{|/with}}
+{{#with employee}}
+
Name: {{name}}
+
Age: {{age}}
+{{/with}}
```
We can take advantage of the object specification form of a block tag to define
an object with properties we name:
```
-{{|#with x=1 y=2}}
- {{|{getHTMLForPoint this}}}
-{{|/with}}
+{{#with x=1 y=2}}
+ {{{getHTMLForPoint this}}}
+{{/with}}
```
If the argument to `#with` is falsy (by the same rules as for `#if`), the
@@ -356,9 +355,9 @@ each item in the sequence, setting the data context to the value of that item:
```
-{{|#each people}}
- - {{|name}}
-{{|/each}}
+{{#each people}}
+ - {{name}}
+{{/each}}
```
@@ -367,9 +366,9 @@ new variable that can be used in the body to refer to the current item:
```
-{{|#each person in people}}
- - {{|person.name}}
-{{|/each}}
+{{#each person in people}}
+ - {{person.name}}
+{{/each}}
```
@@ -418,9 +417,9 @@ doesn't change the data context, it allows to refer to an expression (helper,
data context, another variable) with a short-hand within the template:
```
-{{|#let name=person.bio.firstName color=generateColor}}
-
{{|name}} gets a {{|color}} card!
-{{|/let}}
+{{#let name=person.bio.firstName color=generateColor}}
+
{{name}} gets a {{color}} card!
+{{/let}}
```
Variables introduced this way take precedence over names of templates, global
@@ -430,42 +429,42 @@ variables with the same name.
### Custom Block Helpers
To define your own block helper, simply declare a template, and then invoke it
-using `{{|#someTemplate}}` (block) instead of `{{|> someTemplate}}` (inclusion)
+using `{{dstache}}#someTemplate}}` (block) instead of `{{dstache}}> someTemplate}}` (inclusion)
syntax.
-When a template is invoked as a block helper, it can use `{{|>
-Template.contentBlock}}` and `{{|> Template.elseBlock}}` to include the block
+When a template is invoked as a block helper, it can use `{{dstache}}>
+Template.contentBlock}}` and `{{dstache}}> Template.elseBlock}}` to include the block
content it was passed.
Here is a simple block helper that wraps its content in a div:
```
-<{{! }}template name="note">
+
- {{|> Template.contentBlock}}
+ {{> Template.contentBlock}}
-<{{! }}/template>
+
```
You would invoke it as:
```
-{{|#note}}
+{{#note}}
Any content here
-{{|/note}}
+{{/note}}
```
Here is an example of implementing `#unless` in terms of `#if` (ignoring for the
moment that `unless` is a built-in directive):
```
-<{{! }}template name="unless">
- {{|#if this}}
- {{|> Template.elseBlock}}
- {{|else}}
- {{|> Template.contentBlock}}
- {{|/if}}
-<{{! }}/template>
+
+ {{#if this}}
+ {{> Template.elseBlock}}
+ {{else}}
+ {{> Template.contentBlock}}
+ {{/if}}
+
```
Note that the argument to `#unless` (the condition) becomes the data context in
@@ -473,38 +472,38 @@ the `unless` template and is accessed via `this`. However, it would not work
very well if this data context was visible to `Template.contentBlock`, which is
supplied by the user of `unless`.
-Therefore, when you include `{{|> Template.contentBlock}}`, Spacebars hides the
+Therefore, when you include `{{dstache}}> Template.contentBlock}}`, Spacebars hides the
data context of the calling template, and any data contexts established in the
template by `#each` and `#with`. They are not visible to the content block,
-even via `..`. Put another way, it's as if the `{{|> Template.contentBlock}}`
-inclusion occurred at the location where `{{|#unless}}` was invoked, as far as
+even via `..`. Put another way, it's as if the `{{dstache}}> Template.contentBlock}}`
+inclusion occurred at the location where `{{dstache}}#unless}}` was invoked, as far as
the data context stack is concerned.
-You can pass an argument to `{{|> Template.contentBlock}}` or `{{|>
+You can pass an argument to `{{dstache}}> Template.contentBlock}}` or `{{dstache}}>
Template.elseBlock}}` to invoke it with a data context of your choice. You can
-also use `{{|#if Template.contentBlock}}` to see if the current template was
+also use `{{dstache}}#if Template.contentBlock}}` to see if the current template was
invoked as a block helper rather than an inclusion.
### Comment Tags
-Comment template tags begin with `{{|!` and can contain any characters except for
+Comment template tags begin with `{{dstache}}!` and can contain any characters except for
`}}`. Comments are removed upon compilation and never appear in the compiled
template code or the generated HTML.
```
-{{|! Start of a section}}
+{{! Start of a section}}
...
```
Comment tags also come in a "block comment" form. Block comments may contain
-`{{|` and `}}`:
+`{{dstache}}` and `}}`:
```
-{{|!-- This is a block comment.
-We can write {{|foo}} and it doesn't matter.
-{{|#with x}}This code is commented out.{{|/with}}
+{{!-- This is a block comment.
+We can write {{foo}} and it doesn't matter.
+{{#with x}}This code is commented out.{{/with}}
--}}
```
@@ -517,7 +516,7 @@ some other expression. For this and other cases, one can use parentheses to
express the evaluation order of nested expressions.
```
-{{|capitalize (getSummary post)}}
+{{capitalize (getSummary post)}}
```
In this example, the result of the `getSummary` helper call will be passed to
@@ -526,7 +525,7 @@ the `capitalize` helper.
Sub-expressions can be used to calculate key-word arguments, too:
```
-{{|> tmpl arg=(helper post)}}
+{{dstache}}> tmpl arg=(helper post)}}
```
### HTML Dialect
@@ -576,9 +575,8 @@ following elements:
### Escaping Curly Braces
-To insert a literal `{{|`, `{{|{`, or any number of curly braces, put a
-vertical bar after it. So `{{||` will show up as `{{|`, `{{|{|` will
-show up as `{{|{`, and so on.
+To insert a literal `{{dstache}}`, `{{dstache}}{`, or any number of curly braces, put a
+vertical bar after it. So `{{dstache}}|` will show up as `{{dstache}}`, `{{dstache}}{|` will
+show up as `{{dstache}}{`, and so on.
-{{/markdown}}
-
+{{/template}}
diff --git a/docs/client/full-api/packages/underscore.html b/docs/client/full-api/packages/underscore.md
similarity index 94%
rename from docs/client/full-api/packages/underscore.html
rename to docs/client/full-api/packages/underscore.md
index ce5a59e77b..a9b273afbb 100644
--- a/docs/client/full-api/packages/underscore.html
+++ b/docs/client/full-api/packages/underscore.md
@@ -1,5 +1,4 @@
-
-{{#markdown}}
+{{#template name="pkg_underscore"}}
## `underscore`
[Underscore](http://underscorejs.org/) is a utility-belt library for
@@ -30,5 +29,4 @@ are treated as objects if they have no prototype (specifically, if
{{/warning}}
-{{/markdown}}
-
+{{/template}}
diff --git a/docs/client/full-api/packages/webapp.html b/docs/client/full-api/packages/webapp.md
similarity index 96%
rename from docs/client/full-api/packages/webapp.html
rename to docs/client/full-api/packages/webapp.md
index 43fce80e3b..c411f5b426 100644
--- a/docs/client/full-api/packages/webapp.html
+++ b/docs/client/full-api/packages/webapp.md
@@ -1,5 +1,4 @@
-
-{{#markdown}}
+{{#template name="pkg_webapp"}}
## `webapp`
The `webapp` package is what lets your Meteor app serve content to a web
@@ -43,5 +42,4 @@ object. Use this to write data that should be sent in response to the
request, and call `res.end()` when you are done.
- **next** - a function. Calling this function will pass on the handling of
this request to the next relevant handler.
-{{/markdown}}
-
+{{/template}}