]> Devi Nivas Git - chevron.git/commitdiff
Updated test.mustache and data.json
authornoah morrison <noah@morrison.ph>
Wed, 12 Nov 2014 14:51:36 +0000 (09:51 -0500)
committernoah morrison <noah@morrison.ph>
Wed, 12 Nov 2014 14:51:36 +0000 (09:51 -0500)
data.json
test.mustache

index c6a05b43c0c812e3058c8b1771296e56a338cac9..dbcb0c618aebceebef95828c52f39983784f72db 100644 (file)
--- a/data.json
+++ b/data.json
@@ -1,12 +1,15 @@
 {
-  "thing": "world",
-  "html_escaped": "<b>no escape!</b>",
-  "html_escaped2": "<i>ok</i>",
-  "html_escaped3": "<i> this is escaped though </i>",
-  "show": true,
-  "delimiter": {
-    "1": "do delimiters work?",
-    "2": "yes they do!"
-  },
-  "excited": "!!!"
+  "test": "test",
+  "html_escaped": "< > & \"",
+  "true": true,
+  "false": false,
+  "list": [
+      {"i": 1, "v": "one"},
+      {"i": 2, "v": "two"},
+      {"i": 3, "v": "three"}
+  ],
+
+  "scope": {
+      "test": "new test"
+  }
 }
index dd2cdf03cf07f5e9695defb6ee63c3ddc15556d1..059741262d8eb4ae141ce726a29ac7c4e9f91e2b 100644 (file)
     mustache comment!
 }}
 
-Hello, {{ thing }}!
+variable test
+===
+{{ test }}
+===
+test
+===
 
+comment test
+===
+{{!
+    mustache comment
+}}
+===
+===
+
+html escape test (triple brackets)
+===
 {{{html_escaped}}}
-{{&html_escaped2}}
-{{html_escaped3}}
+===
+< > & "
+===
 
-{{#show}}
-Show is true!
-{{/show}}
+html escape test (ampersand)
+===
+{{& html_escaped}}
+===
+< > & "
+===
 
-{{^show}}
-Show is false!
-{{/show}}
+html escape test (normal)
+===
+{{ html_escaped }}
+===
+&lt; &gt; &amp; &quot;
+===
 
-{{> partial}}
+section test (truthy)
+===
+{{# true }}
+true
+{{/ true }}
+===
+true
+===
 
-{{=<< >>=}}
+section test (falsy)
+===
+{{# false }}
+ERROR
+{{/ false }}
+===
+===
 
-<<delimiter.1>>
+section test (list)
+===
+{{# list }}
+number: {{i}}
+name: {{v}}
+---
+{{/ list }}
+===
+number: 1
+name: one
+---
+number: 2
+name: two
+---
+number: 3
+name: three
+---
+===
 
-<<={{ }}=>>
+section test (scope)
+===
+{{ test }}
+{{# scope }}
+{{ test }}
+{{/ scope }}
+===
+test
+new test
+===
 
-{{delimiter.2}}
+inverted section test (truthy)
+===
+{{^ true }}
+ERROR
+{{/ true }}
+===
+===
+
+inverted section test (falsy)
+===
+{{^ false }}
+false
+{{/ false }}
+===
+false
+===
+
+partial test
+===
+{{> partial}}
+===
+this is a partial
+===
 
-That's all folks!
+delimiter test
+===
+{{=(( ))=}}
+(( test ))
+((={{ }}=))
+{{ test }}
+===
+test
+test
+===