Just Kidding

Since I noticed it as one of TurboGears' base components, I had the Kid template system on my list. The last days I managed to play around with it and eventually ported this site's templates from SimpleTAL to Kid.

What I like about SimpleTAL is that it is a pure-Python package, doesn't require additional packages and is stable. I even seriously thought about writing a plugin for Buffet, which would likely be named TurboTAL, to allow for integration with CherryPy. But for the time being, I put that on hold.

Kid is also a pure package and only depends on Fredrik Lundh's ElementTree package which also is pure and anyway a must-have (which will ship with Python 2.5, by the way) - so no problem so far.

Compared to SimpleTAL, it's somewhat more complex, but it saved me tons of markup due to its ${} expression (using tal:attributes is usually just annoying). Also, you always use Python, while SimpleTAL has its limited TALES path expressions. Python can be used instead here and there, too (which additionally blows up the markup), but you normally end up using both in parallel which is just one expression syntax more than really needed. Finally converting TALES expressions to Python when its limits are reached becomes another bothering practice.

On the other hand, Kid (I use the current 0.9.1) feels far from a 1.0 release. For example, the output is ugly and confusing: I want clean XHTML so anybody viewing the page source can easily understand its structure. Not to forget: Sometimes, whitespace does make a difference with some browsers. The *py:match* thing tenaciously resisted my intention to get it working like (I) expected. At least py:layout gave up and now does its job.

What makes me wonder is the fact that there are many tickets in the Kid Trac that describe many of the annoying issues. Some of the authors even provide patches, however they were still not included in the trunk. Once some stuff like this is fixed, I might get really happy with Kid. For now, I will see if it proves itself for me, although I'm confident. SimpleTAL will still be an option for me to use in small projects.