Documentation: Difference between revisions

From SL Pro Wrestling Wiki
/>Iynque
m wording: "sometimes hidden or invisible" —> "sometimes partially or fully invisible"
/>©TriMoon™
m Compressing code logic and Complete reformating source-flow for readability (by SublimeText.Mediawiker)
Line 1: Line 1:
<div class="template-documentation" style="clear: both; border: 1px solid black; margin: 1em;"><!--
<!--    -*- mode:MediawikiNG; tab-width:8; indent-tabs-mode:tab; -*-
--><div class="color1" style="padding: 1em; margin: 0;"><!--
NOTE:
    -->'''Template documentation''' <!--
    PLEASE keep the indentations intact !
    --><span style="font-size: 85%;"><!--
    The above emacs Modeline will preset most intelligent editors
      -->(for the above template, sometimes partially or fully invisible)<!--
with correct setting. If your editor doesn't understand
    --></span> <!--
'mode:MediawikiNG;' then use 'mode:PHP;'
    -->{{#if: {{{content|}}}
    Please keep this and oter HTML-comment it does not negatively impact
      |
any of the functioning of the template but improves readability
      | <span id="doc_editlinks" class="editsection plainlinks" style="font-size: 85%; float:right;"><!--
that is crucial in maintainability by other editors.
-->{{#ifexist: {{#if: {{{1|}}}
 
| {{{1}}}
TODO:
| {{FULLPAGENAME}}/doc
    I used SublimeText with tab-size set to 4 then just
}}
before saving to wiki i did "Convert Indentation to Spaces"
    | &#91;[[{{#if: {{{1|}}}
then changed tab-size set to 8 and did "Convert Indentation to Tabs".
    | {{{1}}}
    After those 2 steps i commited to wiki.
    | {{FULLPAGENAME}}/doc
    This is needed so people using the editor on wiki will not see
    }}|view]]<!--
unaligned code and try to correct it unnecessarily.
  -->&#93; <!--
    When you use SublimeText also you can reverse the steps before editing
  -->[[{{fullurl:{{#if: {{{1|}}}
to make life easier :)
  | {{{1}}}
--><div
  | {{FULLPAGENAME}}/doc
class="template-documentation"
  }}
style="clear:both; border:1px solid black; margin:1em;"
| action=edit
><div
}} edit]] <!--
    class="color1"
  -->[[{{fullurl:{{#if: {{{1|}}}
    style="padding:1em; margin:0;"
  | {{{1}}}
    ><b>Template documentation</b> <!--
  | {{FULLPAGENAME}}/doc
--><span
  }}
style="font-size:85%;"
| action=history
>(for the above template, sometimes partially or fully invisible)<!--
}} history]] <!--
--></span><!--
  -->[[{{fullurl:{{FULLPAGENAME}}
-->{{#if:
| action=purge
{{{content|}}}
}} refresh]]
    |
    | [[{{fullurl:{{#if: {{{1|}}}
    |   <span
  | {{{1}}}
    id="doc_editlinks"
  | {{FULLPAGENAME}}/doc
    class="editsection plainlinks"
  }}
    style="font-size:85%; float:right;"
| action=edit&preload=Template:Documentation/preload
    >{{#ifexist:
}} create]]
{{{1|{{FULLPAGENAME}}/doc}}}
    |   &#91;[[{{{1|{{FULLPAGENAME}}/doc}}}|view]]&#93; <!--
    -->&#91;[{{fullurl:   {{{1|{{FULLPAGENAME}}/doc}}}
      | action=edit
      }} edit]&#93; <!--
    -->&#91;[{{fullurl:   {{{1|{{FULLPAGENAME}}/doc}}}
      | action=history
      }} history]&#93; <!--
    -->&#91;[{{fullurl:   {{FULLPAGENAME}}
      | action=purge
      }} refresh]&#93;
    |   &#91;[{{fullurl:   {{{1|{{FULLPAGENAME}}/doc}}}
      | action=edit&preload=Template:Documentation/preload
      }} create]&#93;
    }}<!--
    --></span>
    }}<!--
    }}<!--
      --></span>
    --></div><!--
      }}<!--
    --><div
--></div><!--
    style="padding:1em; padding-bottom:0; margin:0;"
--><div style="padding: 1em; padding-bottom: 0; margin: 0;">
    >{{#if:
{{#if: {{{content|}}}
{{{content|}}}
| {{{content}}}
    |   {{{content}}}
| {{#ifexist: {{#if: {{{1|}}}
    |   {{#ifexist:
      | {{{1}}}
    {{{1|{{FULLPAGENAME}}/doc}}}
      | {{FULLPAGENAME}}/doc
|   {{tocright}}<!--
      }}
-->{{:{{{1|{{FULLPAGENAME}}/doc}}} }}
   | {{tocright}}
|   :<!--
{{:{{{1|{{FULLPAGENAME}}/doc}}} }}
--><strong
   | :<strong class="error">This template doesn't have any documentation yet!</strong> <!--
class="error"
    -->Help out by [{{fullurl:{{#if: {{{1|}}}
>This template doesn't have any documentation yet!<!--
      | {{{1}}}
--></strong> <!--
      | {{FULLPAGENAME}}/doc
-->Help out by [{{fullurl: {{{1|{{FULLPAGENAME}}/doc}}}
      }}
| action=edit&preload=Template:Documentation/preload
    | action=edit&preload=Template:Documentation/preload
}} writing some]. <!--
    }} writing some]. <!--
-->{{#ifeq:
    -->{{#ifeq: {{NAMESPACE}} | {{ns:10}}
{{NAMESPACE}} | {{ns:Template}}
      | There may also be documentation on [[w:c:templates:{{#if: {{{1|}}}
    |   There may also be documentation on <!--
    | {{{1}}}
-->[[w:c:templates:{{{1|{{FULLPAGENAME}}/doc}}}|Wikia Templates]] <!--
    | {{FULLPAGENAME}}/doc
-->which can be copied.
    }}|Wikia Templates]] which can be copied.
    }}{{#ifeq:
      }}{{
{{FULLPAGENAME}} | {{ns:Template}}:Documentation/preload
      #ifeq: {{FULLPAGENAME}} | {{ns:Template}}:Documentation/preload
    |
      |
    |   [[Category:Templates without documentation]]
      | [[Category:Templates without documentation]]
    }}
      }}
}}
  }}
    }}<!--
}}<!--
    --></div><!--
--></div><!--
    --><div
--><div class="color1" style="clear: both; padding: 0.5em; margin: 0; font-size: 85%; text-align: right;"><!--
    class="color1"
    -->{{#if: {{{content|}}}
    style="clear:both; padding:0.5em; margin:0; font-size:85%; text-align:right;"
      | '''[{{fullurl:{{FULLPAGENAME}}
    >{{#if:
    | action=edit
{{{content|}}}
    }} Edit this page]''' to change the above text. ('''[[Template:Documentation|What is this?]]''')
    |   <b><!--
      | {{#ifexist: {{#if: {{{1|}}}
-->[{{fullurl: {{FULLPAGENAME}}
    | {{{1}}}
    | action=edit
    | {{FULLPAGENAME}}/doc
    }} Edit this page]<!--
    }}
    --></b> to change the above text. <!--
| The above text is '''[[m:Transclusion|<span class="color1">transcluded</span>]]''' <!--
    -->(<!--
  -->from '''[[{{#if: {{{1|}}}
--><b><!--
| {{{1}}}
    -->[[Template:Documentation|What is this?]]<!--
| {{FULLPAGENAME}}/doc
--></b><!--
}}]]'''; <!--
    -->)
  -->you can '''[{{fullurl:{{#if: {{{1|}}}
    |   {{#ifexist:
    | {{{1}}}
    {{{1|{{FULLPAGENAME}}/doc}}}
    | {{FULLPAGENAME}}/doc
|   The above text is <!--
    }}
    --><b><!--
  | action=edit
-->[[m:Transclusion|<span
  }} change it]''' <!--
class="color1"
  -->or '''[{{fullurl:{{#if: {{{1|}}}
>transcluded<!--
      | {{{1}}}
--></span>]]<!--
      | {{FULLPAGENAME}}/doc
    --></b> <!--
      }}
-->from <b><!--
    | action=history
-->[[{{{1|{{FULLPAGENAME}}/doc}}}]]<!--
    }} view its history]'''. <!--
      --></b>; <!--
  -->('''[[Template:Documentation|How does this work?]]''')
-->you can <b><!--
| This template currently doesn't have any documentation; <!--
    -->[{{fullurl: {{{1|{{FULLPAGENAME}}/doc}}}
  -->you can '''[{{fullurl:{{#if: {{{1|}}}
| action=edit
    | {{{1}}}
}} change it]<!--
    | {{FULLPAGENAME}}/doc
--></b> <!--
    }}
-->or <b><!--
  | action=edit&preload=Template:Documentation/preload
      -->[{{fullurl:   {{{1|{{FULLPAGENAME}}/doc}}}
  }} create it]''' <!--
  | action=history
  -->if you know how the template is used. <!--
  }} view its history]<!--
  -->('''[[Template:Documentation|What is this?]]''')
    --></b>. <!--
}}
-->(<!--
      }}<br />If you're done making changes, <!--
    --><b><!--
-->please '''[{{fullurl:{{FULLPAGENAME}}
-->[[Template:Documentation|How does this work?]]<!--
      | action=purge
    --></b><!--
      }} refresh the text]'''. <!--
-->)
-->('''[[mw:Manual:Purge|Why?]]''')<br /><!--
|   This template currently doesn't have any documentation; <!--
-->you can <b><!--
    -->[{{fullurl: {{{1|{{FULLPAGENAME}}/doc}}}
| action=edit&preload=Template:Documentation/preload
}} create it]<!--
--></b> <!--
-->if you know how the template is used. <!--
-->(<!--
    --><b><!--
-->[[Template:Documentation|What is this?]]<!--
    --></b><!--
-->)
}}
    }}<br/><!--
-->If you're done making changes, please <!--
    --><b><!--
-->[{{fullurl: {{FULLPAGENAME}}
    | action=purge
    }} refresh the text]<!--
    --></b>. <!--
    -->(<!--
--><b><!--
    -->[[mw:Manual:Purge|Why?]]<!--
--></b><!--
    -->)<br/><!--
-->You can experiment in this template's <!--
-->You can experiment in this template's <!--
    -->{{#ifexist: {{#if: {{{sandbox|}}}
    -->{{#ifexist:
  | {{{sandbox}}}
    {{{sandbox|{{FULLPAGENAME}}/sandbox}}}
  | {{FULLPAGENAME}}/sandbox
|   <b><!--
  }}
    -->[[{{{sandbox|{{FULLPAGENAME}}/sandbox}}}|sandbox]]<!--
      | '''[[{{#if: {{{sandbox|}}}
--></b> <!--
      | {{{sandbox}}}
-->(<!--
      | {{FULLPAGENAME}}/sandbox
    --><b><!--
      }}|sandbox]]''' <!--
-->[{{fullurl: {{{sandbox|{{FULLPAGENAME}}/sandbox}}}
-->('''[{{fullurl:{{#if: {{{sandbox|}}}
    | action=edit
  | {{{sandbox}}}
    }} edit]<!--
  | {{FULLPAGENAME}}/sandbox
    --></b> <!--
  }}
    -->&#124; <!--
| action=edit
    --><b><!--
}} edit]''' <!--
-->[{{fullurl:  Special:ComparePages
-->&#124; <!--
    | page1={{FULLPAGENAMEE}}&page2={{urlencode:
-->'''[{{fullurl:Special:ComparePages
    {{{sandbox|{{FULLPAGENAME}}/sandbox}}}
| page1={{FULLPAGENAMEE}}&page2={{urlencode:{{#if: {{{sandbox|}}}
}}
    | {{{sandbox}}}
    }} diff]<!--
    | {{FULLPAGENAME}}/sandbox
    --></b><!--
    }}
-->)
}}
|   sandbox <!--
}} diff]'''<!--
-->(<!--
    --><b><!--
-->[{{fullurl: {{{sandbox|{{FULLPAGENAME}}/sandbox}}}
    | action=edit&preload=Template:Documentation/preload-sandbox
    }} create]<!--
    --></b> <!--
    -->&#124; <!--
    --><b><!--
-->[{{fullurl: {{{sandbox|{{FULLPAGENAME}}/sandbox}}}
    | action=edit&preload={{FULLPAGENAMEE}}&summary={{urlencode:
    Create sandbox version of [[{{FULLPAGENAME}}]]
}}
    }} mirror]<!--
    --></b><!--
-->)
}} <!--
    -->and <!--
    -->{{#ifexist:
    {{{testcases|{{FULLPAGENAME}}/testcases}}}
|   <b><!--
    -->[[{{{testcases|{{FULLPAGENAME}}/testcases}}}|testcases]]<!--
--></b> <!--
-->(<!--
    --><b><!--
-->[{{fullurl:  {{{testcases|{{FULLPAGENAME}}/testcases}}}
    | action=edit
    }} edit]<!--
    --></b><!--
-->)
-->)
      | sandbox ('''[{{fullurl:{{#if: {{{sandbox|}}}
|   testcases <!--
| {{{sandbox}}}
-->(<!--
| {{FULLPAGENAME}}/sandbox
    --><b><!--
}}
-->[{{fullurl: {{{testcases|{{FULLPAGENAME}}/testcases}}}
      | action=edit&preload=Template:Documentation/preload-sandbox
    | action=edit&preload=Template:Documentation/preload-testcases
      }} create]''' <!--
    }} create]<!--
-->&#124; <!--
    --></b><!--
-->'''[{{fullurl:{{#if: {{{sandbox|}}}
  | {{{sandbox}}}
  | {{FULLPAGENAME}}/sandbox
  }}
| action=edit&preload={{FULLPAGENAMEE}}&summary={{urlencode:Create sandbox version of [[{{FULLPAGENAME}}]]}}
}} mirror]''' <!--
-->)
-->)
      }} <!--
}} <!--
    -->and {{#ifexist: {{#if: {{{testcases|}}}
    -->pages.<br/><!--
      | {{{testcases}}}
-->{{#if:
      | {{FULLPAGENAME}}/testcases
{{{content|}}}
      }}
    |
  | '''[[{{#if: {{{testcases|}}}
    |   Please add <b><!--
  | {{{testcases}}}
    -->[[Help:Categories|categories]]<!--
  | {{FULLPAGENAME}}/testcases
--></b> <!--
  }}|testcases]]''' <!--
    -->and <b><!--
    -->('''[{{fullurl:{{#if: {{{testcases|}}}
    -->[[Help:Interwiki link|interwikis]]<!--
      | {{{testcases}}}
--></b> <!--
      | {{FULLPAGENAME}}/testcases
    -->to <b><!--
      }}
    -->{{#ifexist:
    | action=edit
    {{{1|{{FULLPAGENAME}}/doc}}}
    }} edit]''')
      |   [[{{{1|{{FULLPAGENAME}}/doc}}}]]
  | testcases ('''[{{fullurl:{{#if: {{{testcases|}}}
      |   [{{fullurl: {{{1|{{FULLPAGENAME}}/doc}}}
      | {{{testcases}}}
    | action=edit&preload=Template:Documentation/preload
      | {{FULLPAGENAME}}/testcases
    }} {{{1|{{FULLPAGENAME}}/doc}}}]
      }}
}}<!--
    | action=edit&preload=Template:Documentation/preload-testcases
--></b>.
    }} create]''')
    }} <!--
  }} <!--
-->(<!--
    -->pages.<!--
    --><b><!--
    -->{{#if: {{{content|}}}
-->[[Special:PrefixIndex/{{FULLPAGENAME}}/|View all subpages of this page]]<!--
      |
    --></b>.<!--
      | <br />Please add '''[[Help:Categories|categories]]''' and '''[[Help:Interwiki link|interwikis]]''' to <!--
-->)<!--
-->{{#ifexist: {{#if: {{{1|}}}
    --></div><!--
| {{{1}}}
--></div>
| {{FULLPAGENAME}}/doc
}}
    | '''[[{{#if: {{{1|}}}
  | {{{1}}}
  | {{FULLPAGENAME}}/doc
  }}]]'''
    | '''[{{fullurl:{{#if: {{{1|}}}
    | {{{1}}}
    | {{FULLPAGENAME}}/doc
    }}
  | action=edit&preload=Template:Documentation/preload
  }} {{#if: {{{1|}}}
    | {{{1}}}
    | {{FULLPAGENAME}}/doc
    }}]'''
    }}.
      }} <!--
    -->('''[[Special:PrefixIndex/{{FULLPAGENAME}}/|View all subpages of this page]]'''.)<!--
--></div>
</div>

Revision as of 09:43, 3 May 2016

Template documentation (for the above template, sometimes partially or fully invisible){{#if:

| | {{#ifexist: Documentation/doc | [view] [edit] [history] [refresh] | [create] }}

}}
{{#if:

| {{{content}}} | {{#ifexist: Documentation/doc | Template:Tocright==Description== This template is used to insert descriptions on template pages.

Syntax

Add <noinclude>Template:T</noinclude> at the end of the template page.

Add <noinclude>Template:T</noinclude> to transclude an alternative page from the /doc subpage.

Usage

On the Template page

This is the normal format when used:

TEMPLATE CODE
<includeonly>Any categories to be inserted into articles by the template</includeonly>
<noinclude>{{Documentation}}</noinclude>

If your template is not a completed div or table, you may need to close the tags just before {{Documentation}} is inserted (within the noinclude tags).

A line break right before {{Documentation}} can also be useful as it helps prevent the documentation template "running into" previous code.

On the documentation page

The documentation page is usually located on the /doc subpage for a template, but a different page can be specified with the first parameter of the template (see Syntax).

Normally, you will want to write something like the following on the documentation page:

==Description==
This template is used to do something.

==Syntax==
Type <code>{{t|templatename}}</code> somewhere.

==Samples==
<code><nowiki>{{templatename|input}}</nowiki></code> 

results in...

{{templatename|input}}

<includeonly>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 other sections.

Note that the above example also uses the Template:T template. |  :This template doesn't have any documentation yet! Help out by writing some. {{#ifeq: | Template | There may also be documentation on Wikia Templates which can be copied. }}{{#ifeq: Documentation | Template:Documentation/preload | | }} }}

}}
{{#if:

| Edit this page to change the above text. (What is this?) | {{#ifexist: Documentation/doc | The above text is transcluded from Documentation/doc; you can change it or view its history. (How does this work?) | This template currently doesn't have any documentation; you can create it if you know how the template is used. (What is this?) }} }}
If you're done making changes, please refresh the text. (Why?)
You can experiment in this template's {{#ifexist: Documentation/sandbox | sandbox (edit | diff) | sandbox (create | mirror) }} and {{#ifexist: Documentation/testcases | testcases (edit) | testcases (create) }} pages.
{{#if:

| | Please add categories and interwikis to {{#ifexist: Documentation/doc | Documentation/doc | Documentation/doc }}.

}} (View all subpages of this page.)