Permanently protected template

Difference between revisions of "Template:Documentation"

From The HILLSIDE
Jump to navigation Jump to search
imported>Malyctenar
(I'm pretty sure people know that clicking on the blue pagename link thingy makes them see it; also no need to test SUBPAGENAME within noinclude of a single template)
m (357 revisions imported: Import Template:Page in progress)
 
(280 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
{{pp-semi-template|small=yes}}
+
<languages/>
{{intricate}}
+
</noinclude><includeonly>{{#switch:<translate></translate>
<!-- Moved to: Template:Documentation, template
+
| =
    {{Mergingfrom|Template doc|date=November 2007}}
+
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}
    [[User:ConradPino]] 21:45, 9 November 2007 (UTC)
+
| #default=
  -->
+
  {{#invoke:Template translation|renderTranslatedTemplate|template=Template:Documentation|noshift=1}}
</noinclude><div class="template-documentation">{{
+
}}</includeonly><noinclude>
  #if: {{{heading|Documentation}}}
+
{{documentation|content=
  |<!-- has heading --><div style="padding-bottom: {{{heading-padding|3px}}}; border-bottom: 1px solid #aaa; margin-bottom: {{{heading-margin|1ex}}}"><span class="editsection plainlinks" id="doc_editlinks">{{
+
 
    #ifexist: {{{1|{{Documentation/docname}}}}}
+
{{Lua|Module:Documentation}}
    |<!-- /doc exists -->[[{{fullurl:{{{1|{{Documentation/docname}}}}}}} view]] [[{{fullurl:{{{1|{{Documentation/docname}}}}}|action=edit}} edit]]
+
<translate>
    |<!-- no /doc -->{{
+
<!--T:12-->
      #if: {{{content|}}}
+
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>
      |<!-- only if no content, then -->[[{{fullurl:{{{1|{{Documentation/docname}}}}}|action=edit&preload={{{preload-doc|Template:Documentation/preload}}}}} edit]]
+
<!--T:13-->
    }}<!-- endif content, follows endifexist /doc  -->
+
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.
  }}</span> <span style="{{{heading-style|font-size: 150%}}}">{{{heading|Documentation}}}</span></div>
+
 
<!-- follows endif heading: if empty, all of the above is skipped -->
+
==Usage== <!--T:2-->
}}<div id="template_doc_page_transcluded" class="dablink plainlinks">{{
+
 
  #ifeq: {{{transcluded|show}}} | show
+
===Customizing display=== <!--T:3-->
  |<!-- transcluded show -->{{
+
 
    #ifexist: {{{1|{{Documentation/docname}}}}}
+
<!--T:4-->
    |<!-- /doc exists -->This [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from [[{{{1|{{Documentation/docname}}}}}]]. <small style="font-style: normal">([{{fullurl:{{{1|{{Documentation/docname}}}}}|action=edit}} edit] &#124; [{{fullurl:{{{1|{{Documentation/docname}}}}}|action=history}} history])</small><br />
+
Overrides exist to customize the output in special cases:
  }}<!-- endifexist /doc;
+
</translate>
            follows
+
* <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>
  endif transcluded = show : if hide, this was skipped -->
+
 
}}{{
+
<translate>
  #switch: {{SUBPAGENAME}}
+
==Rationale== <!--T:6-->
  |sandbox=<!-- sandbox -->
+
 
  |testcases=<!-- testcases -->
+
<!--T:7-->
  |#default={{
+
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>
    #switch: {{SUBJECTSPACE}}/{{{sandbox-testcases|show}}}
+
<translate>
    |{{ns:template}}/show
+
<!--T:8-->
    | {{ns:user}}/show =<!-- show experiment subpages -->This template has {{
+
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]]).
      #ifexist: {{ #rel2abs: /sandbox }}
+
 
      |<!-- /sandbox -->a [[/sandbox|sandbox]] <small style="font-style: normal">([{{fullurl:{{ #rel2abs: /sandbox }}|action=edit}} edit])</small> {{
+
==See also== <!--T:9-->
        #ifexist: {{ #rel2abs: /testcases }}
+
</translate>
        | and [[/testcases|testcases]] <small style="font-style: normal">([{{fullurl:{{ #rel2abs: /testcases }}|action=edit}} edit])</small>
+
* <translate><!--T:14--> [[w:Template:Documentation subpage]]</translate>
        | but '''no''' [{{fullurl:{{ #rel2abs: /testcases }}|action=edit&preload={{{preload-testcases|Template:Documentation/preload/testcases}}}}} testcases]
+
* {{tim|Documentation}}
      }}
+
* <translate><!--T:11--> [[w:Wikipedia:Template documentation]]</translate>
      |<!-- no /sandbox -->'''no''' [{{fullurl:{{ #rel2abs: /sandbox }}|action=edit&preload={{{preload-sandbox|Template:Documentation/preload/sandbox}}}}} sandbox] {{
+
 
        #ifexist: {{ #rel2abs: /testcases }}
+
}}
        |<!-- no /sandbox AND /testcases -->but has [[/testcases|testcases]] <small style="font-style: normal">([{{fullurl:{{ #rel2abs: /testcases }}|action=edit}} edit])</small>
+
[[Category:Formatting templates{{#translation:}}|Template documentation]]
        |<!-- no /sandbox AND no /testcases -->and '''no''' [{{fullurl:{{ #rel2abs: /testcases }}|action=edit&preload={{{preload-testcases|Template:Documentation/preload/testcases}}}}} testcases]
+
[[Category:Template documentation{{#translation:}}| ]]
        }}
+
</noinclude><includeonly>{{#if:{{{content|}}}|
    }} for editors to experiment.
+
[[Category:Template documentation pages{{#translation:}}]]
    |<!-- hide experiment subpages: follow both endcases-->
+
}}</includeonly>
  }}
 
}}</div>
 
{{{content|{{ {{ #ifexist: {{{1|{{Documentation/docname}}}}} | {{{1|{{Documentation/docname}}}}} | ns:0 }} }}}}}
 
</div>
 

Latest revision as of 08:09, 14 July 2020


Template documentation

This template automatically displays a documentation box like the one you are seeing now, of which the content is transcluded from another page. It is intended for pages which are transcluded in other pages, i.e. templates, whether in the template namespace or not.

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