Doc/Template – Template
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Template creation) |
Lou Montana (talk | contribs) m (Fix example) |
||
Line 86: | Line 86: | ||
}} | }} | ||
</includeonly><noinclude>{{TOC|none}} | </includeonly><noinclude>{{TOC|none}} | ||
Documents and categorises a [[:Category:Templates|Template]]. | Documents and categorises a [[:Category:Templates|Template]]. To be used within <tt><no<nowiki/>include></no<nowiki/>include></tt> tags, e.g: | ||
<include<nowiki/>only>'''*template's code*'''</include<nowiki/>only><no<nowiki/>include>{{<nowiki/>'''Doc/Template''' | |||
| ... | |||
}} | |||
</no<nowiki/>include> | |||
== Usage == | == Usage == | ||
Line 133: | Line 137: | ||
| arg2 = argument2 | | arg2 = argument2 | ||
| descr2 = (Optional) this is the second argument | | descr2 = (Optional) this is the second argument | ||
| example1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki> | | example1 = <nowiki><nowiki>{{MyTemplate|Hello there!}}</nowiki></nowiki> | ||
| result1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki> | | result1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki> | ||
}}</pre> | }}</pre> |
Revision as of 02:09, 5 January 2021
Documents and categorises a Template. To be used within <noinclude></noinclude> tags, e.g:
<includeonly>*template's code*</includeonly><noinclude>{{Doc/Template | ... }} </noinclude>
Usage
{{Doc/Template|name|descr|arg#|descr#|example#|result#}}
- name: (Optional, default {{PAGENAME}}) template name
- descr: template text description
- arg#: (# = number range 1..10) argument name
- descr#: (# = number range 1..10) argument description
- example#: (# = number range 1..5) mediawiki code example - to be wrapped between nowiki tags! (e.g <nowiki>{{Doc/Template}}</nowiki>)
- result#: (# = number range 1..5) mediawiki code result - identical to example#, less nowiki tags (e.g {{Doc/Template}})
Code | Result | ||||
---|---|---|---|---|---|
{{Doc/Template}} |
Usage{{Doc/Template}} | ||||
{{Doc/Template | name = MyTemplate | descr = Template description | arg1 = argument1 | descr1 = this is the first argument | arg2 = argument2 | descr2 = (Optional) this is the second argument }} |
Template description
Usage{{MyTemplate|argument1|argument2}}
| ||||
{{Doc/Template | name = MyTemplate | descr = Template description | arg1 = argument1 | descr1 = this is the first argument | arg2 = argument2 | descr2 = (Optional) this is the second argument | example1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki> | result1 = {{MyTemplate|Hello there!}} }} |
Template description
Usage{{MyTemplate|argument1|argument2}}
|