Template:T/doc

T is a feature-packed example generator for brace-based wikitext. It allows users to link to and describe templates and module invocations using familiar syntax.

The basics
At its most basic, this template creates fancy links to other templates. For example, here's how you would link to Template:Sandbox:

(We'll be using Template:Sandbox throughout this tutorial, but any template will work&mdash;including T itself!)

Parameter descriptions
T wouldn't be very interesting if it was only able to generate links. Indeed, the template is more useful than that: it also accepts additional values after the name of the template, which are used to describe its parameters. Let's amend our previous example to include descriptions for  and  :

Note that, for technical reasons, parameter descriptions must occur sequentially. In other words, these will not work:

Sandbox Sandbox

Parameter names
Despite the ominous warning above, there is a way to describe named parameters with T. Simply separate the name and description with the numeric character reference, like so:

Alternately, if you've installed Template:=, then this will do the same thing:

Sandbox

The latter form is preferable, since your editors are more likely to know what  does than.

Blank descriptions
If you leave the value of a parameter description blank, it will default to. For example:

Literal parameter values
Sometimes when writing documentation, you'll want to talk about what happens when the user supplies a specific value to a parameter, rather than describing the parameter as a whole. You can do this in T by wrapping the value in single or double quotes, like so:

Empty values are also possible:

Note that the whole value needs to be in quotes, so this won't work:

this is "still" a parameter description

Escaping
T doesn't provide any means of escaping special characters like quotes. As with all other wikitext, you can use  tags instead. For example:

Flags
T allows you to modify how it behaves by enabling or disabling special flags. Each flag has both a longhand and a shorthand form, which are listed in the table to the right.

Enabling the  flag switches T from transclusion mode, which describes a template, to invocation mode, which describes a module. These two modes are very similar, the only difference being that the latter requires the name of a function to call. For example, here's how you would link to Module:Sandbox:

Enabling the  flag forces T to put each parameter, as well as the opener and closer, on its own line. For example: