Doc/Template – Template
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Add 6..10 examples) |
Lou Montana (talk | contribs) m (Text replacement - "<tt>([^ =]+)<\/tt>" to "{{hl|$1}}") |
||
Line 114: | Line 114: | ||
{{#ifeq: {{uc:{{FULLPAGENAME}}}} | TEMPLATE:DOC/TEMPLATE | | [[Category: Templates|{{uc:{{PAGENAME}}}}]] }}</includeonly><noinclude>{{TOC|none}} | {{#ifeq: {{uc:{{FULLPAGENAME}}}} | TEMPLATE:DOC/TEMPLATE | | [[Category: Templates|{{uc:{{PAGENAME}}}}]] }}</includeonly><noinclude>{{TOC|none}} | ||
Documents and categorises a [[:Category:Templates|Template]]. To be used within | Documents and categorises a [[:Category:Templates|Template]]. To be used within {{hl|<no<nowiki/>include></no<nowiki/>include>}} tags, e.g: | ||
<include<nowiki/>only>'''*template's code*'''</include<nowiki/>only><no<nowiki/>include>{{<nowiki/>'''Doc/Template''' | <include<nowiki/>only>'''*template's code*'''</include<nowiki/>only><no<nowiki/>include>{{<nowiki/>'''Doc/Template''' | ||
| ... | | ... | ||
Line 122: | Line 122: | ||
== Usage == | == Usage == | ||
{{<nowiki/>Doc/Template|'''''name'''''|'''''descr'''''|'''''param''#'''|'''''descr''#'''|'''''example''#'''|'''''result''#'''}} | {{<nowiki/>Doc/Template|'''''name'''''|'''''descr'''''|'''''param''#'''|'''''descr''#'''|'''''example''#'''|'''''result''#'''}} | ||
* name: (Optional, default | * name: (Optional, default {{hl|{{<nowiki/>PAGENAME}}}}) template name | ||
* descr: template text description | * descr: template text description | ||
* param#: (# = number range 1..10) parameter name | * param#: (# = number range 1..10) parameter name | ||
* descr#: (# = number range 1..10) parameter description | * descr#: (# = number range 1..10) parameter description | ||
* example#: (# = number range 1..10) mediawiki code example - '''to be wrapped between nowiki tags!''' (e.g | * example#: (# = number range 1..10) mediawiki code example - '''to be wrapped between nowiki tags!''' (e.g {{hl|<nowiki><nowiki>{{Doc/Template}}</nowiki></nowiki>}}) | ||
* result#: (# = number range 1..10) mediawiki code result - identical to example#, less nowiki tags (e.g | * result#: (# = number range 1..10) mediawiki code result - identical to example#, less nowiki tags (e.g {{hl|<nowiki>{{Doc/Template}}</nowiki>}}) | ||
{| style="border-spacing: 1em 0.5em; min-width: 50em" | {| style="border-spacing: 1em 0.5em; min-width: 50em" | ||
Line 178: | Line 178: | ||
| descr2 = (Optional) this is the second parameter | | descr2 = (Optional) this is the second parameter | ||
| example1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki> | | example1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki> | ||
| result1 = | | result1 = {{hl|Hello there!}} | ||
}} | }} | ||
Revision as of 10:33, 16 November 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|param#|descr#|example#|result#}}
- name: (Optional, default {{PAGENAME}}) template name
- descr: template text description
- param#: (# = number range 1..10) parameter name
- descr#: (# = number range 1..10) parameter description
- example#: (# = number range 1..10) mediawiki code example - to be wrapped between nowiki tags! (e.g </nowiki>)
- result#: (# = number range 1..10) mediawiki code result - identical to example#, less nowiki tags (e.g {{Doc/Template}})
Code | Result | ||||
---|---|---|---|---|---|
{{Doc/Template}} |
This template is used on these pages. Usage{{Doc/Template}}
| ||||
{{Doc/Template | name = MyTemplate | descr = Template description | param1 = parameter1 | descr1 = this is the first parameter | param2 = parameter2 | descr2 = (Optional) this is the second parameter }} |
Template description
This template is used on these pages. Usage{{MyTemplate|parameter1|parameter2}}
| ||||
{{Doc/Template | name = MyTemplate | descr = Template description | param1 = parameter1 | descr1 = this is the first parameter | param2 = parameter2 | descr2 = (Optional) this is the second parameter | example1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki> | result1 = {{MyTemplate|Hello there!}} }} |
Template description
This template is used on these pages. Usage{{MyTemplate|parameter1|parameter2}}
|