From 26b42f66dcf13261842fc03e991b933fea36d09b Mon Sep 17 00:00:00 2001 From: noah morrison Date: Wed, 12 Nov 2014 10:12:40 -0500 Subject: [PATCH] Updated README --- README.md | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) 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) -- 2.47.3