Difference between revisions of "Template:Documentation"

From Pandora Wiki
Jump to: navigation, search
(Created page with "{{Documentation subpage}} This template is used in many pages. ==History== This template is a derived work. It is, however, NOT exactly the sam...")
 
 
Line 1: Line 1:
{{Documentation subpage}}
+
<div class="template-documentation"><!--
This template is used in many [[:Category:Ambox Derived Works|pages]].
 
  
==History==
+
These are the literal class definitions in common.css:
This template is a derived work. It is, however, NOT exactly the same as Wikipedia's template of the same name! All CSS has been integrated into the template, and therefore some features are not available. However it is still a very useful template!
+
   
 +
/* For template documentation */
 +
.template-documentation {
 +
    clear: both;
 +
    margin: 1em 0 0 0;
 +
    border: 1px solid #aaa;
 +
    background-color: #ecfcf4;
 +
    padding: 1em;
 +
}
  
==Usage Instructions==
+
-->{{#ifeq:{{{heading|μ}}}|<!--**DEFINED BUT EMPTY**-->
 +
  |<!--**NOTHING**-->
 +
  |<div style="padding-bottom:3px; border-bottom: 1px solid #aaa; margin-bottom:1ex">{{#ifeq:{{{content|μ}}}|μ
 +
  |<span class="editsection plainlinks" id="doc_editlinks">{{#ifexist: {{{1|{{Documentation/docname}}}}}
 +
    |<!--**    /doc EXISTS**  -->[[{{fullurl:{{{1|{{Documentation/docname}}}}}|action=edit}} edit]] [{{purge|purge}}]
 +
    |<!--**/doc DOESN'T EXIST**-->[[{{fullurl:{{{1|{{Documentation/docname }}}}}|action=edit&preload=Template:Documentation/preload}} create]]
 +
  }}</span>
 +
  }} <span style="{{#if:{{{heading-style|}}}|{{{heading-style}}}|{{#ifeq:{{NAMESPACE}}|{{ns:template}}|font-weight: bold; font-size: 125%|font-size: 150%}}}}">{{#if:{{{heading|}}}|{{{heading}}}|{{#ifeq:{{NAMESPACE}}|{{ns:template}}|[[Image:Template-info.svg|50px]] Template documentation|Documentation}}}}</span></div>
 +
}}<!--
  
The best examples of it's use are within the page: [[Wiki labels]]
+
--><div id="template_doc_page_transcluded" class="dablink plainlinks"><!--
 +
  -->{{#ifexist: {{{1|{{Documentation/docname}}}}}
 +
  |<!--**/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 />
 +
}}<!--
  
===Colour Coding===
+
-->{{#switch: {{SUBPAGENAME}}
Amboxes are divided into various typesEach type should have a corresponding colour code. The colour-coding helps to inform of the severity of the issues at a glance.
+
  |sandbox|testcases=<!--**DO NOT SHOW THESE LINKS ON THE SANDBOX/TESTCASES PAGES**-->
 +
  |#default=
 +
    {{#switch: {{SUBJECTSPACE}}
 +
    |{{ns:template}}
 +
    |{{ns:user}}=
 +
      {{#ifexist: {{FULLPAGENAME}}/sandbox
 +
      |This template has a [[/sandbox|sandbox]] <small style="font-style: normal">([{{fullurl:{{ #rel2abs: /sandbox }}|action=edit}} edit])</small> <!--
 +
        -->{{#ifexist: {{FULLPAGENAME}}/testcases
 +
        |and [[/testcases|testcases]] <small style="font-style: normal">([{{fullurl:{{ #rel2abs: /testcases }}|action=edit}} edit])</small>}} for editors to experiment.
 +
      |{{#ifexist: {{FULLPAGENAME}}/testcases
 +
        |This template has [[/testcases|testcases]] <small style="font-style: normal">([{{fullurl:{{ #rel2abs: /testcases }}|action=edit}} edit])</small> for editors to experiment.}}
 +
  }}}}}}
 +
  </div>
 +
{{#if:{{{content|}}}|{{{content}}}|{{#ifexist:{{{1|{{Documentation/docname}}}}} | {{ {{{1|{{Documentation/docname}}}}} }} }}}}
 +
<div style="clear: both;"></div>
 +
</div><noinclude>
  
{| class="wikitable" style="margin: 0 0 0 10%; background: #fbfbfb;"
+
{{pp-template|small=yes}}
|-
+
<!-- Add categories and interwikis to the /doc subpage, not here! -->
! style="background: #000000;" | &nbsp;
+
[[Category:Wiki templates|Documentation]]
! style="padding: 0.25em 0.5em;" | Code
+
</noinclude>
! Name
 
! Description
 
! Example Templates
 
|- style="background: #ffaaaa;"
 
| style="background: #b22222;" | &nbsp;
 
| style="padding: 0.25em 0.5em;" | #b22222 (#ffaaaa)
 
| '''Danger'''
 
| To Really Warn a User!
 
| {{tl|Delete}}
 
|- style="background: #ffdddd;"
 
| style="background: #b22222;" | &nbsp;
 
| style="padding: 0.25em 0.5em;" | #b22222 (#ffdddd)
 
| '''Warning'''
 
| To Warn a User!
 
| {{tl|Delete}}
 
|- style="background: #ffffaa;"
 
| style="background: #f28500;" | &nbsp;
 
| style="padding: 0.25em 0.5em;" | #f28500 (#ffffaa)
 
| '''Caution'''
 
| To Caution a User!
 
| {{tl|Cleaning}}
 
|-
 
| style="background: #f4c430;" | &nbsp;
 
| style="padding: 0.25em 0.5em;" | #f4c430
 
| '''Proposal'''
 
| Content Proposals. Cleaning
 
| {{tl|Cleanup}}
 
|- style="background: #deffde;"
 
| style="background: #00ff00;" | &nbsp;
 
| style="padding: 0.25em 0.5em;" | #00ff00 (#deffde)
 
| '''Approval'''
 
| All Clear Signal!
 
| {{tl|Cleaned}}
 
|- style="background: #e4d8ff;"
 
| style="background: #9932cc;" | &nbsp;
 
| style="padding: 0.25em 0.5em;" | #9932cc (#e4d8ff)
 
| '''Detail'''
 
| [[WP:MERGE|Merge]], [[WP:SPLIT|split]] and [[Help:Transwiki|transwiki]] proposals
 
| {{tl|split}}, {{tl|copy to wiktionary}}
 
|-
 
| style="background: #1e90ff;" | &nbsp;
 
| style="padding: 0.25em 0.5em;" | #1e90ff
 
| '''Notice'''
 
| Information readers/editors should be aware of
 
| {{tl|current}}, {{tl|recent death}}
 
|-
 
| style="background: #bbbbaa;" | &nbsp;
 
| style="padding: 0.25em 0.5em;" | #bbbbaa
 
| '''Protection'''
 
| Page is [[WP:PROTECT|locked]] against edits
 
| {{tl|pp-protected}}
 
|}
 

Latest revision as of 06:30, 21 April 2011

[edit] [purge] 50px Template documentation


This template automatically displays a documentation box like 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

Normal /doc

<noinclude>{{Documentation}}</noinclude>

Any /doc page

<noinclude>{{Documentation|Template:any page/doc}}</noinclude>

In-line content

<noinclude>{{Documentation|content=This is documentation.}}</noinclude>

In-line content with [view][edit] links

<noinclude>{{Documentation
|1 = Template:any page/doc
|content ={{Template:any page/doc|parameters}}
}}</noinclude>

Best practice

This code should be added at the bottom of the template code, with no extra space before "<noinclude>" (which would cause extra space on pages where the template is used). The parameter can be used as shown above to transclude an arbitrary documentation page.

Categories and interwiki links that apply to the template itself should be added to the documentation page, inside <includeonly> </includeonly> tags. For more complex cases, see Wikipedia:Template documentation#Categories and interwiki links.

If the documentation page contains includeonly or noinclude tags as part of the documentation, replace the "<" with "&lt;".

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.

Functions

If the documentation page doesn't exist, the "edit" link includes a preload parameter so that clicking it will pre-fill the edit form with the basic documentation page format.

Rationale

Use of this template allows templates to be protected where necessary, while allowing anyone to edit the documentation, categories, and interwiki links.

See also

Template:Documentation/doc/see also

Template:Pp-meta