|
NAMEmustache - Mustache processorSYNOPSISmustache <YAML> <FILE> mustache --compile <FILE> mustache --tokens <FILE> DESCRIPTIONMustache is a logic-less templating system for HTML, config files, anything.The mustache command processes a Mustache template preceded by YAML frontmatter from standard input and prints one or more documents to standard output. YAML frontmatter begins with --- on a single line, followed by YAML, ending with another --- on a single line, e.g.
If you are unfamiliar with YAML, it is a superset of JSON. Valid JSON should work fine. After the frontmatter should come any valid Mustache template. See mustache(5) for an overview of Mustache templates. For example:
Now let´s combine them.
If you provide multiple YAML documents (as delimited by ---), your template will be rendered multiple times. Like a mail merge. For example:
OPTIONSBy default mustache will try to render a Mustache template using the YAML frontmatter you provide. It can do a few other things, however.
INSTALLATIONIf you have RubyGems installed:
EXAMPLES$ mustache data.yml template.mustache $ cat data.yml | mustache - template.mustache $ mustache -c template.mustache $ cat <<data | ruby mustache - template.mustache --- name: Bob age: 30 --- data COPYRIGHTMustache is Copyright (C) 2009 Chris WanstrathOriginal CTemplate by Google SEE ALSOmustache(5), gem(1), http://mustache.github.io/
Visit the GSP FreeBSD Man Page Interface. |