diff --git a/docs/templating.html b/docs/templating.html index 9bd55c33adc..2b1b7582072 100644 --- a/docs/templating.html +++ b/docs/templating.html @@ -695,9 +695,9 @@ The order of the items in the list matters: their position is used to group them For more details on Mustache see mustache.5. See also samskivert/jmustache for implementation-specific details.
To access the first or last element in a list using Mustache:
-{{#vars}}{{#-first}} this is the first element {{.}} {{/-first}}{{/vars}}
-{{#vars}}{{#-last}} this is the last element {{.}} {{/-last}}{{/vars}}
-
+{{#vars}}{{#-first}} this is the first element {{.}} {{/-first}}{{/vars}}
+{{#vars}}{{#-last}} this is the last element {{.}} {{/-last}}{{/vars}}
+
Mustache evaluates template variables contextually. If the variable isn't found in the immediate object, mustache will search the parent. This is similar to JavaScript's prototype object (if you're familiar with the concept).
You can inspect this entire context by outputting {{this}}
. For example:
To access the first or last element in a list using Mustache:
-{{#vars}}{{#-first}} this is the first element {{.}} {{/-first}}{{/vars}}
-{{#vars}}{{#-last}} this is the last element {{.}} {{/-last}}{{/vars}}
-
+{{#vars}}{{#-first}} this is the first element {{.}} {{/-first}}{{/vars}}
+{{#vars}}{{#-last}} this is the last element {{.}} {{/-last}}{{/vars}}
+
Mustache evaluates template variables contextually. If the variable isn't found in the immediate object, mustache will search the parent. This is similar to JavaScript's prototype object (if you're familiar with the concept).
You can inspect this entire context by outputting {{this}}
. For example: