Difference between revisions of "Template:Documentation/doc"

From EVE University Wiki
Jump to: navigation, search
m (Fix typo. To let the ; tag work as intended it needs to be at first position of the line.)
m (Fix typo.)
 
Line 12: Line 12:
 
== General usage ==
 
== General usage ==
 
=== On the Template page ===
 
=== On the Template page ===
You should attach <code><nowiki><noinclude>{{T|Documentation}}</noinclude></nowiki></code> to the end of the template page, so it looks like the below:
+
You should attach <code><nowiki><noinclude>{{Documentation}}</noinclude></nowiki></code> to the end of the template page, so it looks like the below:
 
<pre>
 
<pre>
 
TEMPLATE CODE HERE
 
TEMPLATE CODE HERE
Line 41: Line 41:
 
; Syntax
 
; Syntax
 
: {{T|Templatename|param|...}}
 
: {{T|Templatename|param|...}}
 
+
:; Parameters
; Parameters
+
::; param
:; param
+
::: Param description
;; Param description
+
::; param
:; param
+
::: Param description
;; Param description
 
 
OR
 
OR
:; param : Param description
+
::; param : Param description
:; param : Param description
+
::; param : Param description
  
 
Repeat as needed ...
 
Repeat as needed ...

Latest revision as of 14:48, 9 March 2023

Description
This template is used to insert documentation on template pages.
Dependencies
Uses
{{Documentation/preload}} when no actual documentation is added yet.
Syntax
Type <noinclude>{{Documentation</noinclude> at the end of the template page.

General usage

On the Template page

You should attach <noinclude>{{Documentation}}</noinclude> to the end of the template page, so it looks like the below:

TEMPLATE CODE HERE
Template code
<includeonly> Any categories to be inserted into articles by the template</includeonly><noinclude>
{{documentation}}</noinclude>

This will add the documentation template to the template-page, but not to pages where the template is used due to the inclusion tags.

On the Template/doc page

You should fill this out with information on how to use the template. Unused items should be removed.

See also Template:Documentation/preload
; Description
: A short description of the purpose of the template.

; Dependencies
:; Uses
:: Resource used by this template (Use linking or {{T}} where possible)
:: Resource used by this template
:: Repeat as needed ...
:; Used by
:: Template that uses this template (Preferably by using {{T|Templatename}} ))
:: Repeat as needed ...

; Syntax
: {{T|Templatename|param|...}}
:; Parameters
::; param
::: Param description
::; param
::: Param description
OR
::; param : Param description
::; param : Param description

Repeat as needed ...

; Sample
: <code><nowiki>{{templatename}}</nowiki></code> gives...
: {{templatename}}

<includeonly>[[Category:Any categories for the template itself]]</includeonly><noinclude>
[[Category:Template documentation]]</noinclude>

Use any or all of the above description/syntax/sample output sections. You may also want to add "see also" or further usage information sections.

Note that the above example also uses {{T}} to display the formatting of the template code, without actually calling the template for transclusion (as normally happens with the squiggly brackets).

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. According to MediaWiki it also helps reduce server resource demand by circumventing certain technical limitations of templates. Unfortunately they don't say what those limitations are, exactly. - 2012, User:Quinn fellthorn

User:Telinchei would suggest to the those relate to server resources, when deciding what to transclude (finding noinclude tags) from the template page.