Template:Documentation/doc

Syntax
Add  at the end of the template page.

Add  to transclude an alternative page from the /doc subpage.

On the documentation page
The documentation page is usually located on the /doc subpage for a template, but a different page can be specified with the first parameter of the template.

Normally, you will want to write something like the following on the documentation page:

Dependencies

 * List of Template dependencies
 * etc.

Syntax
Type  somewhere.

Usage
Extended usage details

Categories for the template itself that

Use any, all or more than all of the above sections.

Note that the above example also uses the Template:T and Template:T/piece templates.

Usage
The common format when inserted is to generally add the template at the lowest possible point in the code:

TEMPLATE CODE Any CATEGORIES to be inserted into articles by the template  generated TEMPLATEDATA

If your template is not a completed div or table, you may need to close the tags just before  is inserted (within the   tags).

A line break right before  can also be useful as it could help prevent the documentation template "running into" previous code.