Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mustache(1) [debian man page]

MUSTACHE(1)							  Mustache Manual						       MUSTACHE(1)

NAME
mustache -- Mustache processor SYNOPSIS
mustache <YAML> <FILE> mustache --compile <FILE> mustache --tokens <FILE> DESCRIPTION
Mustache 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 beings with --- on a single line, followed by YAML, ending with another --- on a single line, e.g. --- names: [ {name: chris}, {name: mark}, {name: scott} ] --- 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: {{#names}} Hi {{name}}! {{/names}} Now let's combine them. $ cat data.yml --- names: [ {name: chris}, {name: mark}, {name: scott} ] --- $ cat template.mustache {{#names}} Hi {{name}}! {{/names}} $ cat data.yml template.mustache | mustache Hi chris! Hi mark! Hi scott! If you provide multiple YAML documents (as delimited by ---), your template will be rendered multiple times. Like a mail merge. For example: $ cat data.yml --- name: chris --- name: mark --- name: scott --- $ cat template.mustache Hi {{name}}! $ cat data.yml template.mustache | mustache Hi chris! Hi mark! Hi scott! OPTIONS
By default mustache will try to render a Mustache template using the YAML frontmatter you provide. It can do a few other things, however. -c, --compile Print the compiled Ruby version of a given template. This is the code that is actually used when rendering a template into a string. Useful for debugging but only if you are familiar with Mustache's internals. -t, --tokens Print the tokenized form of a given Mustache template. This can be used to understand how Mustache parses a template. The tokens are handed to a generator which compiles them into a Ruby string. Syntax errors and confused tags, therefor, can probably be identified by examining the tokens produced. INSTALLATION
If you have RubyGems installed: gem install mustache 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 COPYRIGHT
Mustache is Copyright (C) 2009 Chris Wanstrath Original CTemplate by Google SEE ALSO
mustache(5), mustache(7), gem(1), http://mustache.github.com/ DEFUNKT
May 2010 MUSTACHE(1)

Check Out this Related Man Page

SAMIDARE(1)							   User Commands						       SAMIDARE(1)

NAME
samidare - web page update checker SYNOPSIS
samidare [OPTION]... [URL]... DESCRIPTION
Samidare checks web page updates. It takes a list of URLs in a configuration file, config.yml, and checks last update time of them. A HTML file, latest.html, is generated to show the updates. OPTIONS
--help show help message. -v, --verbose specify verbose mode. -n, --no-check don't check web. output generation only. -f, --force force check (avoid timing control mechanism) -o, --output=filename specify output html filename. --output-lirs=filename specify output lirs filename. -T, --template=filename specify template filename. -t, --timing show check time of pages. --dump-config dump flatten configuration. --dump-status dump status. If URLs is specified, the status of specified pages are shown. --dump-template-data dump data for expand template. The "data" variable in template file refer this. --dump-filenames dumps locally stored filenames of pages specified by URLs. --dump-filenames2 dumps locally stored recent two filenames of pages specified by URLs. --remove-entry remove entry of pages specified by URLs. --diff-content show difference of recent two files of specified URLs. USAGE
samidare is configured by "config.yml" and "t.latest.html" by default. samidare generates "latest.html" and "sites.lirs.gz" samidare uses "status.rm" and "tmp" to record status of pages. "config.yml" is a configuration file in YAML format. See EXAMPLES section for its content. "t.latest.html" is a template file. In the file, "data" variable can be used. See the document of htree library for template directives. So you can run samidare as follows. % cd $HOME % mkdir samidare % cd samidare % vi config.yml % vi t.latest.html # optional % samidare % w3m latest.html # view the result If you want to publish the result, use symbolic link to latest.html and sites.lirs.gz as follows. % mkdir public_html % mkdir public_html/samidare % cd public_html/samidare % ln -s ../../samidare/latest.html . % ln -s ../../samidare/sites.lirs.gz . EXAMPLES
The configuration file is described in YAML format. The simplest configuration is list of URLs as follows. - http://www.example.org/blog/ - http://www.example.net/ FILES
"config.yml" and "t.latest.html" is configuration file. "latest.html" and "sites.lirs.gz" is output. "status.rm" and "tmp" is used by samidare internally. SECURITY
samidare stores pages in tmp directory. If it is published via your web server, XSS (cross site scripting) is possible. So the directory should not be published. AUTHOR
Tanaka Akira SEE ALSO
htree samidare 0.7 July 2008 SAMIDARE(1)
Man Page