No edit summary |
m (Updated.) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude>{{Documentation subpage}}</noinclude> |
|||
==Description== |
|||
; Description |
|||
This template is used to insert descriptions on template pages. |
|||
: This template is used to insert documentation on template pages. |
|||
; Syntax |
|||
: Type <code><noinclude>{{T|Documentation}}</noinclude></code> at the end of the template page. |
|||
Add <code><nowiki><noinclude></nowiki>{{t|Documentation|documentation page}}<nowiki></noinclude></nowiki></code> to transclude an alternative page from the /doc subpage. |
|||
==Usage== |
|||
===On the Template page=== |
|||
This is the normal format when used: |
|||
== General usage == |
|||
=== On the Template page === |
|||
<pre> |
<pre> |
||
Template code<noinclude> |
|||
TEMPLATE CODE |
|||
{{Documentation}} |
|||
<includeonly>Any categories to be inserted into articles by the template</includeonly> |
|||
</noinclude> |
|||
</pre> |
</pre> |
||
=== On the Template/doc page === |
|||
''If your template is not a completed div or table, you may need to close the tags just before <code><nowiki>{{Documentation}}</nowiki></code> is inserted (within the noinclude tags).'' |
|||
''A line break right before <code><nowiki>{{Documentation}}</nowiki></code> can also be useful as it helps prevent the documentation template "running into" previous code.'' |
|||
===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 (see [[#Syntax|Syntax]]). |
|||
Normally, you will want to write something like the following on the documentation page: |
|||
<pre> |
<pre> |
||
; Description |
|||
This template is used to do something. |
: This template is used to do something. |
||
; Dependencies: |
|||
:* Uses (some CSS, JS, file, or other template). |
|||
; Syntax |
|||
: Type <code>{{T|Templatename}}</code> somewhere. |
|||
; Sample output |
|||
: <code><nowiki>{{Templatename|foo}}</nowiki></code> gives... |
|||
: {{Templatename|foo}} |
|||
<includeonly>Any categories for the template itself |
|||
==Syntax== |
|||
</includeonly><noinclude> |
|||
Type <code>{{t|templatename}}</code> somewhere. |
|||
[[Category:Template documentation]] |
|||
</noinclude> |
|||
</pre> |
|||
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. |
|||
==Samples== |
|||
<code><nowiki>{{templatename|input}}</nowiki></code> |
|||
results in... |
|||
{{templatename|input}} |
|||
<includeonly>Any categories for the template itself</includeonly> |
|||
<noinclude>[[Category:Template documentation]]</noinclude> |
|||
</pre> |
|||
Note that the above example also uses {{T|T}}. |
|||
Use any or all of the above description/syntax/sample output sections. You may also want to add "see also" or other sections. |
|||
== Dependencies == |
|||
Note that the above example also uses the [[Template:T]] template. |
|||
; Templates |
|||
: [[Template:Tocright]] ([[Template:Tocright/doc]]) |
|||
== TemplateData == |
|||
<includeonly>[[Category:Documentation templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude> |
|||
<templatedata> |
|||
{ |
|||
"params": { |
|||
"1": { |
|||
"description": "The name of the custom /doc subpage.", |
|||
"example": "Template:Documentation/doc", |
|||
"default": "{{FULLPAGENAME}}/doc", |
|||
"label": "Custom Documentation Location", |
|||
"type": "string" |
|||
}, |
|||
"content": { |
|||
"description": "Content if documentation page will not be transcluded", |
|||
"example": "This template creates quotes.", |
|||
"label": "Inline Documentation Content", |
|||
"type": "string" |
|||
}, |
|||
"sandbox": { |
|||
"label": "Custom Sandbox Location", |
|||
"description": "Specifies the /sandbox subpage location", |
|||
"example": "Template:Example/sandbox", |
|||
"type": "string", |
|||
"default": "{{FULLPAGENAME}}/sandbox" |
|||
}, |
|||
"heading": { |
|||
"label": "Heading text", |
|||
"description": "Changes the default \"Documentation\" header to a different one", |
|||
"example": "About this template", |
|||
"type": "string" |
|||
}, |
|||
"footer": { |
|||
"label": "Custom footer content", |
|||
"description": "Replaces the default link box with a custom one", |
|||
"example": "Documentation is automatically generated by {{T|Ambox}}. Its contents are shown here.", |
|||
"type": "unbalanced-wikitext" |
|||
} |
|||
}, |
|||
"description": "This template is used to display documentation on template pages. It also adds some tools to help the editor to modify the /doc subpage and the template." |
|||
} |
|||
</templatedata><includeonly>[[Category:Documentation templates| ]]</includeonly> |
Latest revision as of 03:24, 8 October 2022

It contains usage information, categories, interlanguage links and other content that is not part of the original template page.
- Description
- This template is used to insert documentation on template pages.
- Syntax
- Type
<noinclude>
at the end of the template page.{{Documentation}}
</noinclude>
General usage[edit source]
On the Template page[edit source]
Template code<noinclude> {{Documentation}} </noinclude>
On the Template/doc page[edit source]
; Description : This template is used to do something. ; Dependencies: :* Uses (some CSS, JS, file, or other template). ; Syntax : Type <code>{{T|Templatename}}</code> somewhere. ; Sample output : <code><nowiki>{{Templatename|foo}}</nowiki></code> gives... : {{Templatename|foo}} <includeonly>Any categories for the template itself </includeonly><noinclude> [[Category:Template documentation]] </noinclude>
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.
Note that the above example also uses {{T}}
.
Dependencies[edit source]
- Templates
- Template:Tocright (Template:Tocright/doc)
TemplateData[edit source]
This template is used to display documentation on template pages. It also adds some tools to help the editor to modify the /doc subpage and the template.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Custom Documentation Location | 1 | The name of the custom /doc subpage.
| String | optional |
Inline Documentation Content | content | Content if documentation page will not be transcluded
| String | optional |
Custom Sandbox Location | sandbox | Specifies the /sandbox subpage location
| String | optional |
Heading text | heading | Changes the default "Documentation" header to a different one
| String | optional |
Custom footer content | footer | Replaces the default link box with a custom one
| Unbalanced wikitext | optional |