Difference between revisions of "Template:Documentation/doc"
MyraMidnight (Talk | contribs) |
MyraMidnight (Talk | contribs) m |
||
(2 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
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 | 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 | ||
− | + | Simply add the <code><nowiki>{{Documentation}}</nowiki></code> to the bottom of the page and save. If the page has <code>/doc</code> subpage, then it will automatically fill the documentation, else it will give you a easy red link that begs to be created. | |
− | == | + | |
− | + | ||
+ | == Optional parameters == | ||
*<code>heading=</code> 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. | *<code>heading=</code> 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. | ||
+ | *<code>heading-style=</code> lets you set custom style to the heading, such as the font-size. | ||
+ | |||
+ | |||
+ | == Namespace detection == | ||
+ | This template has the neat feature of detecting the namespace and applying the appropriate heading accordingly. | ||
+ | * <code>Tempalte:</code> namespaces will get the fancy ''Template documentation'' with navbar links to the <code>/doc</code> subpage. | ||
+ | * <code>File:</code> namespaces will get ''Summary'' heading and hides the info-panel at the bottom. Neat for when you really want to add information to a specific file. | ||
+ | Any other namespace will default to a simple ''Documentation'' as heading unless you use the optional <code>heading</code> parameter. | ||
==Documentation subpages== | ==Documentation subpages== |
Latest revision as of 17:58, 2 November 2020
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
Simply add the {{Documentation}}
to the bottom of the page and save. If the page has /doc
subpage, then it will automatically fill the documentation, else it will give you a easy red link that begs to be created.
Optional parameters
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.heading-style=
lets you set custom style to the heading, such as the font-size.
Namespace detection
This template has the neat feature of detecting the namespace and applying the appropriate heading accordingly.
-
Tempalte:
namespaces will get the fancy Template documentation with navbar links to the/doc
subpage. -
File:
namespaces will get Summary heading and hides the info-panel at the bottom. Neat for when you really want to add information to a specific file.
Any other namespace will default to a simple Documentation as heading unless you use the optional heading
parameter.
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>