Words by c.z.robertson

Templating systems

2002-09-22 22:44:14 UTC

So far, I've been using Sam Tregar's HTML::Template module for all Catkin's templating. However, it doesn't quite suit my needs and I'm looking for a replacement.

The first problem I have with it is largely a matter of taste. It looks like XML but it isn't. This just annoys me. It should either be real XML or not XML at all. And it confuses the syntax highlighting and some of the macros in my text editor.

More importantly, I'd like to be able to do things like specifying the format of a date in the template, and I'd like to be able to do this without dragging Perl syntax into the templates with HTML::Template::Expr.

This is not to say that HTML::Template is not a cool piece of software. It does 90% of what I need perfectly adequately. It's just that other bit that's lacking.

So today I read Choosing a Templating System, and based on that I'm thinking of either investigating Template Toolkit or of creating a templating system which wraps around one of the others to provide the syntax that I'm looking for. I suspect that if I took the latter route it would be fairly simple to just do a bit of regexing from my format to one of the others, but I'll have to give it some more thought, and it's not my first priority.