Difference between revisions of "Template:Documentation"

From EVE University Wiki
Jump to: navigation, search
(Added a {{clear}} to the main body, to ensure the table of contents doesn't break the bottom on very short pages.)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><div style="clear: both; border: 1px solid black; margin: 1em; margin-top: 3em;">
+
<includeonly><div style="clear: both; border: 1px solid black; margin:1em;">
  <div style="background: #AD5300; color: #ddd; padding: 1em; margin: 0em;">'''Template documentation''' <span style="font-size: 85%;">(for the above template, sometimes hidden or invisible)</span></div>
+
<div style="background-color:#AD5300; padding:1em;">'''Template documentation''' <span style="font-size: 85%;">(for the above template, sometimes hidden or invisible)</span></div>
  <div style="background: #222; color: #ddd; padding: 1em; padding-bottom: 0em; margin: 0em;"><!--
+
<div style="background-color:#222222; padding:1em;"><!--
 
  -->{{#ifexist: {{{1|{{FULLPAGENAME}}/doc}}}
 
  -->{{#ifexist: {{{1|{{FULLPAGENAME}}/doc}}}
 
     | {{tocright}}{{{{#ifeq: {{NAMESPACE}} | {{ns:Template}} |
 
     | {{tocright}}{{{{#ifeq: {{NAMESPACE}} | {{ns:Template}} |
Line 7: Line 7:
 
                     }}{{ #if: {{{1|}}} | {{PAGENAME:{{{1}}}}} | {{PAGENAME}}/doc}} }}
 
                     }}{{ #if: {{{1|}}} | {{PAGENAME:{{{1}}}}} | {{PAGENAME}}/doc}} }}
 
     | :<strong class="error">This template currently doesn't have any documentation!</strong> Help out by [{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}|action=edit&preload=Template:Documentation/preload}} writing some]. {{#ifeq:{{NAMESPACE}}|{{ns:10}}|There may also be documentation on [[w:c:templates:{{FULLPAGENAME}}/doc|Wikia Templates]] which can be copied.}}[[Category:Templates without documentation]]
 
     | :<strong class="error">This template currently doesn't have any documentation!</strong> Help out by [{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}|action=edit&preload=Template:Documentation/preload}} writing some]. {{#ifeq:{{NAMESPACE}}|{{ns:10}}|There may also be documentation on [[w:c:templates:{{FULLPAGENAME}}/doc|Wikia Templates]] which can be copied.}}[[Category:Templates without documentation]]
   }}
+
   }}{{clear}}</div>
  </div> <!--
+
<div style="background-color:#666666; padding:0.5em; font-size: 85%; text-align: right;"><!--
 
 
--><div style="clear: both; background: #2F4F4F; color: #ddd; padding: 0.5em; margin: 0em; font-size: 85%; text-align: right;"><!--
 
 
-->Visit {{ #ifexist: {{{1|{{FULLPAGENAME}}/doc}}} | [[{{{1|{{FULLPAGENAME}}/doc}}}]] | [{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}|action=edit&preload=Template:Documentation/preload}} {{{1|{{FULLPAGENAME}}/doc}}}] }} to edit this text! ([[Template:Documentation|How does this work]]?) ([{{fullurl:{{FULLPAGENAME}}|action=purge}} Refresh] this text - [[Help:Purge|why?]])</div>
 
-->Visit {{ #ifexist: {{{1|{{FULLPAGENAME}}/doc}}} | [[{{{1|{{FULLPAGENAME}}/doc}}}]] | [{{fullurl:{{{1|{{FULLPAGENAME}}/doc}}}|action=edit&preload=Template:Documentation/preload}} {{{1|{{FULLPAGENAME}}/doc}}}] }} to edit this text! ([[Template:Documentation|How does this work]]?) ([{{fullurl:{{FULLPAGENAME}}|action=purge}} Refresh] this text - [[Help:Purge|why?]])</div>
 
</div></includeonly><noinclude>
 
</div></includeonly><noinclude>
 
{{Documentation|Template:documentation/doc}}
 
{{Documentation|Template:documentation/doc}}
 
</noinclude>
 
</noinclude>

Latest revision as of 11:51, 27 March 2017

Template documentation (for the above template, sometimes hidden or invisible)
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.
Visit Template:documentation/doc to edit this text! (How does this work?) (Refresh this text - why?)