From: noah morrison Date: Wed, 12 Nov 2014 15:12:40 +0000 (-0500) Subject: Updated README X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=26b42f66dcf13261842fc03e991b933fea36d09b;p=chevron.git Updated README --- diff --git a/README.md b/README.md index ba2622f..673acd8 100644 --- 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)