Browse files


  • Loading branch information...
1 parent 5c715dc commit 4843d9cda2425a7c1c729a71b8fe26b04e726090 @defunkt defunkt committed Mar 26, 2010
Showing with 35 additions and 1 deletion.
  1. +35 −1 mustache.1.html
36 mustache.1.html
@@ -67,7 +67,10 @@ <h2 id='NAME'>NAME</h2>
-<p><code>cat data.yml template.mustache | mustache</code></p>
+<pre><code>mustache &lt;YAML> &lt;FILE>
+mustache --compile &lt;FILE>
+mustache --tokens &lt;FILE>
@@ -140,13 +143,44 @@ <h2 id='NAME'>NAME</h2>
Hi scott!
+<p>By default <code>mustache</code> will try to render a Mustache template using the
+YAML frontmatter you provide. It can do a few other things, however.</p>
+<dt><code>-c</code>, <code>--compile</code></dt><dd><p>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.</p></dd>
+<dt><code>-t</code>, <code>--tokens</code></dt><dd><p>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.</p></dd>
<p>If you have RubyGems installed:</p>
<pre><code>gem install mustache
+<pre><code>$ mustache data.yml template.mustache
+$ cat data.yml | mustache - template.mustache
+$ mustache -c template.mustache
+$ cat &lt;&lt;data | ruby mustache - template.mustache
+name: Bob
+age: 30
<p>Mustache is Copyright (C) 2009 Chris Wanstrath</p>

0 comments on commit 4843d9c

Please sign in to comment.