Template:Documentation: Difference between revisions

From Workers & Resources: Soviet Republic Official Wiki
mNo edit summary
m (3 revisions imported)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>'''Please discuss changes to this template on [[Template talk:Documentation|it's talk page]] before implementing!'''</noinclude>
<languages/>
<includeonly><onlyinclude><!--
</noinclude><includeonly>{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}</includeonly><noinclude>
{{documentation|content=


{{Lua|Module:Documentation}}
--><div class="va-documentation"><!--
<translate><!--T:12--> This template automatically displays a documentation box like the one you are seeing now, of which the content is sometimes transcluded from another page.</translate>
<translate><!--T:13--> It is intended for pages which are [[<tvar name=1>Special:MyLanguage/Help:Transclusion</tvar>|transcluded]] in other pages, i.e. templates, whether in the template namespace or not.</translate>


<translate>
--><div class="va-documentation-bar-top"><!--
==Usage== <!--T:2-->
  --><div class="va-documentation-links va-documentation-small">&#91;[{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}}} <span title="view the documentation">view</span>] &middot; [{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}|action=edit}} <span title="edit the documentation">edit</span>] &middot; [{{fullurl:{{FULLPAGENAME}}|action=purge}} <span title="purge this page">purge</span>]&#93;</div><!--
  -->'''Template documentation''' <span class="va-documentation-small">(for the template shown above, sometimes hidden or invisible)</span><!--
--></div><!--


===Customising display=== <!--T:3-->
--><div class="va-documentation-content">{{TOC|float=right}}
{{:{{{1|{{FULLPAGENAME}}/doc}}}}}
</div><!--


<!--T:4-->
--><div class="va-documentation-bar-bottom va-documentation-small">Documentation transcluded from [[{{{1|{{FULLPAGENAME}}/doc}}}]].</div><!--
Overrides exist to customise the output in special cases:
</translate>
* <nowiki>{{</nowiki>documentation{{!}}'''heading'''=<nowiki>}}</nowiki> - <translate><!--T:5--> change the text of the "documentation" heading.</translate> <translate><!--T:10--> If this is set to blank, the entire heading line (including the first [edit] link) will also disappear.</translate>


<translate>
--></div><!--
==Rationale== <!--T:6-->
-->{{DEFAULTSORT:{{PAGENAME}}}}<!--
</translate>
<translate><!--T:7--> This template allows any page to use any documentation page, and makes it possible to protect templates while allowing anyone to edit the template's documentation and categories.</translate>
<translate><!--T:8--> It also reduces server resources by circumventing a [[w:Wikipedia:Template limits|technical limitation of templates]] (see a [[<tvar name=1>:en:Special:Diff/69888944</tvar>|developer's explanation]]).</translate>


<translate>
--></onlyinclude></includeonly>{{Documentation}}
==See also== <!--T:9-->
</translate>
* <translate><!--T:14--> [[w:Template:Documentation subpage]]</translate>
* {{tim|Documentation}}
* <translate><!--T:11--> [[w:Wikipedia:Template documentation]]</translate>


}}
[[Category:Template documentation| ]]
[[Category:Formatting templates{{#translation:}}|Template documentation]]
[[Category:Template documentation{{#translation:}}| ]]
</noinclude><includeonly>{{#if:{{{content|}}}|
[[Category:Template documentation pages{{#translation:}}]]
}}</includeonly>

Latest revision as of 19:25, 14 June 2024

Please discuss changes to this template on it's talk page before implementing!

Template documentation (for the template shown above, sometimes hidden or invisible)

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.

Documentation transcluded from Template:Documentation/doc.