You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The github specification now allows/defines YAML front matter for mustache documents; this provides a way to create default values for the view.
In all cases, front matter begins and ends with a line containing only ---. You can have a single front matter section, or multiple front matter sections.
{{#names}}
Hi {{name}}!
{{/names}}
Multiple front matter sections:
name: chris
name: mark
name: scott
Hi {{name}}!
Technically, this is a feature of the mustache command, and not necessarily required by implementations. However, when considering things like template inheritance, it could be a useful feature.
The text was updated successfully, but these errors were encountered:
I'm not sure if this should be part of Mustache itself, or part of a facade class. It touches base on several aspects:
Lexing. It would need to execute prior to lexing, keeping the parsed YAML front matter as a view to associate with the given template, and passing the remainder of the document on to the lexer.
Rendering. It would need to pass the parsed YAML front matter on as a view against which to merge a user-supplied view when doing substitutions.
The github specification now allows/defines YAML front matter for mustache documents; this provides a way to create default values for the view.
In all cases, front matter begins and ends with a line containing only ---. You can have a single front matter section, or multiple front matter sections.
A single front matter section:
names: [ {name: chris}, {name: mark}, {name: scott} ]
{{#names}}
Hi {{name}}!
{{/names}}
Multiple front matter sections:
name: chris
name: mark
name: scott
Hi {{name}}!
Technically, this is a feature of the mustache command, and not necessarily required by implementations. However, when considering things like template inheritance, it could be a useful feature.
The text was updated successfully, but these errors were encountered: