Difference between revisions of "Template:Documentation"

From Captain of Industry Wiki
Jump to: navigation, search
(Creation)
 
(fix a couple interwikilinks to clear Special:WantedPages)
Line 92: Line 92:
                     | {{FULLPAGENAME}}/doc
                     | {{FULLPAGENAME}}/doc
                     }}
                     }}
         | The above text is '''[[m:Transclusion|<span class="color1">transcluded</span>]]''' <!--
         | The above text is '''[[MediaWikiWiki:Help:Transclusion|<span class="color1">transcluded</span>]]''' <!--
           -->from '''[[{{#if: {{{1|}}}
           -->from '''[[{{#if: {{{1|}}}
                         | {{{1}}}
                         | {{{1}}}
Line 124: Line 124:
                       | action=purge
                       | action=purge
                       }} refresh the text]'''. <!--
                       }} refresh the text]'''. <!--
         -->('''[[w:Help:Purge|Why?]]''')<br /><!--
         -->('''[[Wikipedia:Help:Purge|Why?]]''')<br /><!--
         -->You can experiment in this template's <!--
         -->You can experiment in this template's <!--
             -->{{#ifexist: {{#if: {{{sandbox|}}}
             -->{{#ifexist: {{#if: {{{sandbox|}}}
Line 188: Line 188:
             -->{{#if: {{{content|}}}
             -->{{#if: {{{content|}}}
               |
               |
               | <br />Please add '''[[w:Help:Categories|categories]]''' and '''[[w:Help:Interwiki link|interwikis]]''' to <!--
               | <br />Please add '''[[Wikipedia:Help:Categories|categories]]''' and '''[[Wikipedia:Help:Interwiki link|interwikis]]''' to <!--
                 -->{{#ifexist: {{#if: {{{1|}}}
                 -->{{#ifexist: {{#if: {{{1|}}}
                                 | {{{1}}}
                                 | {{{1}}}

Revision as of 07:46, 13 January 2022

Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]

Description

This template is used to insert descriptions on template pages.

Syntax

Add <noinclude>{{documentation}}</noinclude> at the end of the template page.

Usage

On the Template page

This is the normal format when used:

TEMPLATE CODE<includeonly>Any categories to be inserted into articles by the template</includeonly><noinclude>
{{documentation}}</noinclude>

If your template is not a completed div or table, you may need to close the tags just before {{documentation}} is inserted (within the noinclude tags).

A line break right before {{documentation}} can also be useful as it helps prevent the documentation template "running into" previous code.

On the Template/doc page

Normally, you will want to write something like the following on the documentation page:

==Description==
This template is used to do something.

==Syntax==
Type <code>{{t|templatename}}</code> somewhere.

==Samples==
<code><nowiki>{{templatename|input}}</nowiki></code> 

results in...

{{templatename|input}}

<includeonly>Any categories for the template itself</includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>

Use any or all of the above description/syntax/sample output sections. You may also want to add "see also" or other sections.

Note that the above example also uses the Template:T and Template:T/piece templates.
The above text is transcluded from Template:Documentation/doc; you can change it or view its history. (How does this work?)
If you're done making changes, please refresh the text. (Why?)
You can experiment in this template's sandbox (create | mirror ) and testcases (create) pages.
Please add categories and interwikis to Template:Documentation/doc. (View all subpages of this page.)