Edgewall Software

Error: Macro Title(genshi.template.text) failed
pre-0.11 Wiki macro Title by provider <class 'Title.TitleMacro'> no longer supported

genshi.template.text

Plain text templating engine.

TextTemplate

Implementation of a simple text-based template engine.

>>> tmpl = TextTemplate('''Dear $name,
...
... We have the following items for you:
... #for item in items
...  * $item
... #end
...
... All the best,
... Foobar''')
>>> print tmpl.generate(name='Joe', items=[1, 2, 3]).render('text')
Dear Joe,
<BLANKLINE>
We have the following items for you:
 * 1
 * 2
 * 3
<BLANKLINE>
All the best,
Foobar


See ApiDocs, Documentation

Last modified 8 years ago Last modified on Apr 16, 2007 5:44:08 PM