htmltmpl: templating engine for separation of code and HTML

Current versions:

htmltmpl for Python

easydoc for Python
1.22 2001/12/15 download
htmltmpl for PHP 1.12 2001/12/15 download

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

Templating language provided by the engine is inspired by 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 which 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 like for example 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 necessary when the engine is used by web applications.

I am aware that other templating solutions for Python and PHP exist. But none of them is similar to HTML::Template. I love its enforcement of strict separation of code and HTML and the style and syntax of its template language. I find it much more cleaner and maintainable than the other solutions. Also, I need to move some projects from Perl to Python and PHP and I want to reuse my old HTML::Template templates. These are the reasons why I created the templating engine.

The engine now also has an integrated support for gettext, which makes it very 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

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.

Author of the engine and its documentation is not an English native speaker. Corrections of grammar or spelling are welcome.


Credits

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

You should check 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.

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.