You can now specify the data and template files from the command line.
Also added a data.json file, even though it is currently unused.
A python3 implementation of the [mustache templating language](http://mustache.github.io).
-Currently it only tokenizes the file, and doesn't have any nice way of changing the target file.
+Currently it only tokenizes the template file.
+
+Current usage:
+ ./chevron.py [data file] [template file]
#!/usr/bin/python
+import sys
+
def tokenize(template):
class EOF(Exception):
if __name__ == '__main__':
- with open('test.mustache', 'r') as f:
+ data = sys.argv[1]
+ template = sys.argv[2]
+
+ with open(template, 'r') as f:
template = f.read()
tokens = tokenize(template)
--- /dev/null
+{
+ "thing": "world",
+ "html_escaped": "<b>no escape!</b>",
+ "html_escaped2": "<i>ok</i>",
+ "show": true,
+ "delimiter": "custom delimiters work!"
+}