Template:Documentation: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly><div class="documentation"> | <includeonly><div class="documentation"> | ||
<div class=" | <div class="header">'''Instructions''' <span style="font-size:85%;">for {{tlx|{{PAGENAME}}}}</span></div> | ||
<div class="description">{{{{PAGENAME}}/doc}}</div> | <div class="description">{{{{PAGENAME}}/doc}}</div> | ||
<div class="footer">Visit [[Template:{{PAGENAME}}/doc|the documentation page]] to edit this text! ([[Template:Documentation|How does this work]]?)</div></div></includeonly><noinclude>{{documentation}}[[Category:Templates|{{PAGENAME}}]]</noinclude> | <div class="footer">Visit [[Template:{{PAGENAME}}/doc|the documentation page]] to edit this text! ([[Template:Documentation|How does this work]]?)</div></div></includeonly><noinclude>{{documentation}}[[Category:Templates|{{PAGENAME}}]]</noinclude> |
Latest revision as of 04:28, 11 October 2018
- Description
- This template is used to insert descriptions on template pages.
- Syntax
- Type
<noinclude>Template:T</noinclude>
at the end of the template page.
General usage[[edit source]]
On the Template page[[edit source]]
Template code<includeonly>Any categories to be inserted into articles by the template</includeonly><noinclude> {{documentation}}</noinclude>
Note that, depending on the template, you may need to add a clear or complete a table/div just before {{documentation}}
is inserted (within the noinclude tags).
The line break is also useful as it helps prevent the documentation template "running into" previous code.
Alternately, you may find it better to consistently put {{documentation}} at the very end of your template, immediately next to the category in which the template is to be placed. Thus:
;<includeonly>template code ;more template code ;more template code ;more template code</includeonly> ;<noinclude>{{documentation}}[[Category:Templates]]</noinclude>
If your template is producing a few blank lines at the top, {{documentation}} is a likely cause. The above solution will remove those lines.
On the Template/doc page[[edit source]]
;Description :This template is used to do something. ;Syntax :Type <code>{{tlx|templatename}}</code> somewhere. ;Sample output :<code><nowiki>{{templatename|foo}}</nowiki></code> gives... :{{templatename|foo}}
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.