Template:Documentation: Difference between revisions

From Greyhawk Wiki
Jump to navigation Jump to search
Marked this version for translation
m 1 revision imported: Import from Mediawiki
 
(29 intermediate revisions by 15 users not shown)
Line 1: Line 1:
<noinclude>
<includeonly>{|class="grey" style="width:100%;"
<languages/>
|-
</noinclude><includeonly>{{#switch:<translate></translate>
!Template documentation follows
| =
|-
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}
|<em><strong>Note:</strong> the template above may sometimes be partially or fully invisible.</em>
| #default=
|-
  {{#invoke:Template translation|renderTranslatedTemplate|template=Template:Documentation|noshift=1}}
|<span class="noicon">[{{fullurl:{{ns:10}}:{{{1|{{PAGENAME}}}}}/doc|action=purge}} View] &bull; [{{fullurl:{{ns:10}}:{{{1|{{PAGENAME}}}}}/doc|action=edit}} Edit] &bull; [{{fullurl:{{ns:10}}:{{{1|{{PAGENAME}}}}}/doc|action=history}} History]</span>
}}</includeonly><noinclude>
|}
{{documentation|content=
{{#ifexist: {{FULLPAGENAME}}/doc|
 
:''The following documentation is transcluded from [[{{FULLPAGENAME}}/doc]]:''
{{Lua|Module:Documentation}}
{{/doc}}
<translate>
|:''This template is not yet documented. Please create documentation here: [[{{FULLPAGENAME}}/doc]]''[[Category:Templates without documentation]]}}</includeonly><noinclude>{{doc}}[[Category:Maintenance templates|{{PAGENAME}}]]</noinclude>
<!--T:12-->
This template automatically displays a documentation box like the one you are seeing now, of which the content is transcluded from another page.</translate>
<translate>
<!--T:13-->
It is intended for pages which are [[<tvar|1>Special:MyLanguage/Help:Transclusion</>|transcluded]] in other pages, i.e. templates, whether in the template namespace or not.
 
==Usage== <!--T:2-->
 
===Customizing display=== <!--T:3-->
 
<!--T:4-->
Overrides exist to customize 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>
==Rationale== <!--T:6-->
 
<!--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, categories, and interwiki links.</translate>
<translate>
<!--T:8-->
It also reduces server resources by circumventing a [[w:Wikipedia:Template limits|technical limitation of templates]] (see a [[<tvar|1>:en:Special:Diff/69888944</>|developer's explanation]]).
 
==See also== <!--T:9-->
</translate>
* <translate><!--T:14--> [[w:Template:Documentation subpage]]</translate>
* {{tim|Documentation}}
* <translate><!--T:11--> [[w:Wikipedia:Template documentation]]</translate>
 
}}
[[Category:Formatting templates{{#translation:}}|Template documentation]]
[[Category:Template documentation{{#translation:}}| ]]
</noinclude><includeonly>{{#if:{{{content|}}}|
[[Category:Template documentation pages{{#translation:}}]]
}}</includeonly>

Latest revision as of 10:50, 3 January 2025

Template documentation follows
Note: the template above may sometimes be partially or fully invisible.
ViewEditHistory
The following documentation is transcluded from Template:Documentation/doc:

This template can be used on any other template page to transclude documentation on how to use the other template.

If a documentation subpage (/doc) already exists, the content of that page will be displayed (like in this case). Otherwise, it will show a short note about missing documentation combined with a link to the subpage to be written.

This is useful to reduce the amount of wikicode that is transcluded every time the template in question is used. Everything that does not need to be transcluded should be put on this subpage, including interwiki links.

Usage

When creating a template page, copy and paste the following, to automatically insert the Usage information, if it exists.

<noinclude>{{doc}}</noinclude>