The following is a brief description of the template language
implemented in the TemplateFileC and TemplateComplexC classes.
These are the basic commands provided for all templates. It is
easy to add more commands which are appropriate for a particular
application.
$(//:a) | Discard 'a', as a comment |
$(set:a=b) | Assign the expanded value of 'b' to variable a |
$(for:a:b:c) | For each item in list 'b',
separated by the delimiters in string 'a'. Substitute %arg% into
'c' and expand it. If a number of deliminators are found in a
row, they are treated as a single deliminator. i.e. two spaces
in a row is treated as one space. |
$(if:a:b) | If condition 'a' is true,
expand 'b'. For a description of conditions see below. |
$(ifset:a) | If variable 'a' is set, then expand 'b'. |
$(else:a) | If the last condition failed, expand 'a' |
$(include:a) | Include the file 'a' as if where part of
this file |
$(sub:a) | Expand 'a' in new environment,
with no variables set. The values of any variables set within
this environment are discarded on completion. |
$(subc:a) | Expand 'a' in new enviroment,
with a copy of current variables. The values of any variables
set or changed within this enviroment are discarded on
completion. |
$(subst:a:b:c) | Expand 'c' and subitute all instances
of string 'a' with string 'b'. Then output it. |
$(define:a:b) | Define a new macro called 'a', upon
execution substitute the macro parameter for %arg% in 'b' and
expand it. Macros can then be executed as any other command.
Caution, standard commands may be overriden with this |
$(htmlsafe:a) | Make appropriate substitutions to an
expanded version of 'a' so it will read properly in a html
browser. |
$(uppercase:a) | Expand 'a', and make it all upper case. |
$(lowercase:a) | Expand 'a', and make it all lower case. |
$(before:a:b) | Expand 'b', and make return all text before 'a'.
Return the whole string if 'a' is not found. |
$(after:a:b) | Expand 'b', and make return all text after 'a'.
Return the whole string if 'a' is not found. |
$(silent:a) | Expand 'a', but discard the output. This
maybe user to comment the setup of variables, without sending
the comments to the output file. |
$(FilePattern:a) | Special keyword, ignored. (well kinda) |
$(FileObject:a) | Special keyword, ignored. (well kinda) |