Template:Documentation
Documentation
This page is a template. It contains some standardized, often used text, which can be transcluded inside other pages. As this template is widely used in our wiki, it may be protected in which case only staff members can change it. Use the discussion page to propose enhancements or fixes, or to voice your opinion.
This template provides a mechanism to document other pages (usually another template, but technically it can be used in other namespaces — the following information assumes it is being used on a template page).
The actual documentation is contained in a subpage whose title is the title of the current page plus the suffix /doc
. (For example, if {{Documentation}} is called on the page Template:C, the documentation will be transcluded from the page Template:C/doc.)
For details on how to properly document templates, see Help:Templates#Adding documentation and categories and Help:Template sandbox and test cases.
Parameters
None in typical usage (see next section). However, this template actually passes the following parameters (with empty default values) to {{Documentation/core2}}, so certain default settings can be overridden.
Parameter name | Required? | Default value | Description |
---|---|---|---|
heading |
No | (n/a) | Section heading shown at top of documentation. |
heading-style |
No | (n/a) | Currently unused. |
content |
No | (n/a) | If provided, will be shown instead of the /doc subpage.
|
link box |
No | (n/a) | If provided, will be shown instead of the standard "The above documentation is transcluded…" message. Special value off suppresses the message completely.
|
Do not override any of these unless you have a really good reason.
Usage
<noinclude> {{Documentation}} </noinclude>
The <noinclude> element is necessary to ensure that the template documentation (say, Template:C/doc) appears when viewing the template it's documenting (Template:C) but not any other page where the template is called (e.g., Gentoo Wiki:Guidelines, which contains {{C}} template calls).
(As the standard usage of this template is so simple, no test cases are shown here.)
See also
- Template:Documentation/core2 – "logic" template called by this template as an intermediary (it calls the next template)
- Template:Documentation/core – ultimately defines how the documentation is presented on the page
- Template:Documentation/preload – the initial documentation that an editor is presented with when they follow the "[create]" link to create the "/doc" subpage
- The following templates are commonly used in template documentation:
- {{Template}} – box informing the reader that they are viewing a template
- {{Template Parameter Table}} – creates a table for describing template parameters
- {{Template Parameter}} – documents each parameter a template recognizes
The above documentation is transcluded from Template:Documentation/doc. (edit | history)
Editors can experiment in this template's sandbox (edit) and testcases (edit) pages.
Please add categories and interwikis to the /doc subpage. (See the subpages of this template.)