Template:Documentation

From The TMS Wiki
Jump to: navigation, search
[view] [edit] [history] [purge] Documentation icon Template documentation

This is the {{documentation}} template.

For most of the instructions about how and when to use this template, see Wikipedia:Template documentation. In general it should be used on all templates that have instructions and information regarding when and how to use that specific template.

This template displays a green doc box like you are seeing now, and automatically loads the content from a subpage called /doc. It can also load the content from other places if instructed to.

This template is intended to provide instructions on how to use templates and other pages which are transcluded onto other pages. It can be used in template space and most other namespaces.

Usage

Normally to use this page simply place the following at the bottom of a template page. Normally this template is used without any parameters, placed at the bottom of the template or page being documented, within $altnoinclude>:

<!--Last line of your template code--><noinclude>

{{documentation}}
</noinclude>

This template automatically loads the content located on the /doc subpage of the template it is used on.

If someone one wanted to add instructions on how to use Template:GenericBox, they would go to the page Template:GenericBox and enter <noinclude>{{documentation}}</noinclude> to the bottom of that page. They would then go to Template:GenericBox/doc and enter the instructions on how to use the template on that sub-page. This template will then take the text found on Template:GenericBox/doc and add it to the GenericBox template in a green box.

Best practice

The code should be added at the bottom of the template code, with no space before "<noinclude>" (which would cause extra space on pages where the template is used).

Categories and interwiki links that apply to the template itself should be added to the bottom of the /doc subpage, inside <includeonly></includeonly> tags. For more complex cases, see Wikipedia:Template documentation#Categories and interwiki links.

If the documentation page contains <includeonly> or <noinclude> tags as part of the visible documentation text, replace the "<" with "&lt;".

Automatic functions

If the documentation page doesn't exist, the [create] link includes a preload page so that clicking it will pre-fill the edit form with the basic documentation page format. Preload text is also used for the /sandbox and /testcases (create) links.

When this template is on a protected template page it now automatically adds {{pp-template}} which shows the grey or red padlock in the top right corner. So no need to manually add {{pp-template}} to templates that use {{documentation}}.

When this template is on a /sandbox subpage it automatically adds the {{template sandbox notice}}.

Advanced Usage

Advanced users may be interested in reading the Wikipedia Article on how to use this template. This template is used heavily on the Wikipedia site and they have extensive examples on how to use this specific template.

See also

ar:قالب:توثيق as:Template:Documentation ba:Ҡалып:Doc bar:Vorlage:Dokumentation bg:Шаблон:Документация bs:Šablon:Dokumentacija ca:Plantilla:Ús de la plantilla cs:Šablona:Dokumentace cy:Nodyn:Doc da:Skabelon:Dokumentation de:Vorlage:Dokumentation dsb:Pśedłoga:Dokumentacija et:Mall:Dokumentatsioon es:Plantilla:Documentación el:Πρότυπο:Τεκμηρίωση προτύπου eo:Ŝablono:Dok eu:Txantiloi:Txantiloi dokumentazioa fa:الگو:توضیحات fr:Modèle:Documentation gl:Modelo:Uso de marcador he:תבנית:תיעוד hsb:Předłoha:Dokumentacija la:Formula:Documentation ltg:Taiss:Dokumentaceja hu:Sablon:Sablondokumentáció hy:Կաղապար:Փաստաթղթեր ia:Patrono:Docpatrono id:Templat:Dokumentasi it:Template:Man ja:Template:Documentation ko:틀:틀 설명문서 ku:Şablon:Belgekirin ml:ഫലകം:വിവരണം ms:Templat:Dokumentasi no:mal:Dokumentasjon nl:Sjabloon:Sjabdoc pl:Szablon:Dokumentacja pt:Predefinição:Documentação ro:Format:Documentaţie ru:Шаблон:Doc simple:Template:Documentation sk:Šablóna:Dokumentácia sl:Predloga:Dokumentacija sr:Шаблон:Документација sq:Stampa:Dokumentacion stq:Foarloage:Dokumentation sv:Mall:Dokumentation sw:Kigezo:Documentation tr:Şablon:Belgeleme tt:Үрнәк:Doc tpi:Template:Template doc uk:Шаблон:Документація ur:سانچہ:Documentation war:Template:Documentation yo:Àdàkọ:Aṣàlàyé zh:Template:Documentation te:మూస:Documentation