Filters are a powerful feature of the Template Toolkit that allow you to postprocess parts of the output of your template in many different ways. A number of filters for carrying out common tasks are included with the standard Template Toolkit distribution, and it is possible to extend this set by writing your own.
A good example of a filter that comes with the Template Toolkit is
html filter. In an HTML document, a number of characters have
special meanings, so if you want these characters to appear in your
document they need to be converted to HTML
converts the characters
>, “, and
Example 5-1 shows the
html filter in action. Without the
to text that would be displayed by a browser rather than being
The processed document looks like this:
This example ...