Word processor compatible templating system

This software allows clients to use office suite documents for templating automated document generation.

Template Syntax

Template files may contain the following expressions.

Value substitution

Used to display value from the template data object.

Examples:

Conditional blocks

Put a value between conditional blocks to toggle its visibility depending on a value in the data object.

Examples:

Repeating blocks

Repeat a block for each item in a list in the data object.

For example if xs is a list then the following repeats the BODY part for every item: {%for x in xs%} BODY {%end%}

The BODY part has a new binding on every iteration so you can access every element in a collection via the x iterator variable.

Function calls and arithmetic

You can call custom functions in expressions. For example: {%=coalesce(x.price, x.cost, "N/A")%}

You can also call many arithmetic operators. For example: {%= x*x+x+2%}

Custom Functions

See: {@link stencil.functions} package.