Hot on the tails of 0.5, because 0.6 was boring, TurboStan 0.7 is
released. I probably wouldn't have mentioned it except that there are a
couple important bugfixes and a new feature that everyone (well, me) was
screaming for: template inheritance.
From the Changelog (since 0.5):
- Added std variables and functions (i.e. things like std.tg_js and
std.url are now available)
- Dynamically filter variables passed to Kid for reserved names (this
should be removed when Kid is fixed)
- Added config option (stan.prettyoutput = True) to turn on pretty
html output if utidylib is installed - useful for debugging output
- Changed package name to turbostan from stansupport. You can now
directly import (if you really need to) via turbostan.stansupport
which looks a bit better to my eye than stansupport.stansupport ;-)
- Added inheritance similar to Kid and Django templates
The basic syntax of inheritance is this:
index.stan:
-------------
html [
body [
div [ slot ('menu') ],
div [ slot ('content') ]
]
]
page.stan:
-------------
inherits (template = 'index.stan') [
replace (slot = 'content') [
p [ 'this replaces the slot in index.stan' ]
],
replace (slot = 'menu') [
ul (class_ = 'menu') [ li (class_='menuitem')[ m ] for m in
['menu1', 'menu2', 'menu3'] ]
]
]
You may not think it's cool, but I sure did. I also thought it was
damn lucky I got it to work at all, so send me your bug reports.
You can get TurboStan via the Cheese shop (easy_install TurboStan) or
from http://www.develix.com/downloads/TurboStan/TurboStan-0.7.tgz
Regards,
Cliff