all repos — markup @ v0.3.0

The code we use to render README.your_favorite_markup

test/markups/README.1 (view raw)

  1.\" generated with Ron/v0.3
  2.\" http://github.com/rtomayko/ron/
  3.
  4.TH "MUSTACHE" "1" "March 2010" "DEFUNKT" "Mustache Manual"
  5.
  6.SH "NAME"
  7\fBmustache\fR \-\- Mustache processor
  8.
  9.SH "SYNOPSIS"
 10\fBcat data.yml template.mustache | mustache\fR
 11.
 12.SH "DESCRIPTION"
 13Mustache is a logic\-less templating system for HTML, config files,
 14anything.
 15.
 16.P
 17The \fBmustache\fR command processes a Mustache template preceded by YAML
 18frontmatter from standard input and prints one or more documents to
 19standard output.
 20.
 21.P
 22YAML frontmatter beings with \fB---\fR on a single line, followed by YAML,
 23ending with another \fB---\fR on a single line, e.g.
 24.
 25.IP "" 4
 26.
 27.nf
 28
 29\fB---
 30names: [ {name: chris}, {name: mark}, {name: scott} ]
 31--- \fR
 32.
 33.fi
 34.
 35.IP "" 0
 36.
 37.P
 38If you are unfamiliar with YAML, it is a superset of JSON. Valid JSON
 39should work fine.
 40.
 41.P
 42After the frontmatter should come any valid Mustache template. See
 43mustache(5) for an overview of Mustache templates.
 44.
 45.P
 46For example:
 47.
 48.IP "" 4
 49.
 50.nf
 51
 52\fB{{#names}}
 53  Hi {{name}}!
 54{{/names}} \fR
 55.
 56.fi
 57.
 58.IP "" 0
 59.
 60.P
 61Now let's combine them.
 62.
 63.IP "" 4
 64.
 65.nf
 66
 67\fB$ cat data.yml
 68---
 69names: [ {name: chris}, {name: mark}, {name: scott} ]
 70--- 
 71$ cat template.mustache
 72{{#names}}
 73  Hi {{name}}!
 74{{/names}}
 75
 76$ cat data.yml template.mustache | mustache
 77Hi chris!
 78Hi mark!
 79Hi scott!
 80\fR
 81.
 82.fi
 83.
 84.IP "" 0
 85.
 86.P
 87If you provide multiple YAML documents (as delimited by \fB---\fR), your
 88template will be rendered multiple times. Like a mail merge.
 89.
 90.P
 91For example:
 92.
 93.IP "" 4
 94.
 95.nf
 96
 97\fB$ cat data.yml
 98---
 99name: chris
100---
101name: mark
102---
103name: scott
104--- 
105$ cat template.mustache
106Hi {{name}}!
107
108$ cat data.yml template.mustache | mustache
109Hi chris!
110Hi mark!
111Hi scott!
112\fR
113.
114.fi
115.
116.IP "" 0
117.
118.SH "INSTALLATION"
119If you have RubyGems installed:
120.
121.IP "" 4
122.
123.nf
124
125\fBgem install mustache \fR
126.
127.fi
128.
129.IP "" 0
130.
131.SH "COPYRIGHT"
132Mustache is Copyright (C) 2009 Chris Wanstrath
133.
134.P
135Original CTemplate by Google
136.
137.SH "SEE ALSO"
138mustache(5), mustache(7), gem(1),\fIhttp://defunkt.github.com/mustache/\fR