Nelson6e65 (talk | contribs) (add: Optional "Params" argument (intended for parameters description). It should not break current use.) |
Nelson6e65 (talk | contribs) (improve styles) |
||
Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
[[File:50px-Template-info.png]] | <div style="padding-bottom:3px;border-bottom:1px solid #aaa;margin-bottom:1ex"><span style="font-weight:bold;font-size:150%">[[File:50px-Template-info.png]] Template documentation</span></div> | ||
{{{Description|Description about when to use the template.}}} | {{{Description|Description about when to use the template.}}} | ||
===Usage=== | |||
{{{Usage|Copy the following code into your page:}}} | |||
<dl style="display:inline-block; padding-left:.75em; margin-left:0;"> | <dl style="display:inline-block; padding-left:.75em; margin-left:0;"> | ||
Line 11: | Line 11: | ||
</dl> | </dl> | ||
{{#if:{{{Params|}}}| | {{#if:{{{Params|o}}} | ||
|===Parameters=== | |||
{{{Params}}} | |||
}} | |||
</includeonly> | </includeonly> | ||
<noinclude> | <noinclude>{{:Template:{{PAGENAME}}/doc}} <!-- this is to include documentation in this page, without transcluding it in the page where template is used --> | ||
{{:Template:{{PAGENAME}}/doc}} <!-- this is to include documentation in this page, without transcluding it in the page where template is used --> | |||
[[Category:General Template]] <!-- this is to categorize the template. It will not be transcluded in the page where template is used --> | [[Category:General Template]] <!-- this is to categorize the template. It will not be transcluded in the page where template is used --> | ||
</noinclude> | </noinclude> |
Revision as of 07:15, 19 October 2015
Use this template in order to create documentation for any template.
Usage
Copy the following code into your template doc page and fill the values:
-
{{Documentation
|Description =
|Usage =
|Code = TemplateName {{!}}arg1=arg1value {{!}}arg2=
|Params = {{Parameter|arg1|Arg1 description}}
{{Parameter|arg2|Arg2 description|Default = "Default value of arg2"}}
|Translatable= No
}}
Parameters
|- style="vertical-align:top;"
| style="text-align:right;" | Description
:
| Optional. Description about what does the template and when to use it. If empty, it will be used a generic text with the template link (generated dynamically).
Default value: "Documentation for the Documentation template."
|- style="vertical-align:top;"
| style="text-align:right;" | Usage
:
| Optional. Instructions about how and where to use the template.
Default value: "Copy the following code into your page:"
|- style="vertical-align:top;"
| style="text-align:right;" | Code
:
| Required. Template sample code, starting with its NAME.
If the template uses args, add default values separated with "{{!}}
" between each one (inline form). If there is to many args, you should use the nowiki tag for multiline. Do not add the starting/ending braces. You should fill the params values with useful content that makes easy the edition
.
|- style="vertical-align:top;"
| style="text-align:right;" | Params
:
| Optional. Parameters description list. The {{Parameter}}
template must to be used in order to describe each parameter.
Default value: null
|- style="vertical-align:top;"
| style="text-align:right;" | Translatable
:
| Optional. Mark documentation as translatable. Displays a menu containing shortcuts links to translated documentation (similar to {{I18n}}
) if is set to "Yes" (case insensitive). Any other value, will be ignored.
Default value: "no"
Remember, also, categorize it under Category:Template documentation by adding this at the end:
-
<noinclude>[[Category:Template documentation]]</noinclude>