Template:Documentation/doc: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
(Updating/reworking the doc since the template has been updated. Intermediate save.)
(Blanked the page)
 
(57 intermediate revisions by 36 users not shown)
Line 1: Line 1:
{{documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->


This is the {{tl|documentation}} template.
For most of the instructions about how and when to use this template, see [[Wikipedia:Template documentation]].
This template displays a documentation box like you are seeing now, and automatically loads the content from a /doc subpage. It can also load the content from other places if instructed to.
This template is intended for documenting templates and other pages which are [[Wikipedia:Transclusion|transcluded]] onto other pages. It can be used in template space and most other namespaces.
=== Normal /doc ===
Normally this template is used without any parameters and placed at the bottom of the template or page being documented, in a &lt;noinclude> section. Like this:
<pre>
<!--Last line of your template code--><noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
</pre>
Then this template automatically loads the content from the /doc subpage of the template it is used on.
=== Any /doc page ===
This template can be told to load the content from any other page. Like this:
<pre>
<!--Last line of your template code--><noinclude>
{{documentation|Template:Other page/doc}}
</noinclude>
</pre>
But when doing so it becomes tricky to handle the categories and interwiki links.
=== In-line content ===
The content can also be fed directly as text. Like this:
<pre>
<!--Last line of your template code--><noinclude>
{{documentation
| content = Some documentation text.
}}
</noinclude>
</pre>
=== In-line content with [edit][purge] links ===
<pre>
<!--Last line of your template code--><noinclude>
{{documentation
| 1 = Template:Any page/doc
| content = {{Template:Any page/doc| parameters }}
}}
</noinclude>
</pre>
=== Best practice ===
The code should be added at the bottom of the template code, with no extra space before "<code>&lt;noinclude></code>" (which would cause extra space on pages where the template is used).
Categories and interwiki links that apply to the template itself should be added to the /doc subpage, inside <code>&lt;includeonly>&lt;/includeonly></code> tags. For more complex cases, see [[Wikipedia:Template documentation#Categories and interwiki links]].
If the documentation page contains &lt;includeonly> or &lt;noinclude> tags as part of the visible documentation text, replace the "<code>&lt;</code>" with "<code>&amp;lt;</code>".
=== The heading ===
When in Template space this template shows this heading:
:[[File:Template-info.svg|35px]] '''Template documentation'''
In most other namespaces, such as "Wikipedia:", it shows this heading:
:'''Documentation'''
But when on File (image) pages it shows this heading:
:'''Summary'''
Overrides exist to customize the output in special cases:
* <code>&#123;&#123;documentation| '''heading''' = ...&#125;&#125;</code> − change the text of the "documentation" heading. If this is set to blank, the entire heading line (including the first [edit] link) will also disappear.
=== Automatic functions ===
When this template is on a protected template page it now automatically adds {{tl|pp-template}} that shows the grey or red padlock in the top right corner. So no need to manually add {{tlf|pp-template}} to templates that use {{tl|documentation}}.
When this template is on a /sandbox subpage it automatically adds the {{tl|template sandbox notice}}.
If the documentation page doesn't exist, the "edit" link includes a [[mw:Manual:Creating pages with preloaded text|preload]] parameter so that clicking it will pre-fill the edit form with the basic documentation page format.
=== Rationale ===
Use of this template allows templates to be [[Wikipedia:Protection policy|protected]] where necessary, while allowing anyone to edit the documentation, categories, and interwiki links.
=== See also ===
{{Documentation/doc/see also}}
<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:Template documentation| ]]
[[Category:Wikipedia formatting and function templates|{{PAGENAME}}]]
[[simple:Template:Documentation]]
[[ar:قالب:توثيق]]
[[ba:Ҡалып:Doc]]
[[bg:Шаблон:Документация]]
[[bs:Šablon:Dokumentacija]]
[[ca:Plantilla:Ús de la plantilla]]
[[cs:Šablona:Dokumentace]]
[[da:Skabelon:Dokumentation]]
[[de:Vorlage:Dokumentation]]
[[dsb:Pśedłoga:Dokumentacija]]
[[et:Mall:Usage of template]]
[[es:Plantilla:Documentación de plantilla]]
[[eo:Ŝablono:Dok]]
[[eu:Txantiloi:Txantiloi dokumentazioa]]
[[fa:الگو:توضیحات]]
[[fr:Modèle:Documentation]]
[[gl:Template:Uso de plantilla]]
[[he:תבנית:תיעוד]]
[[hsb:Předłoha:Dokumentacija]]
[[hu:Sablon:Sablondokumentáció]]
[[ia:Patrono:Docpatrono]]
[[id:Templat:Dokumentasi]]
[[it:Template:Man]]
[[ja:Template:Documentation]]
[[ko:틀:틀 설명문서]]
[[ms:Templat:Dokumentasi]]
[[no:mal:Dokumentasjon]]
[[nl:Sjabloon:Sjabdoc]]
[[pl:Szablon:Dokumentacja]]
[[pt:Predefinição:Documentação]]
[[ro:Format:Documentaţie]]
[[ru:Шаблон:Doc]]
[[sk:Šablóna:Dokumentácia]]
[[sl:Predloga:Dokumentacija]]
[[sr:Шаблон:Документација]]
[[sq:Stampa:Dokumentacion]]
[[stq:Foarloage:Dokumentation]]
[[sv:Mall:Dokumentation]]
[[tl:Template:Documantation]]
[[tpi:Template:Template doc]]
[[uk:Шаблон:Документація]]
[[war:Template:Documentation]]
[[zh:Template:Documentation]]
</includeonly>

Latest revision as of 05:25, 14 November 2011