Tmplz Template API

Tmplz Tags

Introduction

Tmplz tags are used to mark up text files for processing by the Tmplz template parser, which turns them into data structures made up of Slots and Sections. This manual explains the syntax for the different tags. Below are some general rules about tag syntax.

General tag syntax

A Tmplz tag looks like this:

  [$Slot Foo]

The [$ marks the start of the tag, and ] marks the end. The Slot part is the name of the tag, and the Foo part is a tag parameter; most tags allow one or more of these. Parameters may need to be quoted, especially when they contain spaces, e.g.:

  [$Slot "Foo Bar"]

Sometimes both an opening tag and closing tag are needed; together, they form an element (stolen from HTML parlance).

  [$Section ABC]...Stuff in between...[$Section]

A tag that stands alone (such as the Slot example above) is considered a self-closing element.

Customizing the tag syntax

If $[...] are unappealing tag delimiters, they can be changed; this is explained later on in the TagWith chapter. For the purposes of this document, however, we will otherwise use [$...] throughout for consistency.

Next page: Core Tags