]> Devi Nivas Git - chevron.git/commitdiff
Updated README
authornoah morrison <noah@morrison.ph>
Wed, 12 Nov 2014 15:12:40 +0000 (10:12 -0500)
committernoah morrison <noah@morrison.ph>
Wed, 12 Nov 2014 15:12:40 +0000 (10:12 -0500)
README.md

index ba2622f873aa6a1bbb601b30f3fed8a80ea2c217..673acd8176d3609771c01ec3759b00296bd51a97 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,13 +1,46 @@
 A python implementation of the [mustache templating language](http://mustache.github.io).
 
-Current commandline usage:
+Commandline usage:
 ```
     ./entei.py [data file] [template file]
 ```
 
+Python usage with strings
+```
+import entei
+
+entei.render('Hello, {{ mustache }}!', {'mustache': 'World'})
+```
+
+Python usage with file
+```
+import entei
+
+with open('file.mustache', 'r') as f:
+    entei.render(f, {'mustache': 'World'})
+```
+
+Python usage with unpacking
+```
+import entei
+
+args = {
+  template: 'Hello, {{ mustache }}!',
+
+  data: {
+    'mustache': 'World'
+  }
+}
+
+entei.render(**args)
+```
+
+
+
 TODO
 ---
 
-* Document!!
-* Better commandline usage
-* Better module usage
+* add comments
+* micro optimizations
+* add unicode support
+* fix python 2 bug (you can't set attributes on file objects)