Difference between revisions of "Template:Documentation"

From Krafties
Jump to navigation Jump to search
m
m (having a link 'subpages of this subpage' in the documentation seemed weird.)
 
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
+
<onlyinclude><includeonly><div style="
{|class="pinktable mw-collapsible" style="width:100%;background:white;"
+
margin: 1em 0 1em 0;
!{{{title|Template Explanation}}}
+
background-color: #fff5fa;
|-
+
border: 1px #bfa3af solid;
|style="{{{style|padding-left:10px;}}}" |<!---
+
border-collapse: collapse;
 +
color: black;
 +
padding: 1em;">
 +
<span style="{{#if: {{{heading-style|}}}
 +
  | {{{heading-style|}}}
 +
  | {{#ifeq: {{SUBJECTSPACE}} | {{ns:Template}}
 +
    | font-weight: bold; font-size: 125%
 +
    | font-size: 150%
 +
    }}
 +
  }}">{{#switch: {{{heading|¬}}}
 +
  | ¬ = 
 +
    <!--"heading" not defined in this or previous level-->
 +
    {{#switch: {{SUBJECTSPACE}}
 +
    | {{ns:Template}} = [[File:Template_Info.png|50px|link=|alt=Documentation icon]] Template documentation ({{Navbar|{{PAGENAME}}/doc|text=}})<hr>
 +
    | {{ns:File}} = Summary <hr>
 +
    | #default = Documentation <hr>
 +
    }}
 +
  | #default =  
 +
    <!--"heading" has data or is empty but defined-->
 +
    {{{heading|}}}
 +
  }}</span>
 +
<!---
  
 
--->{{{{PAGENAME}}/doc}}
 
--->{{{{PAGENAME}}/doc}}
|}
+
</div>
{|class="pinktable" style="width:100%;background:white;"
+
<div style="
|-
+
margin: 1em 0 1em 0;
|style="{{{style|padding-left:10px;}}}" |
+
background-color: #fff5fa;
The above documentation is transcluded from Template:Documentation/doc. (edit | history)
+
border: 1px #bfa3af solid;
<br>Editors can experiment in this template's [[{{FULLPAGENAME}}/sandbox|sandbox]]
+
border-collapse: collapse;
<br>Please add categories to the [[{{FULLPAGENAME}}/doc|/doc]] subpage. {{Subpages|Subpages of this template}}.
+
color: black;
;:Attention! It would be a great help if you could help migrate the template explanation information to their /doc pages.
+
padding: 1em;">
:Please view [[Template:Template_Explanation/doc|This page]] for more detail on how to migrate the information, thank you!
+
:The above documentation is transcluded from [[{{FULLPAGENAME}}/doc]].  
;:You might want to leave the [[Template:Table Cell Templates|Table Cell Templates]] alone unless you know what you are doing, it requires some more advanced splicing because of all the <nowiki><noinclude></nowiki> tags.
+
:Editors can experiment in this template's [[{{FULLPAGENAME}}/sandbox|sandbox]]
<!--
+
:Please add categories to the [[{{FULLPAGENAME}}/doc|'''/doc''' subpage]] within {{tag|includeonly}}
 
+
</div></includeonly></onlyinclude>
      -->
+
{{Documentation}}
|}</includeonly><noinclude>
 
{|class="pinktable mw-collapsible" style="width:100%;background:white;"
 
!{{{title|Template Explanation}}}
 
|-
 
|style="{{{style|padding-left:10px;}}}" |
 
{{Documentation/doc}}
 
|}</noinclude>
 

Latest revision as of 17:45, 10 October 2020

Documentation icon Template documentation ( view · talk · edit)

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

It detects the namespace, so when used on templates, it will say "Template Documentation" but on other namespaces it will just say "Documentation".

Usage

|heading= (OPTIONAL)
  • heading= you can set a custom title, but if you include this parameter but leave it empty then the title will be removed along with the "edit/view" links.

Documentation subpages

Here is an example of how a /doc subpage setup should look like to be proper.

Categories that should be applied to the template should always go between <includeonly> and </includeonly> so they will not apply themselves to the documentation.
{{Documentation subpage}}
<!-- Categories go at the bottom of this page and interwiki links -->

== Usage ==
 | parameter=

== See also ==

<includeonly>
<!-- Categories go here, and interwikis go here -->
</includeonly>

See also

The above documentation is transcluded from Template:Documentation/doc.
Editors can experiment in this template's sandbox
Please add categories to the /doc subpage within <includeonly>...</includeonly>