htmltmpl: templating engine for separation of code and HTML

Current versions:

htmltmpl for Python

easydoc for Python
1.22 15 Dec 2001 download page
htmltmpl for PHP 1.22 4 Jun 2004 download page
htmltmpl for PHP - compiled 2.00 20 Feb 2007 download page

The purpose of the templating engine is to provide web application developers, who need to separate the program code and the design (HTML code) of their web application projects, with a templating tool that can easily be used by cooperating webdesigners with no programming skills.

Templating language provided by the engine is inspired by the Perl templating module HTML::Template. Templates created for HTML::Template can be used with this engine.

The engine is currently available for Python and PHP. The Python package includes easydoc, a module that uses the templating engine to generate HTML documentation from docstrings embedded in source files of Python modules.

The primary goal of the templating engine is to keep things simple for a webdesigner who creates the templates. Therefore, neither Python nor PHP code can be used in the templates. Instead, the templating engine provides its own simple templating language that supports basic programming operations - loops, conditionals and substitution of variables. These operations are controlled from within the templates by statements that look like HTML tags and integrate nicely with regular HTML code.

The secondary goal is good performance. High speed template processing is a neccessity if the engine is to be used in web applications.

I am aware that other templating solutions for Python and PHP exist. But none of them is similar to HTML::Template. I am fond of its enforcement of strict separation of the code and HTML and also of the style and syntax of its templating language. I find it much more cleaner and more maintainable than other solutions. Also, I need to convert some projects from Perl to Python and PHP and I would like to reuse my old HTML::Template templates. That's why I created the templating engine in the first place.

The engine also has an integrated support for gettext. It makes it convenient for development of multilingual "skinnable" web applications.



Author and license

Copyright (c) 2001 Tomas Styblo

Email: tripie@cpan.org

Homepage: http://geocities.com/tripiecz/

Prague, the Czech Republic
Copyright (c) 2007 Jakub Vrana

You can use and redistribute the engine under conditions of the GNU General Public License that can be found either at http://www.gnu.org/ or in file "LICENSE" contained in the distribution tarball of the engine.


Credits

The engine is inspired by the Perl templating module HTML::Template created by Sam Tregar (sam@tregar.com). Sam had invented the excellent templating language. The htmltmpl implementation, however, has been designed from scratch and is not based on the code of HTML::Template.

You should peruse the documentation of HTML::Template. The templating language of htmltmpl is fully compatible with HTML::Template and the documentation of HTML::Template describes it much better than the yet unfinished documentation of htmltmpl does.

The documentation of HTML::Template can be found at http://sam.tregar.com/html_template.html


Support

There is a mailing list for htmltmpl on SourceForge. Don't hesitate to post a message if you find a bug, want to contribute a patch or have some interesting idea.