Version 51 of Template and Macro processing

Updated 2015-11-08 13:59:14 by pooryorick

Template and macro processing is perhaps more common in Tcl than many scripting languages, and many tools have been published.

See Also

Templates and subst
presents substify and applytemplate.
Web Templating
Text Clipboard
Code Generation
FrontLine
Backquoting
castle
ctrans
emacs package to insert templated code interactively
tic-tac-toe
not just a game - it is a templating system as well!
handlebars
mustache
Preprocessor
Macro Facility for Tcl
a discussion that includes some ideas and examples from RS, jcw, and others

Macro/Substitution Tools

expand, by William Duquette
A dedicated T/M processor. The core of expand was added to tcllib/textutil.
Tmac, by Roy Terry
a general-purpose macro package for expanding and substituting Tcl code.
Sugar, by SS
a Lisp-like macro system for Tcl.
Subst template expansion helpers
Peter Spjuth's Chiselapp
includes "an experminent on compiled macros" with a very small core mod (original patch submission @ sourceforge ). This is interesting for the very simplicity of the approach
knit, by PYK
a macro system that leverages tailcall
cmacro
a C-preprocessor-like macro substitution mechanism for Tcl source code.
Percent Substitution
tpp
A CPP-like preprocessor.
FrontLine, by Koen Van Damme
the author has used Frontline to write a preprocessor based upon Tcl to get more power than provided by the C/C++ preprocessor.

Template Tools

TclHttpd, by Brent Welch
a web server that includes a template processor
Kinetic Application Processor, by AsiaInfo
a web server that includes a template processor
Tml a component of BrowseX
a template processing system for both dynamic and static content.
Apache Rivet
the successor to mod_dtcl. rivet::parse can be used to create macros
mod_dtcl
nstcl
the OpenACS templating system
scripted templates
where the template itself is a syntactically valid Tcl script
smacro
A tool for programmatically generating embedded content within a file, similar to C/C++ preprocessor directives, except that the embedded code is expressed in Tcl.
teaspoon, by xan
a PHP-like templating engine for Tcl, and works particularly well with tanzer
TemplaTcl
has just two tags, ASP-like, easily expandable, and relatively safe, as it runs in a safe interpreter.
tmpl_parser
Open Liquid
is a parsing and rendering engine for the Liquid Markup Language, written in C++ with the goal of being bindable to any scripting language interpreter. Currently, only Tcl is supported through the Tcl C API.
TemplateRecall
tclTemplateToolkit2
A partial Tcl implementation of the TemplateToolkit :

Description

The cardinal rule for templating a Tcl script is that a value being interpolated into a Tcl script as a word must be escaped as a list containing that value as its lone word. This rule does not apply, of course, to the interpolation script fragments. See Tcl Quoting for further discussion.