Documentation: Difference between revisions
/>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; -*- | ||
NOTE: | |||
PLEASE keep the indentations intact ! | |||
The above emacs Modeline will preset most intelligent editors | |||
with correct setting. If your editor doesn't understand | |||
'mode:MediawikiNG;' then use 'mode:PHP;' | |||
Please keep this and oter HTML-comment it does not negatively impact | |||
any of the functioning of the template but improves readability | |||
that is crucial in maintainability by other editors. | |||
TODO: | |||
I used SublimeText with tab-size set to 4 then just | |||
before saving to wiki i did "Convert Indentation to Spaces" | |||
then changed tab-size set to 8 and did "Convert Indentation to Tabs". | |||
After those 2 steps i commited to wiki. | |||
This is needed so people using the editor on wiki will not see | |||
unaligned code and try to correct it unnecessarily. | |||
When you use SublimeText also you can reverse the steps before editing | |||
to make life easier :) | |||
--><div | |||
class="template-documentation" | |||
style="clear:both; border:1px solid black; margin:1em;" | |||
><div | |||
class="color1" | |||
style="padding:1em; margin:0;" | |||
><b>Template documentation</b> <!-- | |||
--><span | |||
style="font-size:85%;" | |||
>(for the above template, sometimes partially or fully invisible)<!-- | |||
--></span><!-- | |||
-->{{#if: | |||
{{{content|}}} | |||
| | |||
| <span | |||
id="doc_editlinks" | |||
class="editsection plainlinks" | |||
style="font-size:85%; float:right;" | |||
>{{#ifexist: | |||
{{{1|{{FULLPAGENAME}}/doc}}} | |||
| [[[{{{1|{{FULLPAGENAME}}/doc}}}|view]]] <!-- | |||
-->[[{{fullurl: {{{1|{{FULLPAGENAME}}/doc}}} | |||
| action=edit | |||
}} edit]] <!-- | |||
-->[[{{fullurl: {{{1|{{FULLPAGENAME}}/doc}}} | |||
| action=history | |||
}} history]] <!-- | |||
-->[[{{fullurl: {{FULLPAGENAME}} | |||
| action=purge | |||
}} refresh]] | |||
| [[{{fullurl: {{{1|{{FULLPAGENAME}}/doc}}} | |||
| action=edit&preload=Template:Documentation/preload | |||
}} create]] | |||
}}<!-- | |||
--></span> | |||
}}<!-- | }}<!-- | ||
--></div><!-- | |||
--><div | |||
-->< | style="padding:1em; padding-bottom:0; margin:0;" | ||
>{{#if: | |||
{{#if: {{{content|}}} | {{{content|}}} | ||
| {{{content}}} | | {{{content}}} | ||
| {{#ifexist: | | {{#ifexist: | ||
{{{1|{{FULLPAGENAME}}/doc}}} | |||
| {{tocright}}<!-- | |||
-->{{:{{{1|{{FULLPAGENAME}}/doc}}} }} | |||
| :<!-- | |||
{{:{{{1|{{FULLPAGENAME}}/doc}}} }} | --><strong | ||
class="error" | |||
>This template doesn't have any documentation yet!<!-- | |||
--></strong> <!-- | |||
-->Help out by [{{fullurl: {{{1|{{FULLPAGENAME}}/doc}}} | |||
| action=edit&preload=Template:Documentation/preload | |||
}} writing some]. <!-- | |||
-->{{#ifeq: | |||
{{NAMESPACE}} | {{ns:Template}} | |||
| There may also be documentation on <!-- | |||
-->[[w:c:templates:{{{1|{{FULLPAGENAME}}/doc}}}|Wikia Templates]] <!-- | |||
-->which can be copied. | |||
}}{{#ifeq: | |||
{{FULLPAGENAME}} | {{ns:Template}}:Documentation/preload | |||
| | |||
| [[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" | ||
style="clear:both; padding:0.5em; margin:0; font-size:85%; text-align:right;" | |||
>{{#if: | |||
{{{content|}}} | |||
| <b><!-- | |||
-->[{{fullurl: {{FULLPAGENAME}} | |||
| action=edit | |||
}} Edit this page]<!-- | |||
--></b> to change the above text. <!-- | |||
-->(<!-- | |||
--><b><!-- | |||
-->[[Template:Documentation|What is this?]]<!-- | |||
--></b><!-- | |||
-->) | |||
| {{#ifexist: | |||
{{{1|{{FULLPAGENAME}}/doc}}} | |||
| The above text is <!-- | |||
--><b><!-- | |||
-->[[m:Transclusion|<span | |||
class="color1" | |||
>transcluded<!-- | |||
--></span>]]<!-- | |||
--></b> <!-- | |||
-->from <b><!-- | |||
-->[[{{{1|{{FULLPAGENAME}}/doc}}}]]<!-- | |||
--></b>; <!-- | |||
-->you can <b><!-- | |||
-->[{{fullurl: {{{1|{{FULLPAGENAME}}/doc}}} | |||
| action=edit | |||
}} change it]<!-- | |||
--></b> <!-- | |||
-->or <b><!-- | |||
-->[{{fullurl: {{{1|{{FULLPAGENAME}}/doc}}} | |||
| action=history | |||
}} view its history]<!-- | |||
--></b>. <!-- | |||
-->(<!-- | |||
--><b><!-- | |||
-->[[Template:Documentation|How does this work?]]<!-- | |||
--></b><!-- | |||
-->) | |||
| 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: | |||
{{{sandbox|{{FULLPAGENAME}}/sandbox}}} | |||
| <b><!-- | |||
-->[[{{{sandbox|{{FULLPAGENAME}}/sandbox}}}|sandbox]]<!-- | |||
--></b> <!-- | |||
-->(<!-- | |||
--><b><!-- | |||
-->[{{fullurl: {{{sandbox|{{FULLPAGENAME}}/sandbox}}} | |||
-->( | | action=edit | ||
}} edit]<!-- | |||
--></b> <!-- | |||
-->| <!-- | |||
--><b><!-- | |||
-->[{{fullurl: Special:ComparePages | |||
| page1={{FULLPAGENAMEE}}&page2={{urlencode: | |||
{{{sandbox|{{FULLPAGENAME}}/sandbox}}} | |||
}} | |||
}} diff]<!-- | |||
--></b><!-- | |||
-->) | |||
| sandbox <!-- | |||
-->(<!-- | |||
--><b><!-- | |||
-->[{{fullurl: {{{sandbox|{{FULLPAGENAME}}/sandbox}}} | |||
| action=edit&preload=Template:Documentation/preload-sandbox | |||
}} create]<!-- | |||
--></b> <!-- | |||
-->| <!-- | |||
--><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><!-- | |||
-->) | -->) | ||
| testcases <!-- | |||
-->(<!-- | |||
--><b><!-- | |||
-->[{{fullurl: {{{testcases|{{FULLPAGENAME}}/testcases}}} | |||
| action=edit&preload=Template:Documentation/preload-testcases | |||
}} create]<!-- | |||
--></b><!-- | |||
-->) | -->) | ||
}} <!-- | |||
-->pages.<br/><!-- | |||
-->{{#if: | |||
{{{content|}}} | |||
| | |||
| Please add <b><!-- | |||
-->[[Help:Categories|categories]]<!-- | |||
--></b> <!-- | |||
-->and <b><!-- | |||
-->[[Help:Interwiki link|interwikis]]<!-- | |||
--></b> <!-- | |||
-->to <b><!-- | |||
-->{{#ifexist: | |||
{{{1|{{FULLPAGENAME}}/doc}}} | |||
| [[{{{1|{{FULLPAGENAME}}/doc}}}]] | |||
| [{{fullurl: {{{1|{{FULLPAGENAME}}/doc}}} | |||
| action=edit&preload=Template:Documentation/preload | |||
}} {{{1|{{FULLPAGENAME}}/doc}}}] | |||
}}<!-- | |||
--></b>. | |||
}} <!-- | |||
-->(<!-- | |||
--><b><!-- | |||
-->[[Special:PrefixIndex/{{FULLPAGENAME}}/|View all subpages of this page]]<!-- | |||
--></b>.<!-- | |||
-->)<!-- | |||
--></div><!-- | |||
--></div> | |||
--></div> | |||
</div> |
Revision as of 09:43, 3 May 2016
| | {{#ifexist: Documentation/doc | [view] [edit] [history] [refresh] | [create] }}
}}| {{{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 | | }} }}
}} | 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.)