Template:Documentation: Difference between revisions

From The Kodiak Republic Wiki

Content added Content deleted
No edit summary
No edit summary
Line 1: Line 1:
<includeonly><br><div style="width: 100%; border-top: 1px solid #aaaaaa; border-bottom: 1px solid #aaaaaa; border-right: 1px solid #aaaaaa; border-left: 1px solid #aaaaaa; clear: both; position: relative; background:#ECFCF4; color: #000000;"><div style="margin-left:6px; margin-right:6px; margin-top:6px; margin-bottom:6px;">{{#if:{{#pos:{{NAMESPACE}}|Template}}|<div style="text-align: left;"><div style="float: right;">[[{{fullurl:{{FULLPAGENAME}}/doc|action=edit}} edit]]</div>[[File:Template-info.png|50px]] <span style="font-size:17px; font-weight:bold">Template documentation</span></div>
{{Fake heading|sub=2|Documentation}}
-------------}}
{{{{FULLPAGENAME}}/doc}}
:''This documentation is transcluded from [[{{{1|{{FULLPAGENAME}}/doc}}}]].'' <small>([{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}|action=edit edit}}] | [{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}|action=history}} history])</small>

{{#ifexist: {{FULLPAGENAME}}/sandbox|:''This template has a [[{{FULLPAGENAME}}/sandbox|sandbox]]''&nbsp;<small>([{{fullurl:{{FULLPAGENAME}}/sandbox|action=edit}} edit])</small>&nbsp;{{#ifexist: {{FULLPAGENAME}}/testcases|''and''|''for editors to experiment.''}}}}&nbsp;{{#ifexist: {{FULLPAGENAME}}/testcases|[[{{FULLPAGENAME}}/testcases|''testcases'']]&nbsp;<small>([{{fullurl:{{FULLPAGENAME}}/testcases|action=edit}} edit])</small>&nbsp;''for editors to experiment.''}} {{#ifexist: {{FULLPAGENAME}}/sandbox/test|''There is also a [[{{FULLPAGENAME}}/sandbox/test|sandbox test]] for editors to test their changes to the sandbox.''|}}

{{{{{1|{{FULLPAGENAME}}/doc}}}}}<br clear="all">
<small style="font-size: 85%;">''The above documentation was transcluded from [[{{FULLPAGENAME}}/doc]].''</small>
</div></div></includeonly><noinclude>{{Documentation}}</noinclude>
----<noinclude>
<templatedata>
{
"params": {},
"description": "This template is a alt to the average use of Template:Documentation, which normally uses a module. Please embed this in 'noinclude' tags."
}
</templatedata>
</noinclude>

Revision as of 15:50, 25 October 2016


Template documentation

This documentation is transcluded from Template:Documentation/doc. (edit | history)

 

Description

This template is used to insert descriptions on template pages.

Syntax

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

Add <noinclude>{{Documentation|<documentation page>}}</noinclude> to transclude an alternative page from the /doc subpage.

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 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).

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]]</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 template.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.