Chapter 53. Templated Generation

Generate output by handwriting an output file and placing template callouts to generate variable portions.

image

53.1 How It Works

The basic idea behind Templated Generation is to write the output file you desire, inserting callouts for all the bits that vary. You then use a template processor with the template file and a context that can fill the callouts to populate the real output file.

Templated Generation is a very old technique, familiar to anyone who has used mail-merge facilities in a word processor. Templated Generation is very common in web development, as many websites with dynamic content use Templated ...

Get Domain Specific Languages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.