Chapter 2. The TPT template language

Table of Contents

A quick sample
Reserved Characters
Variables
Comments
Expressions
Whitespace & Carriage Returns
Macros

This introduction to the TPT template language is intended for users who are already familiar with programming. If you are not familiar with the concepts of numbers, strings, arrays, functions, and expressions, you may want to read an introductory level programming book.

A quick sample

Example 2.1. helloworld.tpt

@set(hello_world, "Hello World!")\
@# Output Hello World or the value of ${hello_world} if it is set
@if (@empty(hello_world)) {
Hello World!
} @else {
${hello_world}
}