Template:Documentation: Difference between revisions
Jump to navigation
Jump to search
(not every template with documentation should go in Category:Template documentation; beautify code) |
m (1 revision imported: Template:Quote from mediawiki. May not work) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
< | <includeonly><div style="border: 1px solid black; margin: 3em 1em 1em;"><div style="background: Tan; color: Black; padding: 1em; margin: 0;">'''Template documentation''' <span style="font-size: 85%;">(for the above template, sometimes hidden or invisible)</span></div><div style="padding: 1em 1em 0; margin: 0;">{{tocright}} | ||
< | {{#if: {{{namespace|}}}|{{:{{{namespace}}}:{{PAGENAME}}/doc}}|{{{{PAGENAME}}/doc}} }} | ||
</div><br style="clear: both;"/><div style="background: Tan; color: Black; padding: 0.5em; margin: 0em; font-size: 85%; text-align: right;">Visit [[{{#if: {{{namespace|}}}|{{{namespace}}}|Template}}:{{PAGENAME}}/doc]] to edit this text! ([[Template:Documentation|How does this work]]?)</div></div></includeonly><noinclude> | |||
{{Documentation}} | |||
}} | [[Category:Template documentation| ]] | ||
{{ | </noinclude> | ||
{{ | |||
[[Category:Template documentation |
Latest revision as of 12:10, 25 September 2019
Template documentation (for the above template, sometimes hidden or invisible)
- Description
- This template is used to insert descriptions on template pages.
- Syntax
- Type
<noinclude>{{documentation}}</noinclude>
at the end of the template page.
General usage
On the Template page
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.
On the Template/doc page
;Description :This template is used to do something. ;Syntax :Type <code>{{t|templatename}}</code> somewhere. ;Sample output :<code><nowiki>{{templatename|foo}}</nowiki></code> gives... :{{templatename|foo}} <includeonly>Any categories for the template itself</includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>
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.
Note that the above example also uses the Template:T and Template:T/piece templates.
Visit Template:Documentation/doc to edit this text! (How does this work?)