Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Documentation: Difference between revisions

Template page
minecraft>Shirayuki
mNo edit summary
 
minecraft>Cook Me Plox
forcing a refresh lol
Line 1: Line 1:
<noinclude>
<includeonly>{{#invoke: documentation | page }}</includeonly><noinclude>
<languages/>
{{documentation}}
</noinclude><includeonly>{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}</includeonly><noinclude>
<!-- Put categories/interwikis on the documentation page! -->
{{documentation|content=
</noinclude>
 
{{Lua|Module: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>
==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>

Revision as of 18:19, 24 September 2023

[view] [edit] [history] [purge]Documentation
This template uses Module:Documentation, a script written in Lua.
Shortcut

For templates, insert {{subst:docc}} at the end of the template, then save the page; this will place {{documentation}} and a comment advising editors where to place categories and interwiki links. For other types of pages, the documentation template should already be there.

Click "create" at the top of the page and the documentation page will be opened with some pre-formatting.

Documentation pages will automatically be added to Category:Documentation pages.

Optional parameters

This parameters can either be added to the {{subst:docc}} template when creating the page, or added to the {{documentation}} template afterwards.

type

Sets the "type" of documentation this is, e.g. template, module, message, etc. This will be used as part of some messages the template might display, as well as categorisation.

The type is automatic based on the namespace, so it shouldn't generally need to be set.

page

The page where the documentation should be. This defaults to a subpage of the current page called "doc".

content

Allows documentation content to be specified directly, rather than on a separate sub-page. Useful for small page-specific sub-page templates, e.g. Explosion/table.

nodoc

If a template has no documentation and you don't know how to use it, add nodoc=1 to the documentation template on the documentation page. The documentation's background will become red to make it more noticeable, and the page will be added to a category depending on the type of page.

This is automatically set if the documentation page doesn't exist or is empty, so this generally isn't necessary to set.

baddoc

Similar to nodoc, this is used to mark templates that do have documentation, but it isn't very good. This can mean it doesn't have enough examples, doesn't explain all the functions properly, or doesn't explain the point of the template properly. The documentation's background will become yellow to make it more noticeable, and the page will be added to a category depending on the type of page.

cs:Šablona:Documentation de:Vorlage:Dokumentation es:Plantilla:Documentación fr:Modèle:Documentation it:Template:Documentazione ja:テンプレート:Documentation ko:틀:Documentation lzh:模板:Documentation nl:Sjabloon:Documentatie pl:Szablon:Dokumentacja pt:Predefinição:Documentação ru:Шаблон:Документация th:แม่แบบ:Documentation uk:Шаблон:Документація zh:Template:Documentation

[view] [edit] [history] [purge]The above documentation is transcluded from Template:Documentation/doc.