Template:Documentation/doc: Difference between revisions

Template page
starcitizen>Treefroog
(Created page with ";Description :This template is used to insert descriptions on template pages. ;Syntax :Type <code><nowiki><noinclude></nowiki>{{t|documentation}}<nowiki></noinclude></nowiki><...")
 
en>Alistair3149
No edit summary
Line 1: Line 1:
;Description
{{Documentation}}
:This template is used to insert descriptions on template pages.
The '''documentation''' template is transcluded in the template/module documentation. This template should only be used on subpages titled "doc".  
;Syntax
:Type <code><nowiki><noinclude></nowiki>{{t|documentation}}<nowiki></noinclude></nowiki></code> at the end of the template page.


==General usage==
==Usage==
===On the Template page===
Place {{t|documentation}} at the top of the documentation page.
<pre>
Template code<includeonly>Any categories to be inserted into articles by the template</includeonly><noinclude>
{{documentation}}</noinclude>
</pre>


Note that, depending on the template, you may need to add a clear or complete a table/div just before <code><nowiki>{{documentation}}</nowiki></code> is inserted (within the noinclude tags).
If the page to be documented is a subpage, use {{t|documentation|pagename of page to be documented}} at the top of the documentation page. For example, Template:Foo/bar's documentation page would use {{t|documentation|Template:Foo/bar}}.


The line break is also useful as it helps prevent the documentation template "running into" previous code.
The template will attempt to auto detect and link <code><nowiki>{{#Invoke:}}</nowiki></code> calls on template documentations or the <code>require()</code>/<code>mw.loadData()</code> depedency list on module documentations. If you want to supress the auto generated dependency list, use {{t|documentation|DependencyList=no}}


===On the Template/doc page===
==Note==
<pre>
This template links to a /doc that may appear useless, however, it exists in order to link navboxes and userboxes to their base template's documentation.  
;Description
<includeonly>[[Category:Template documentation| ]]</includeonly>
:This template is used to do something.
;Syntax
:Type <code>{{t|templatename}}</code> somewhere.
;Sample output
:<code>&lt;nowiki>{{templatename|foo}}&lt;/nowiki></code> gives...
:{{templatename|foo}}


<includeonly>Any categories for the template itself</includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>
==TemplateData==
</pre>
<templatedata>
 
{
Use any or all of the above description/syntax/sample output sections. You may also want to add "see also" or further usage information sections.
"params": {},
 
"description": "The documentation template is transcluded in the template/module documentation. This template should only be used on subpages titled \"doc\"."
Note that the above example also uses the [[Template:T]] and [[Template:T/piece]] templates.
}
 
</templatedata>
<includeonly>[[Category:General wiki templates|{{PAGENAME}}]]</includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>

Revision as of 05:14, 15 March 2020

The documentation template is transcluded in the template/module documentation. This template should only be used on subpages titled "doc".

Usage

Place {{documentation}} at the top of the documentation page.

If the page to be documented is a subpage, use {{documentation|<pagename of page to be documented>}} at the top of the documentation page. For example, Template:Foo/bar's documentation page would use {{documentation|<Template:Foo/bar>}}.

The template will attempt to auto detect and link {{#Invoke:}} calls on template documentations or the require()/mw.loadData() depedency list on module documentations. If you want to supress the auto generated dependency list, use {{documentation}}

Note

This template links to a /doc that may appear useless, however, it exists in order to link navboxes and userboxes to their base template's documentation.


TemplateData

The documentation template is transcluded in the template/module documentation. This template should only be used on subpages titled "doc".

Template parameters

ParameterDescriptionTypeStatus
No parameters specified