readme
STEMGINE(1) STEMGINE(1)
NAME
stemgine - simple template engine
DESCRIPTION
stemgine is a very simple, flexible and powerful template engine. It simply evaluates template files as shell code, thus replacing shell vari-
ables with the ones present in the environment.
SECURITY
Since the content of the templates is written using eval and echo, you have to make sure that no one can inject code into your template files.
However, this should be the default configuration of umask.
BACKEND
Template file
Regular text file. Contents are evaluated using echo so one can use all those nice shell features like variables, backticks (and hence all
your cli programs) and so on.
Example:
// $PROJECT-$VERSION (C) $YEARS $AUTHORS
TEMPLATE_DIR
Contains template files. Each file is in a subdirectory named after the file extension.
Example:
template
|-- cxx
| |-- isc.cxx
| `-- wtfpl.cxx
`-- sh
`-- wtfpl.sh
~/.stemginerc
Configuration file, must contain path to template directory in sh syntax.
Example:
TEMPLATE_DIR="$HOME/templates"
FRONTEND / SEE ALSO
stemgine::list(1)
lists all templates
stemgine::eval(1)
evaluates a template
stemgine::scotem(1)
interface for simple code templates
stemgine::vecotem(1)
interface for verbose code templats
COMMAND COMPLETION
ZSH
function templates { reply=(`stemgine::list`); }
compctl -K templates stemgine::eval stemgine::vecotem stemgine::scotem
WEBSITE
http://programmers.at/work/on/app-text/stemgine
AUTHORS
Andreas Waidler <arandes@programmers.at>
simple template engine 2009-04-17 STEMGINE(1)