Template- and Generator-Tools
This is a list of mostly general purpose template and generator tools
with a slight bias for XML/HTML-templating. I also focus on
frameworks and libraries for developers or command-line (i.e. unixish)
tools. So you will probably not find any GUI-only or special purpose
tools (e.g. DB-generators). The descriptions are mostly taken from the
introducory text of the project homepages.
- FreeMarker (http://freemarker.sourceforge.net/index.html)
FreeMarker is a "template engine"; a generic tool to generate text
output (anything from HTML or RTF to autogenerated source code) based
on templates. It is 100% written in Java. FMPP (http://fmpp.sourceforge.net/)
is a general-purpose text file preprocessor tool that uses FreeMarker
templates. It is particularly designed for HTML preprocessor, to
generate complete (static) homepages: directory structure that contains
HTML-s, image files, etc. But of course it can be used to generate
source code or whatever text files. FMPP is extendable with Java
classes to pull data from any data sources (database, etc.) and embed
the data into the generated files.
- Velocity (http://jakarta.apache.org/velocity/index.html)
Velocity is a Java-based template engine. It permits anyone to use the
simple yet powerful template language to reference objects defined in
Java code. There is also a .NET port underway: http://nvelocity.sourceforge.net/.
is a Java code-generation framework. It takes Java source-code,
annotated with custom Javadoc tags, and uses Velocity templates to
produce a number of output files.
- WebMacro (http://www.webmacro.org/)
Precursor of Velocity. (See http://jakarta.apache.org/velocity/differences.html
for differences from Velocity's point of view)
- Jostraca (http://www.jostraca.org/)
Jostraca is a general purpose code generation toolkit for software
developers. Code generation helps save you time and effort by reducing
redundancy and drudge work. Code generation can be thought of as programming
by example. Show the computer an example of what
you want, and it does the rest.
Jostraca generates code using the Java Server
Pages syntax. However this syntax can be used with any
language. Jostraca comes preconfigured for Java, Perl,
Python, Ruby, Rebol and C, with more to come.
- Jamon (http://www.jamon.org/)
(very good inheritance
Jamon is a text template engine for Java,
useful for generating dynamic HTML,
XML, or any text-based content.
architecture, Jamon clearly is aimed at the View (or presentation)
layer. Because it is compiled to non-reflective Java code, and
statically type-checked, Jamon is ideally suited to support refactoring of
template-based UI applications. Using mock objects -like
functionality, Jamon also facilitates unit testing of the controller
and view. See the list of
features for more detail. The motivations for Jamon came from
dissatisfaction with current
presentation layer technologies such as JSP and Velocity. Ideas
was also drawn from a surprisingly pleasant experience with Mason, which though written in
and for Perl, provided inspiration
both conceptual and syntactic (for better or worse).
- Jatha (http://www.kimbly.com/code/jatha/)
Lisp macros are Lisp programs that write Lisp programs. Jatha macros
are Java programs that write Java programs.
- Woven (http://twistedmatrix.com/documents/howto/woven)
Woven is a Web Application Framework for building highly interactive
web applications, written in Python. It separates HTML Templates from
page-generation logic written in Python, and uses the Model View
Controller (MVC) pattern to create dynamic HTML on the fly. Woven is
higher level framework that depends on the Twisted Web package of the
- Cheetah (http://cheetahtemplate.org/)
Cheetah is a Python-powered template engine and code generator. It can
as a standalone utility or it can be combined with other tools. Cheetah
many potential uses, but web developers looking for a viable
alternative to ASP,
JSP, PHP and PSP are expected to be its principle user group.
- AHTS (http://ahts.sourceforge.net/)
AHTS stands for An HTML Templating System. It is an implementation of
the templating system invented by
Ars Digita, ACS
Templating, in Python.
- Template Toolkit (http://www.template-toolkit.org/)
The Template Toolkit is a fast, powerful and easily extensible template
processing system written in Perl with certain key elements
coded in C for maximum speed. It is ideally suited (but not
limited) to the creation of static and dynamic web content, and
incorporates various modules and tools to simplify this process. The
Toolkit is highly portable, with minimal dependencies or restrictions
on how and where it can be used. It is robust, reliable, well
documented and freely available as Open Source.
In some respects similar to Velocity et al.
- Mason (http://www.masonhq.com/)
Mason is a powerful Perl-based web site development and delivery
engine. With Mason you can embed Perl code in your HTML and construct
pages from shared, reusable components.
Mason solves the common problems of site development: caching,
debugging, templating, maintaining development and production sites,
- dTemplate (http://hacks.dlux.hu/dTemplate/)
dTemplate is a fast and lightweight templating system for perl. The
features multi-language, multi-style support, encoders and easily
understandable programming logic.
- Text::Templar (http://search.cpan.org/dist/Text-Templar/,
This module is an object class for generating text. It is configured by
creating template files with specially formatted tags. It differs from
other templating modules in that it has an inverted
control model. This means that the template itself is a passive element
of the controlling program, allowing a decoupling of the presentation
or data output part of a program and the logic/control part ...
- Text::Template (http://search.cpan.org/dist/Text-Template/,
see separate homepage here)
"This module has become the de facto standard general purpose
templating module on CPAN. It has an easy interface and thorough
documentation. The examples in the docs show a pipeline execution
style, but it's easy to write a mod_perl handler that directly invokes
templates, allowing a callback style. The module uses in-line Perl."
- HTML::Embperl (http://search.cpan.org/dist/HTML-Embperl/,
"Embperl makes its language choice known up front: embedded
is one of the most popular in-line Perl templating tools and has been
around longer than most of the others. It has a solid reputation for
speed and ease of use" [Source].
- WPP (http://wpp.sourceforge.net/)
WPP (The Web Preprocessor) is a small perl5 script that allows
preprocessing of html files. You can define variables, which are
abbreviations for longer constructs, and include common html fragments.
It's useful for giving an uniform layout to different html pages. It
can be used into cgi-bin programs for automatic generation of pages.
With less html code inside them you can make more flexible and readable
- Various other Perl Modules:
(last updated in 1999), HTML::Macro, HTML::Processor
(last updated Nov. 2002) HTML::Template
(see also separate homepage here ), Text::ScriptTemplate
(from the same author, last updated Dec, 2001), ePerl (see
homepage here, one
oft the first perl template tools, written by Ralf S. Engelschall.
stable version still from Aug, 1998)
C / C++
- AutoGen (http://autogen.sourceforge.net/)
AutoGen is a tool designed to simplify the creation
and maintenance of programs that contain large amounts of repetitious
text. It is especially valuable in programs that have several blocks of
text that must be kept synchronized.
- WML (http://thewml.org/)
WML is a free HTML generation toolkit for Unix, internally consisting
independent languages. The main idea of WML is a sequential filtering
where each language provides one of 9 processing passes. So WML reads
file, applies passes 1-9 (or optionally only the passes specified) and
produces one or more output files.
Pass 1: Source Reading and Include File Expansion (ipp)
Pass 2: HTML Macro Construct Expansion (mp4h)
Pass 3: Perl 5 Programming Construct Expansion (eperl)
Pass 4: M4 Macro Construct Expansion (gm4)
Pass 5: Diversion Filter (divert)
Pass 6: Character and String Substitution (asubst)
Pass 7: HTML Fixup (htmlfix)
Pass 8: Line Stripping and Output Fixup (htmlstrip)
Pass 9: Output Splitting and Final Writing (slice)
- HTML_Tree (http://homepage.mac.com/pauljlucas/software/html_tree/)
"HTML Tree uses a fairly unique method of
templating: it loads in an HTML page, parses it to a DOM, and then
programmatically modifies the contents of nodes" [Source].
It comes with a Perl-binding.
- Codeworker (http://codeworker.free.fr/)
CodeWorker is a
versatile Open Source (GNU Lesser General Public License)
parsing tool and a source code generator devoted to generative
programming. Generative programming is a software
engineering approach interested in automating the production of
reusable, tailor-made, adaptable and reliable IT systems. In
layman's terms, CodeWorker lets you generate
code by parsing existing languages, or by creating and parsing your own
language. Once a language file has been parsed, CodeWorker provides
several techniques for generating code.
The tool's scripting language drives the
parsing and source code generation process. The scripting language
syntax is derived from the C family of languages, making it
familiar to most programmers. The template syntax is like like JSP,
ASP, or Velocity. It has variations for parsing,
code generation, or functional programming, giving the developer a
number of options for organizing CodeWorker
- MetaL (http://www.meta-language.net/)
MetaL is shorthand for Meta-programming Language.
Meta-programming is a method to develop computer programs. It works by
generating source code in a target language from a program
a higher level language.
MetaL programs source code is based on XML. MetaL compiler engine can
used to generate the same program from MetaL source code to potentially
target language. Currently supported target languages are PHP, Java and
Perl. The support for other languages can be added any time.
Last updated, March 2004
for comments, sugestions, etc. mail to: