File tree Expand file tree Collapse file tree 7 files changed +108
-0
lines changed
bin/test/manpage-examples.t Expand file tree Collapse file tree 7 files changed +108
-0
lines changed Original file line number Diff line number Diff line change 1+ { "name" : " OCaml" ,
2+ "qualities" : [{"name" : " simple" }, {"name" : " fun" }] }
Original file line number Diff line number Diff line change 1+ Hello { {name} }!
2+ Mustache is:
3+ { {#qualities} }
4+ - { {name} }
5+ { {/qualities} }
Original file line number Diff line number Diff line change 1+ {
2+ "title" : " New Post" ,
3+ "content" : " Shiny new content."
4+ }
Original file line number Diff line number Diff line change 1+ <html >
2+ <head >
3+ <title >{ {$page -title} }Default Title{ {/page-title} }</title >
4+ </head >
5+ <body >
6+ { {$content } }{ {/content} }
7+ </body >
8+ </html >
Original file line number Diff line number Diff line change 1+ <html >
2+ <body >
3+ { {> hello} }
4+ </body >
5+ </html >
Original file line number Diff line number Diff line change 1+ { {< page-layout} }
2+ { {$page -title} }Post: { {title} }{ {/page-title} }
3+ { {$content } }
4+ <h1 >{ {title} }</h1 >
5+ <p >{ {content} }</p >
6+ { {/content} }
7+ { {/page-layout} }
Original file line number Diff line number Diff line change 1+ Simple usage:
2+
3+ $ cat data. json
4+ { " name" : " OCaml" ,
5+ " qualities" : [{" name" : " simple" }, {" name" : " fun" }] }
6+
7+ $ cat hello. mustache
8+ Hello {{name }}!
9+ Mustache is :
10+ {{# qualities}}
11+ - {{name }}
12+ {{/ qualities}}
13+
14+ $ mustache data. json hello. mustache
15+ Hello OCaml!
16+ Mustache is :
17+ - simple
18+ - fun
19+
20+
21+ Using a partial to include a subpage:
22+
23+ $ cat page. mustache
24+ <html >
25+ <body >
26+ {{> hello}}
27+ </body >
28+ </html >
29+
30+ $ mustache data. json page. mustache
31+ <html >
32+ <body >
33+ Hello OCaml!
34+ Mustache is :
35+ - simple
36+ - fun
37+ </body >
38+ </html >
39+
40+
41+ Using a partial with parameters to include a layout around a page:
42+
43+ $ cat new-post. json
44+ {
45+ " title" : " New Post" ,
46+ " content" : " Shiny new content."
47+ }
48+
49+ $ cat post. mustache
50+ {{< page-layout}}
51+ {{$ page-title }}Post: {{title}}{{/ page-title}}
52+ {{$ content }}
53+ <h1 >{{title}}</h1 >
54+ <p >{{content}}</p >
55+ {{/ content}}
56+ {{/ page-layout}}
57+
58+ $ cat page-layout. mustache
59+ <html >
60+ <head >
61+ <title >{{$ page-title }}Default Title{{/ page-title}}</title >
62+ </head >
63+ <body >
64+ {{$ content }}{{/ content}}
65+ </body >
66+ </html >
67+
68+ $ mustache new-post. json post. mustache
69+ <html >
70+ <head >
71+ <title >Post: New Post</title >
72+ </head >
73+ <body >
74+ <h1 >New Post</h1 >
75+ <p >Shiny new content. </p >
76+ </body >
77+ </html >
You can’t perform that action at this time.
0 commit comments