Wikipedia

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 View 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.[1]

Kid is used by the Fedora Project in the repoview utility [2] which creates a set of static HTML pages within a YUM repository.

Example

Python part:

from kid import Template template = Template(file='mytemplate.kid', title='bar', mylist=['1', '2', '3', '4', '5', '6'] ) print template.serialize 

Template part:

<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> 

References

  1. ^ Replacing Kid with Genshi, A Brief Introduction to Kid Templates — TurboGears v1.0 documentation
  2. ^ Repoview at Fedora Hosted

External links


This article is copied from an article on Wikipedia® - the free encyclopedia created and edited by its online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of Wikipedia® encyclopedia articles provide accurate and timely information, please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.

Copyright © 2003-2025 Farlex, Inc Disclaimer
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.