Template:Documentation: Difference between revisions

From Thadar En
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
<noinclude>
<includeonly><div style="border: 1px solid black; margin: 3em 1em 1em;"><div style="background: Tan; color: Black; padding: 1em; margin: 0;">'''Template documentation''' <span style="font-size: 85%;">(for the above template, sometimes hidden or invisible)</span></div><div style="padding: 1em 1em 0; margin: 0;">
<languages/>
{{#if: {{{namespace|}}}|{{:{{{namespace}}}:{{PAGENAME}}/doc}}|{{{{PAGENAME}}/doc}} }}
</noinclude><includeonly>{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}</includeonly><noinclude>
</div><br style="clear: both;"/><div style="background: Tan; color: Black; padding: 0.5em; margin: 0em; font-size: 85%; text-align: right;">Visit [[{{#if: {{{namespace|}}}|{{{namespace}}}|Template}}:{{PAGENAME}}/doc]] to edit this text! ([[Template:Documentation|How does this work]]?)</div></div></includeonly><noinclude>
{{documentation|content=
{{Documentation}}
 
[[Category:Template documentation| ]]
{{Lua|Module:Documentation}}
</noinclude>
<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>
==Usage== <!--T:2-->
 
===Customising display=== <!--T:3-->
 
<!--T:4-->
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>
==Rationale== <!--T:6-->
</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>
==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 13:57, 25 December 2023

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

{{Documentation}} formats and displays documentation subpages.

Usage

{{Documentation
| namespace = 
}}
namespace (optional)
If a documented page's namespace isn't Template, enter it here.

This template transcludes the contents of the page's /doc subpage. If the page doesn't exist, it displays a red link to the page.

Example

On a Template page

<includeonly>(Template code)</includeonly><noinclude>
[[Category:Relevant template categories]]
{{Documentation}}
</noinclude>

Note that, depending on the template, you may need to add {{Clear}} or close any open <table> or <div> tags in the template before the {{Documentation}} template.

On a page in any other namespace

(Content)<noinclude>
{{Documentation|namespace=NamespaceName}}
</noinclude>

The namespace parameter lets you add documentation to pages on any namespace. For example, you can document widgets in the Widget namespace or complex CSS or Javascript in the MediaWiki namespace. See Widget:ArticleSpawner for an example.

On the Template/doc page

'''{{tl|Thistemplate}}''' is a template that (describe the template).

== Usage ==
<pre>
(Template usage and parameters)
</pre>

; parameter ''(optional)'': Describe each parameter, and note whether it's optional and has a default value.

== Example ==
<pre>
(Example template usage)
</pre>

produces 

(Example template usage)

Use any or all of the above description, usage, and example sections. You can also add "see also" or further usage information sections.