Next: Contexts, Previous: Variables, Up: Template Writing [Index]

### 5.2 Templates

A template represents a text pattern that can be inserted into a buffer.

A basic template is declared like this:

    template TEMPLATENAME :arg1 :arg2
    "Optional documentation string"
    ----
    The text to your template goes here.
    ----
    bind "a"

Templates are stored in a template table by name, and are inserted by the templatename provided.

The documentation string is optional. This documentation string will be used to aid users in selecting which template they want to use.

The code that makes up the raw template occurs between the lines that contain the text "—–".