Permanently protected template

Template:Documentation: Difference between revisions

From The HILLSIDE
Jump to navigation Jump to search
meta>Verdy p
m if a docname is fed, don't track in "Templates without documentation" (many derived templates, e.g. translations, share the same doc page as a base template, often with parameters for a few variable parts)
en>Jackmcbarn
ugly hack so that expanding of the /doc subpage doesn't count against Lua's time limit
Line 1: Line 1:
{{documentation/core2
{{#if:{{#invoke:documentation|contentTitle}}|{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}|{{#invoke:documentation|main}}}}<noinclude>
| heading = {{{heading|¬}}}<!--defined and empty means no header-->
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
| heading-style = {{{heading-style|}}}
| link box = {{{link box|}}} <!--So "link box=off" works-->
| template page =
  <!--The namespace is added in /core2-->
  {{#switch: {{SUBPAGENAME}}
  | sandbox
  | testcases = {{BASEPAGENAME}}
  | #default = {{PAGENAME}}
  }}
| docspace =
  <!--Some namespaces must have the /doc, /sandbox and /testcases in talk space-->
  {{#switch: {{SUBJECTSPACE}}
  | {{ns:0}}
  | {{ns:File}}
  | {{ns:MediaWiki}}
  | {{ns:Category}} = {{TALKSPACE}}
  | #default = {{SUBJECTSPACE}}
  }}
| content = {{{content|}}}
| 1 = {{{1|}}} <!--Other docname, if fed-->
| {{#ifeq: {{{2|}}} | {{{2|+}}} | 2 | <!-- dummy -->}} = {{{2|}}}<!--some doc pages may have a few optional parameters to change their text, or set template categories in their noinclude section-->
| {{#ifeq: {{{3|}}} | {{{3|+}}} | 3 | <!-- dummy -->}} = {{{3|}}}
| {{#ifeq: {{{4|}}} | {{{4|+}}} | 4 | <!-- dummy -->}} = {{{4|}}}
| {{#ifeq: {{{5|}}} | {{{5|+}}} | 5 | <!-- dummy -->}} = {{{5|}}}
}}<includeonly>{{#if: {{{1|}}} || {{#ifexist: {{FULLPAGENAME}}/doc || [[Category:Templates without documentation]] }} }}</includeonly><noinclude>
<!-- Add categories and interwikis to the /doc subpage, not here! ??? -->
</noinclude>
</noinclude>

Revision as of 17:30, 20 April 2014

<templatestyles src="Module:Documentation/styles.css"></templatestyles>

Template documentation

Usage

Customizing display

Overrides exist to customize the output in special cases:

  • {{documentation|heading=}}: 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.

Rationale

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. It also reduces server resources by circumventing a technical limitation of templates (see a developer's explanation).

See also