Simple template engine to convert JSON to HTML/XML
Project description
A simple template engine designed to convert JSON to HTML or XML. Templates hold no logic whatsoever, with nodes being repeated as needed by the replacement data. Here’s a simple template:
>>> from shrubbery.shrubbery import Template >>> template = "<ul><li>{todo}</li></ul>"
We can pass a single value as the todo expression:
>>> print Template(template, {"todo": "nothing"}) <ul><li>nothing</li></ul>
But if we pass a list instead, the node is repeated as necessary:
>>> print Template(template, {"todo": ["one", "two", "three"]}) <ul><li>one</li><li>two</li><li>three</li></ul>
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
shrubbery-0.1.1.tar.gz
(5.3 kB
view hashes)
Built Distribution
shrubbery-0.1.1-py2.4.egg
(16.2 kB
view hashes)