Edgewall Software


Markup templating engine.


Implementation of the template language for XML-based templates.

>>> tmpl = MarkupTemplate('''<ul xmlns:py="http://genshi.edgewall.org/">
...   <li py:for="item in items">${item}</li>
... </ul>''')
>>> print(tmpl.generate(items=[1, 2, 3]))

add_directives(self, namespace, factory)

Register a custom DirectiveFactory for a given namespace.

param namespace:
 the namespace URI
type namespace:basestring
param factory:the directive factory to register
type factory:DirectiveFactory
since:version 0.6

See Genshi XML Template Language, ApiDocs, Documentation

Last modified 11 months ago Last modified on Dec 10, 2015 6:15:05 AM