Kid (templating language)
Kid is a simple template engine for XML-based vocabularies written in Python. Kid claims to have many of the best features of XSLT, TAL, and PHP, but "with much of the limitations and complexity stamped out".
Kid initially acted as the Controller component of the TurboGears framework in the framework's version 1.x implementation; however, the TurboGears project team has since replaced it with Genshi, citing perceived performance advantages.
from kid import Template template = Template(file='mytemplate.kid', title='bar', mylist=['1', '2', '3', '4', '5', '6'] ) print template.serialize()
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"> <head> <title py:content="title">title goes here</title> </head> <body> <ul> <li py:for="item in mylist" py:content="item">item goes here</li> </ul> </body> </html>
- Official website[dead link]
- Official Website at the Wayback Machine (archived May 27, 2011)
- A Brief Introduction to Kid Templates — TurboGears v1.0 documentation
|This programming-tool-related article is a stub. You can help Wikipedia by expanding it.|