Difference between revisions of "Template:Documentation"

From Captain of Industry Wiki
Jump to: navigation, search
(Creation)
 
m (remove not useful link)
 
(One intermediate revision by the same user not shown)
Line 70: Line 70:
                     | action=edit&preload=Template:Documentation/preload
                     | action=edit&preload=Template:Documentation/preload
                     }} writing some]. <!--
                     }} writing some]. <!--
     -->{{#ifeq: {{NAMESPACE}} | {{ns:10}}
     -->{{
      | There may also be documentation on [[w:c:templates:{{#if: {{{1|}}}
                                                            | {{{1}}}
                                                            | {{FULLPAGENAME}}/doc
                                                            }}|Wikia Templates]] which can be copied.
      }}{{
       #ifeq: {{FULLPAGENAME}} | {{ns:Template}}:Documentation/preload
       #ifeq: {{FULLPAGENAME}} | {{ns:Template}}:Documentation/preload
       |
       |
Line 92: Line 87:
                     | {{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 119:
                       | 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 183:
             -->{{#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}}}

Latest revision as of 11:24, 16 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.)