TEMPLATE(1)

NAME
template - templating system compiler

SYNOPSIS
template [-G] [-o out] [file ...]

DESCRIPTION
template is an utility that converts files written in the template(7) format format to a set of routine writtens in the C programming language. template converts the files given as arguments or from standard input, and writes to standard output.

The options are as follows:

-G  Do not emit debug info in the generated source. It's disabled by default, unless template is reading from standard input.

-o out
    Write output to file. out will be created or truncated if exists and will be removed if template encounters any error.

EXIT STATUS

SEE ALSO
template(7)

AUTHORS
-nosplit The template utility was written by Omar Polo <op@openbsd.org>.

CAVEATS
The compiler is very naive, so there are quite a few shortcomings:
•   No attempt is made to validate the C code provided inline, nor the validity of the arguments to many constructs.
•   The generated code assumes that a variable called tp of type struct template * is in scope inside each block.
•   Each block may have additional variables used for the template generation implicitly defined: to avoid clashes, don't name variables or arguments with the ‘tp_’ prefix.
•   Blanks are, in most cases, trimmed. Normally this is not a problem, but a workaround is needed in case they need to be preserved, for e.g.:

        Name: {{ " " }} {{ render name_field(tp) }}