diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-05-06 13:25:10 -0700 |
---|---|---|
committer | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-05-06 13:25:10 -0700 |
commit | 07dcd48752456ec1bb4ad87b17c877e71a19d503 (patch) | |
tree | bc771595a5e0849882b7d12e60196b0a0e640224 | |
parent | dc9cb18d816a8723f00585f7f3865332f067190d (diff) | |
download | pystache-07dcd48752456ec1bb4ad87b17c877e71a19d503.tar.gz |
Another README tweak.
-rw-r--r-- | README.rst | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -94,11 +94,14 @@ To customize template loading on a per-view basis, subclass ``TemplateSpec``. See the docstrings of the Renderer_ class and TemplateSpec_ class for more information. -You can also parse a template: :: +You can also pre-parse a template: :: >>> parsed = pystache.parse(u"Hey {{#who}}{{.}}!{{/who}}") >>> print parsed [u'Hey ', _SectionNode(key=u'who', index_begin=12, index_end=18, parsed=[_EscapeNode(key=u'.'), u'!'])] + +And then:: + >>> print renderer.render(parsed, {'who': 'Pops'}) Hey Pops! >>> print renderer.render(parsed, {'who': 'you'}) |