mustache 0.99.4 → 0.99.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +3 -9
- data/lib/mustache.rb +3 -3
- data/lib/mustache/generator.rb +5 -5
- data/lib/mustache/parser.rb +9 -5
- data/lib/mustache/sinatra.rb +23 -4
- data/lib/mustache/version.rb +1 -1
- data/man/mustache.1 +25 -40
- data/man/mustache.1.html +86 -77
- data/man/mustache.1.ron +1 -1
- data/man/mustache.5 +44 -81
- data/man/mustache.5.html +87 -80
- data/man/mustache.5.ron +1 -1
- data/test/parser_test.rb +9 -4
- metadata +23 -47
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1a22fd6d24b05a356ea96d520d05b1d558789a55
|
4
|
+
data.tar.gz: 434c410c4f8eec4c004ce4dce27d9cc7e6e8d03a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3fddf352c8e8ec2303c451a834a3ed437de4dacffe211ff55f64a165dcef9692a972f2346cb6bd272fcfecccc58fef762f055a8f7c19bc74e627c851ba5321db
|
7
|
+
data.tar.gz: 091b121190a804a7d003f762b08f2ab287811ed94f3642233fcda90773affee179bc69de7132b159dae3da4cd5f4c7928cefb3d2ea49a2333038c046993c1a9a
|
data/README.md
CHANGED
@@ -107,7 +107,7 @@ Escaping
|
|
107
107
|
|
108
108
|
Mustache does escape all values when using the standard double
|
109
109
|
Mustache syntax. Characters which will be escaped: `& \ " < >`. To
|
110
|
-
disable escaping, simply use
|
110
|
+
disable escaping, simply use triple mustaches like
|
111
111
|
`{{{unescaped_variable}}}`.
|
112
112
|
|
113
113
|
Example: Using `{{variable}}` inside a template for `5 > 2` will
|
@@ -251,7 +251,7 @@ Then just include it:
|
|
251
251
|
Great, but what about that `@ssl` ivar in `gravatar_host`? There are
|
252
252
|
many ways we can go about setting it.
|
253
253
|
|
254
|
-
Here's
|
254
|
+
Here's an example which illustrates a key feature of Mustache: you
|
255
255
|
are free to use the `initialize` method just as you would in any
|
256
256
|
normal class.
|
257
257
|
|
@@ -326,12 +326,7 @@ See <http://gist.github.com/323622> for installation instructions.
|
|
326
326
|
Emacs
|
327
327
|
-----
|
328
328
|
|
329
|
-
mustache-mode.el is
|
330
|
-
Emacs users. Based on Google's tpl-mode for ctemplates, it adds
|
331
|
-
support for Mustache's more lenient tag values and includes a few
|
332
|
-
commands for your editing pleasure.
|
333
|
-
|
334
|
-
See <http://gist.github.com/323619> for installation instructions.
|
329
|
+
mustache-mode.el is available at https://github.com/mustache/emacs
|
335
330
|
|
336
331
|
|
337
332
|
TextMate
|
@@ -400,7 +395,6 @@ Meta
|
|
400
395
|
* Home: <http://mustache.github.com>
|
401
396
|
* Bugs: <http://github.com/defunkt/mustache/issues>
|
402
397
|
* List: <mustache@librelist.com>
|
403
|
-
* Test: <http://runcoderun.com/defunkt/mustache>
|
404
398
|
* Gems: <http://rubygems.org/gems/mustache>
|
405
399
|
|
406
400
|
You can also find us in `#{` on irc.freenode.net.
|
data/lib/mustache.rb
CHANGED
@@ -40,7 +40,7 @@ require 'mustache/settings'
|
|
40
40
|
#
|
41
41
|
# * template_file
|
42
42
|
#
|
43
|
-
# You can tell Mustache exactly which template to
|
43
|
+
# You can tell Mustache exactly which template to use with this
|
44
44
|
# setting. It can be a relative or absolute path.
|
45
45
|
#
|
46
46
|
# * template
|
@@ -234,8 +234,8 @@ class Mustache
|
|
234
234
|
# Returns the constant if found
|
235
235
|
# Returns nil if nothing is found
|
236
236
|
def self.const_get!(name)
|
237
|
-
name.split('::').inject(Object) do |klass,
|
238
|
-
klass.const_get(
|
237
|
+
name.split('::').inject(Object) do |klass, cname|
|
238
|
+
klass.const_get(cname)
|
239
239
|
end
|
240
240
|
rescue NameError
|
241
241
|
nil
|
data/lib/mustache/generator.rb
CHANGED
@@ -90,7 +90,7 @@ class Mustache
|
|
90
90
|
|
91
91
|
# Callback fired when the compiler finds a section token. We're
|
92
92
|
# passed the section name and the array of tokens.
|
93
|
-
def on_section(name, content, raw, delims)
|
93
|
+
def on_section(name, offset, content, raw, delims)
|
94
94
|
# Convert the tokenized content of this section into a Ruby
|
95
95
|
# string we can use.
|
96
96
|
code = compile(content)
|
@@ -121,7 +121,7 @@ class Mustache
|
|
121
121
|
|
122
122
|
# Fired when we find an inverted section. Just like `on_section`,
|
123
123
|
# we're passed the inverted section name and the array of tokens.
|
124
|
-
def on_inverted_section(name, content, raw,
|
124
|
+
def on_inverted_section(name, offset, content, raw, delims)
|
125
125
|
# Convert the tokenized content of this section into a Ruby
|
126
126
|
# string we can use.
|
127
127
|
code = compile(content)
|
@@ -139,12 +139,12 @@ class Mustache
|
|
139
139
|
# Fired when the compiler finds a partial. We want to return code
|
140
140
|
# which calls a partial at runtime instead of expanding and
|
141
141
|
# including the partial's body to allow for recursive partials.
|
142
|
-
def on_partial(name, indentation)
|
142
|
+
def on_partial(name, offset, indentation)
|
143
143
|
ev("ctx.partial(#{name.to_sym.inspect}, #{indentation.inspect})")
|
144
144
|
end
|
145
145
|
|
146
146
|
# An unescaped tag.
|
147
|
-
def on_utag(name)
|
147
|
+
def on_utag(name, offset)
|
148
148
|
ev(<<-compiled)
|
149
149
|
v = #{compile!(name)}
|
150
150
|
if v.is_a?(Proc)
|
@@ -155,7 +155,7 @@ class Mustache
|
|
155
155
|
end
|
156
156
|
|
157
157
|
# An escaped tag.
|
158
|
-
def on_etag(name)
|
158
|
+
def on_etag(name, offset)
|
159
159
|
ev(<<-compiled)
|
160
160
|
v = #{compile!(name)}
|
161
161
|
if v.is_a?(Proc)
|
data/lib/mustache/parser.rb
CHANGED
@@ -146,12 +146,12 @@ EOF
|
|
146
146
|
case type
|
147
147
|
when '#'
|
148
148
|
block = [:multi]
|
149
|
-
@result << [:mustache, :section, fetch, block]
|
149
|
+
@result << [:mustache, :section, fetch, offset, block]
|
150
150
|
@sections << [content, position, @result]
|
151
151
|
@result = block
|
152
152
|
when '^'
|
153
153
|
block = [:multi]
|
154
|
-
@result << [:mustache, :inverted_section, fetch, block]
|
154
|
+
@result << [:mustache, :inverted_section, fetch, offset, block]
|
155
155
|
@sections << [content, position, @result]
|
156
156
|
@result = block
|
157
157
|
when '/'
|
@@ -169,14 +169,14 @@ EOF
|
|
169
169
|
when '='
|
170
170
|
self.otag, self.ctag = content.split(' ', 2)
|
171
171
|
when '>', '<'
|
172
|
-
@result << [:mustache, :partial, content, padding]
|
172
|
+
@result << [:mustache, :partial, content, offset, padding]
|
173
173
|
when '{', '&'
|
174
174
|
# The closing } in unescaped tags is just a hack for
|
175
175
|
# aesthetics.
|
176
176
|
type = "}" if type == "{"
|
177
|
-
@result << [:mustache, :utag, fetch]
|
177
|
+
@result << [:mustache, :utag, fetch, offset]
|
178
178
|
else
|
179
|
-
@result << [:mustache, :etag, fetch]
|
179
|
+
@result << [:mustache, :etag, fetch, offset]
|
180
180
|
end
|
181
181
|
|
182
182
|
# Skip whitespace and any balancing sigils after the content
|
@@ -234,6 +234,10 @@ EOF
|
|
234
234
|
end
|
235
235
|
end
|
236
236
|
|
237
|
+
def offset
|
238
|
+
position[0, 2]
|
239
|
+
end
|
240
|
+
|
237
241
|
# Returns [lineno, column, line]
|
238
242
|
def position
|
239
243
|
# The rest of the current line
|
data/lib/mustache/sinatra.rb
CHANGED
@@ -39,6 +39,18 @@ class Mustache
|
|
39
39
|
# You can indeed use layouts with this library. Where you'd normally
|
40
40
|
# <%= yield %> you instead {{{yield}}} - the body of the subview is
|
41
41
|
# set to the `yield` variable and made available to you.
|
42
|
+
#
|
43
|
+
# If you don't want the Sinatra extension to look up your view class,
|
44
|
+
# maybe because you've already loaded it or you're pulling it in from
|
45
|
+
# a gem, you can hand the `mustache` helper a Mustache subclass directly:
|
46
|
+
#
|
47
|
+
# # Assuming `class Omnigollum::Login < Mustache`
|
48
|
+
# get '/login' do
|
49
|
+
# @title = "Log In"
|
50
|
+
# require 'lib/omnigollum/views/login'
|
51
|
+
# mustache Omnigollum::Login
|
52
|
+
# end
|
53
|
+
#
|
42
54
|
module Sinatra
|
43
55
|
module Helpers
|
44
56
|
# Call this in your Sinatra routes.
|
@@ -72,10 +84,17 @@ class Mustache
|
|
72
84
|
end
|
73
85
|
end
|
74
86
|
|
75
|
-
#
|
76
|
-
#
|
77
|
-
|
78
|
-
|
87
|
+
# If instead of a symbol they gave us a Mustache class,
|
88
|
+
# use that for rendering.
|
89
|
+
klass = template if template.is_a?(Class) && template < Mustache
|
90
|
+
|
91
|
+
# Find and cache the view class we want if we don't have
|
92
|
+
# one yet. This ensures the compiled template is cached,
|
93
|
+
# too - no looking up and compiling templates on each page
|
94
|
+
# load.
|
95
|
+
if klass.nil?
|
96
|
+
klass = mustache_class(template, options)
|
97
|
+
end
|
79
98
|
|
80
99
|
# Does the view subclass the layout? If so we'll use the
|
81
100
|
# view to render the layout so you can override layout
|
data/lib/mustache/version.rb
CHANGED
data/man/mustache.1
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
.\" generated with Ronn/v0.
|
2
|
-
.\" http://github.com/rtomayko/ronn/
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "MUSTACHE" "1" "
|
4
|
+
.TH "MUSTACHE" "1" "August 2011" "DEFUNKT" "Mustache Manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
|
-
\fBmustache\fR
|
7
|
+
\fBmustache\fR \- Mustache processor
|
8
8
|
.
|
9
9
|
.SH "SYNOPSIS"
|
10
10
|
.
|
@@ -17,17 +17,13 @@ mustache \-\-tokens <FILE>
|
|
17
17
|
.fi
|
18
18
|
.
|
19
19
|
.SH "DESCRIPTION"
|
20
|
-
Mustache is a logic\-less templating system for HTML, config files,
|
21
|
-
anything.
|
20
|
+
Mustache is a logic\-less templating system for HTML, config files, anything\.
|
22
21
|
.
|
23
22
|
.P
|
24
|
-
The \fBmustache\fR command processes a Mustache template preceded by YAML
|
25
|
-
frontmatter from standard input and prints one or more documents to
|
26
|
-
standard output.
|
23
|
+
The \fBmustache\fR command processes a Mustache template preceded by YAML frontmatter from standard input and prints one or more documents to standard output\.
|
27
24
|
.
|
28
25
|
.P
|
29
|
-
YAML frontmatter beings with \fB\-\-\-\fR on a single line, followed by YAML,
|
30
|
-
ending with another \fB\-\-\-\fR on a single line, e.g.
|
26
|
+
YAML frontmatter beings with \fB\-\-\-\fR on a single line, followed by YAML, ending with another \fB\-\-\-\fR on a single line, e\.g\.
|
31
27
|
.
|
32
28
|
.IP "" 4
|
33
29
|
.
|
@@ -42,12 +38,10 @@ names: [ {name: chris}, {name: mark}, {name: scott} ]
|
|
42
38
|
.IP "" 0
|
43
39
|
.
|
44
40
|
.P
|
45
|
-
If you are unfamiliar with YAML, it is a superset of JSON
|
46
|
-
should work fine.
|
41
|
+
If you are unfamiliar with YAML, it is a superset of JSON\. Valid JSON should work fine\.
|
47
42
|
.
|
48
43
|
.P
|
49
|
-
After the frontmatter should come any valid Mustache template
|
50
|
-
mustache(5) for an overview of Mustache templates.
|
44
|
+
After the frontmatter should come any valid Mustache template\. See mustache(5) for an overview of Mustache templates\.
|
51
45
|
.
|
52
46
|
.P
|
53
47
|
For example:
|
@@ -65,23 +59,23 @@ For example:
|
|
65
59
|
.IP "" 0
|
66
60
|
.
|
67
61
|
.P
|
68
|
-
Now let's combine them
|
62
|
+
Now let\'s combine them\.
|
69
63
|
.
|
70
64
|
.IP "" 4
|
71
65
|
.
|
72
66
|
.nf
|
73
67
|
|
74
|
-
$ cat data
|
68
|
+
$ cat data\.yml
|
75
69
|
\-\-\-
|
76
70
|
names: [ {name: chris}, {name: mark}, {name: scott} ]
|
77
71
|
\-\-\-
|
78
72
|
|
79
|
-
$ cat template
|
73
|
+
$ cat template\.mustache
|
80
74
|
{{#names}}
|
81
75
|
Hi {{name}}!
|
82
76
|
{{/names}}
|
83
77
|
|
84
|
-
$ cat data
|
78
|
+
$ cat data\.yml template\.mustache | mustache
|
85
79
|
Hi chris!
|
86
80
|
Hi mark!
|
87
81
|
Hi scott!
|
@@ -91,8 +85,7 @@ Hi scott!
|
|
91
85
|
.IP "" 0
|
92
86
|
.
|
93
87
|
.P
|
94
|
-
If you provide multiple YAML documents (as delimited by \fB\-\-\-\fR), your
|
95
|
-
template will be rendered multiple times. Like a mail merge.
|
88
|
+
If you provide multiple YAML documents (as delimited by \fB\-\-\-\fR), your template will be rendered multiple times\. Like a mail merge\.
|
96
89
|
.
|
97
90
|
.P
|
98
91
|
For example:
|
@@ -101,7 +94,7 @@ For example:
|
|
101
94
|
.
|
102
95
|
.nf
|
103
96
|
|
104
|
-
$ cat data
|
97
|
+
$ cat data\.yml
|
105
98
|
\-\-\-
|
106
99
|
name: chris
|
107
100
|
\-\-\-
|
@@ -110,10 +103,10 @@ name: mark
|
|
110
103
|
name: scott
|
111
104
|
\-\-\-
|
112
105
|
|
113
|
-
$ cat template
|
106
|
+
$ cat template\.mustache
|
114
107
|
Hi {{name}}!
|
115
108
|
|
116
|
-
$ cat data
|
109
|
+
$ cat data\.yml template\.mustache | mustache
|
117
110
|
Hi chris!
|
118
111
|
Hi mark!
|
119
112
|
Hi scott!
|
@@ -123,23 +116,15 @@ Hi scott!
|
|
123
116
|
.IP "" 0
|
124
117
|
.
|
125
118
|
.SH "OPTIONS"
|
126
|
-
By default \fBmustache\fR will try to render a Mustache template using the
|
127
|
-
YAML frontmatter you provide. It can do a few other things, however.
|
119
|
+
By default \fBmustache\fR will try to render a Mustache template using the YAML frontmatter you provide\. It can do a few other things, however\.
|
128
120
|
.
|
129
121
|
.TP
|
130
122
|
\fB\-c\fR, \fB\-\-compile\fR
|
131
|
-
Print the compiled Ruby version of a given template
|
132
|
-
code that is actually used when rendering a template into a
|
133
|
-
string. Useful for debugging but only if you are familiar with
|
134
|
-
Mustache's internals.
|
123
|
+
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\.
|
135
124
|
.
|
136
125
|
.TP
|
137
126
|
\fB\-t\fR, \fB\-\-tokens\fR
|
138
|
-
Print the tokenized form of a given Mustache template
|
139
|
-
used to understand how Mustache parses a template. The tokens are
|
140
|
-
handed to a generator which compiles them into a Ruby
|
141
|
-
string. Syntax errors and confused tags, therefor, can probably be
|
142
|
-
identified by examining the tokens produced.
|
127
|
+
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\.
|
143
128
|
.
|
144
129
|
.SH "INSTALLATION"
|
145
130
|
If you have RubyGems installed:
|
@@ -158,10 +143,10 @@ gem install mustache
|
|
158
143
|
.
|
159
144
|
.nf
|
160
145
|
|
161
|
-
$ mustache data
|
162
|
-
$ cat data
|
163
|
-
$ mustache \-c template
|
164
|
-
$ cat <<data | ruby mustache \- template
|
146
|
+
$ mustache data\.yml template\.mustache
|
147
|
+
$ cat data\.yml | mustache \- template\.mustache
|
148
|
+
$ mustache \-c template\.mustache
|
149
|
+
$ cat <<data | ruby mustache \- template\.mustache
|
165
150
|
\-\-\-
|
166
151
|
name: Bob
|
167
152
|
age: 30
|
@@ -177,4 +162,4 @@ Mustache is Copyright (C) 2009 Chris Wanstrath
|
|
177
162
|
Original CTemplate by Google
|
178
163
|
.
|
179
164
|
.SH "SEE ALSO"
|
180
|
-
mustache(5),
|
165
|
+
mustache(5), gem(1), \fIhttp://mustache\.github\.com/\fR
|
data/man/mustache.1.html
CHANGED
@@ -2,77 +2,86 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
5
|
-
<meta name='generator' value='Ronn/v0.
|
6
|
-
<title>mustache(1)
|
7
|
-
<style type='text/css'>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
float:left; width:33%; list-style-type:none;
|
44
|
-
text-transform:uppercase; font-size:18px; color:#999;
|
45
|
-
letter-spacing:1px;}
|
46
|
-
#man ol.man { width:100%; }
|
47
|
-
#man ol.man li.tl { text-align:left }
|
48
|
-
#man ol.man li.tc { text-align:center;letter-spacing:4px }
|
49
|
-
#man ol.man li.tr { text-align:right }
|
50
|
-
#man ol.man a { color:#999 }
|
51
|
-
#man ol.man a:hover { color:#333231 }
|
5
|
+
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
|
6
|
+
<title>mustache(1) - Mustache processor</title>
|
7
|
+
<style type='text/css' media='all'>
|
8
|
+
/* style: man */
|
9
|
+
body#manpage {margin:0}
|
10
|
+
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
|
11
|
+
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
|
12
|
+
.mp h2 {margin:10px 0 0 0}
|
13
|
+
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
|
14
|
+
.mp h3 {margin:0 0 0 4ex}
|
15
|
+
.mp dt {margin:0;clear:left}
|
16
|
+
.mp dt.flush {float:left;width:8ex}
|
17
|
+
.mp dd {margin:0 0 0 9ex}
|
18
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
|
19
|
+
.mp pre {margin-bottom:20px}
|
20
|
+
.mp pre+h2,.mp pre+h3 {margin-top:22px}
|
21
|
+
.mp h2+pre,.mp h3+pre {margin-top:5px}
|
22
|
+
.mp img {display:block;margin:auto}
|
23
|
+
.mp h1.man-title {display:none}
|
24
|
+
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
|
25
|
+
.mp h2 {font-size:16px;line-height:1.25}
|
26
|
+
.mp h1 {font-size:20px;line-height:2}
|
27
|
+
.mp {text-align:justify;background:#fff}
|
28
|
+
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
|
29
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
|
30
|
+
.mp u {text-decoration:underline}
|
31
|
+
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
|
32
|
+
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
|
33
|
+
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
|
34
|
+
.mp b.man-ref {font-weight:normal;color:#434241}
|
35
|
+
.mp pre {padding:0 4ex}
|
36
|
+
.mp pre code {font-weight:normal;color:#434241}
|
37
|
+
.mp h2+pre,h3+pre {padding-left:0}
|
38
|
+
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
|
39
|
+
ol.man-decor {width:100%}
|
40
|
+
ol.man-decor li.tl {text-align:left}
|
41
|
+
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
|
42
|
+
ol.man-decor li.tr {text-align:right;float:right}
|
52
43
|
</style>
|
53
44
|
</head>
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
<
|
63
|
-
|
64
|
-
|
65
|
-
<
|
66
|
-
<
|
67
|
-
|
68
|
-
<
|
45
|
+
<!--
|
46
|
+
The following styles are deprecated and will be removed at some point:
|
47
|
+
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
|
48
|
+
|
49
|
+
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
|
50
|
+
.man-navigation should be used instead.
|
51
|
+
-->
|
52
|
+
<body id='manpage'>
|
53
|
+
<div class='mp' id='man'>
|
54
|
+
|
55
|
+
<div class='man-navigation' style='display:none'>
|
56
|
+
<a href="#NAME">NAME</a>
|
57
|
+
<a href="#SYNOPSIS">SYNOPSIS</a>
|
58
|
+
<a href="#DESCRIPTION">DESCRIPTION</a>
|
59
|
+
<a href="#OPTIONS">OPTIONS</a>
|
60
|
+
<a href="#INSTALLATION">INSTALLATION</a>
|
61
|
+
<a href="#EXAMPLES">EXAMPLES</a>
|
62
|
+
<a href="#COPYRIGHT">COPYRIGHT</a>
|
63
|
+
<a href="#SEE-ALSO">SEE ALSO</a>
|
64
|
+
</div>
|
65
|
+
|
66
|
+
<ol class='man-decor man-head man head'>
|
67
|
+
<li class='tl'>mustache(1)</li>
|
68
|
+
<li class='tc'>Mustache Manual</li>
|
69
|
+
<li class='tr'>mustache(1)</li>
|
70
|
+
</ol>
|
71
|
+
|
72
|
+
<h2 id="NAME">NAME</h2>
|
73
|
+
<p class="man-name">
|
74
|
+
<code>mustache</code> - <span class="man-whatis">Mustache processor</span>
|
75
|
+
</p>
|
76
|
+
|
77
|
+
<h2 id="SYNOPSIS">SYNOPSIS</h2>
|
69
78
|
|
70
79
|
<pre><code>mustache <YAML> <FILE>
|
71
80
|
mustache --compile <FILE>
|
72
81
|
mustache --tokens <FILE>
|
73
82
|
</code></pre>
|
74
83
|
|
75
|
-
<h2>DESCRIPTION</h2>
|
84
|
+
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
76
85
|
|
77
86
|
<p>Mustache is a logic-less templating system for HTML, config files,
|
78
87
|
anything.</p>
|
@@ -93,7 +102,7 @@ names: [ {name: chris}, {name: mark}, {name: scott} ]
|
|
93
102
|
should work fine.</p>
|
94
103
|
|
95
104
|
<p>After the frontmatter should come any valid Mustache template. See
|
96
|
-
mustache(5) for an overview of Mustache templates.</p>
|
105
|
+
<a href="mustache.5.ron.html" class="man-ref">mustache<span class="s">(5)</span></a> for an overview of Mustache templates.</p>
|
97
106
|
|
98
107
|
<p>For example:</p>
|
99
108
|
|
@@ -143,7 +152,7 @@ Hi mark!
|
|
143
152
|
Hi scott!
|
144
153
|
</code></pre>
|
145
154
|
|
146
|
-
<h2>OPTIONS</h2>
|
155
|
+
<h2 id="OPTIONS">OPTIONS</h2>
|
147
156
|
|
148
157
|
<p>By default <code>mustache</code> will try to render a Mustache template using the
|
149
158
|
YAML frontmatter you provide. It can do a few other things, however.</p>
|
@@ -161,14 +170,14 @@ identified by examining the tokens produced.</p></dd>
|
|
161
170
|
</dl>
|
162
171
|
|
163
172
|
|
164
|
-
<h2>INSTALLATION</h2>
|
173
|
+
<h2 id="INSTALLATION">INSTALLATION</h2>
|
165
174
|
|
166
175
|
<p>If you have RubyGems installed:</p>
|
167
176
|
|
168
177
|
<pre><code>gem install mustache
|
169
178
|
</code></pre>
|
170
179
|
|
171
|
-
<h2>EXAMPLES</h2>
|
180
|
+
<h2 id="EXAMPLES">EXAMPLES</h2>
|
172
181
|
|
173
182
|
<pre><code>$ mustache data.yml template.mustache
|
174
183
|
$ cat data.yml | mustache - template.mustache
|
@@ -181,24 +190,24 @@ age: 30
|
|
181
190
|
data
|
182
191
|
</code></pre>
|
183
192
|
|
184
|
-
<h2>COPYRIGHT</h2>
|
193
|
+
<h2 id="COPYRIGHT">COPYRIGHT</h2>
|
185
194
|
|
186
195
|
<p>Mustache is Copyright (C) 2009 Chris Wanstrath</p>
|
187
196
|
|
188
197
|
<p>Original CTemplate by Google</p>
|
189
198
|
|
190
|
-
<h2>SEE ALSO</h2>
|
199
|
+
<h2 id="SEE-ALSO">SEE ALSO</h2>
|
191
200
|
|
192
|
-
<p
|
193
|
-
<a href="http://mustache.github.com/">http://mustache.github.com/</a></p>
|
201
|
+
<p><a href="mustache.5.ron.html" class="man-ref">mustache<span class="s">(5)</span></a>, <span class="man-ref">gem<span class="s">(1)</span></span>,
|
202
|
+
<a href="http://mustache.github.com/" data-bare-link="true">http://mustache.github.com/</a></p>
|
194
203
|
|
195
204
|
|
196
|
-
<ol class='foot man'>
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
</ol>
|
205
|
+
<ol class='man-decor man-foot man foot'>
|
206
|
+
<li class='tl'>DEFUNKT</li>
|
207
|
+
<li class='tc'>August 2011</li>
|
208
|
+
<li class='tr'>mustache(1)</li>
|
209
|
+
</ol>
|
201
210
|
|
202
|
-
</div>
|
211
|
+
</div>
|
203
212
|
</body>
|
204
213
|
</html>
|