Doc/Template – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix example)
m (argument → parameter)
Line 3: Line 3:
== Usage ==
== Usage ==
{{<nowiki/>{{{name|{{PAGENAME}}}}}<!--
{{<nowiki/>{{{name|{{PAGENAME}}}}}<!--
-->{{#if:{{{arg1|}}} | {{!}}'''''{{{arg1}}}'''''}}<!--
-->{{#if:{{{param1|}}} | {{!}}'''''{{{param1}}}'''''}}<!--
-->{{#if:{{{arg2|}}} | {{!}}'''''{{{arg2}}}'''''}}<!--
-->{{#if:{{{param2|}}} | {{!}}'''''{{{param2}}}'''''}}<!--
-->{{#if:{{{arg3|}}} | {{!}}'''''{{{arg3}}}'''''}}<!--
-->{{#if:{{{param3|}}} | {{!}}'''''{{{param3}}}'''''}}<!--
-->{{#if:{{{arg4|}}} | {{!}}'''''{{{arg4}}}'''''}}<!--
-->{{#if:{{{param4|}}} | {{!}}'''''{{{param4}}}'''''}}<!--
-->{{#if:{{{arg5|}}} | {{!}}'''''{{{arg5}}}'''''}}<!--
-->{{#if:{{{param5|}}} | {{!}}'''''{{{param5}}}'''''}}<!--
--><nowiki>}}</nowiki>
--><nowiki>}}</nowiki>
{{#if:{{{arg1|}}}|
{{#if:{{{param1|}}}|
* {{{arg1}}}{{#if:{{{descr1|}}}|<nowiki/>: {{{descr1|}}}}}
* {{{param1}}}{{#if:{{{descr1|}}}|<nowiki/>: {{{descr1|}}}}}
}}<!--
}}<!--
-->{{#if:{{{arg2|}}}|
-->{{#if:{{{param2|}}}|
* {{{arg2}}}{{#if:{{{descr2|}}}|<nowiki/>: {{{descr2|}}}}}
* {{{param2}}}{{#if:{{{descr2|}}}|<nowiki/>: {{{descr2|}}}}}
}}<!--
}}<!--
-->{{#if:{{{arg3|}}}|
-->{{#if:{{{param3|}}}|
* {{{arg3}}}{{#if:{{{descr3|}}}|<nowiki/>: {{{descr3|}}}}}
* {{{param3}}}{{#if:{{{descr3|}}}|<nowiki/>: {{{descr3|}}}}}
}}<!--
}}<!--
-->{{#if:{{{arg4|}}}|
-->{{#if:{{{param4|}}}|
* {{{arg4}}}{{#if:{{{descr4|}}}|<nowiki/>: {{{descr4|}}}}}
* {{{param4}}}{{#if:{{{descr4|}}}|<nowiki/>: {{{descr4|}}}}}
}}<!--
}}<!--
-->{{#if:{{{arg5|}}}|
-->{{#if:{{{param5|}}}|
* {{{arg5}}}{{#if:{{{descr5|}}}|<nowiki/>: {{{descr5|}}}}}
* {{{param5}}}{{#if:{{{descr5|}}}|<nowiki/>: {{{descr5|}}}}}
}}<!--
}}<!--
-->{{#if:{{{arg6|}}}|
-->{{#if:{{{param6|}}}|
* {{{arg6}}}{{#if:{{{descr6|}}}|<nowiki/>: {{{descr6|}}}}}
* {{{param6}}}{{#if:{{{descr6|}}}|<nowiki/>: {{{descr6|}}}}}
}}<!--
}}<!--
-->{{#if:{{{arg7|}}}|
-->{{#if:{{{param7|}}}|
* {{{arg7}}}{{#if:{{{descr7|}}}|<nowiki/>: {{{descr7|}}}}}
* {{{param7}}}{{#if:{{{descr7|}}}|<nowiki/>: {{{descr7|}}}}}
}}<!--
}}<!--
-->{{#if:{{{arg8|}}}|
-->{{#if:{{{param8|}}}|
* {{{arg8}}}{{#if:{{{descr8|}}}|<nowiki/>: {{{descr8|}}}}}
* {{{param8}}}{{#if:{{{descr8|}}}|<nowiki/>: {{{descr8|}}}}}
}}<!--
}}<!--
-->{{#if:{{{arg9|}}}|
-->{{#if:{{{param9|}}}|
* {{{arg9}}}{{#if:{{{descr9|}}}|<nowiki/>: {{{descr9|}}}}}
* {{{param9}}}{{#if:{{{descr9|}}}|<nowiki/>: {{{descr9|}}}}}
}}<!--
}}<!--
-->{{#if:{{{arg10|}}}|
-->{{#if:{{{param10|}}}|
* {{{arg10}}}{{#if:{{{descr10|}}}|<nowiki/>: {{{descr10|}}}}}
* {{{param10}}}{{#if:{{{descr10|}}}|<nowiki/>: {{{descr10|}}}}}
}}
}}


Line 93: Line 93:


== Usage ==
== Usage ==
{{<nowiki/>Doc/Template|'''''name'''''|'''''descr'''''|'''''arg''#'''|'''''descr''#'''|'''''example''#'''|'''''result''#'''}}
{{<nowiki/>Doc/Template|'''''name'''''|'''''descr'''''|'''''param''#'''|'''''descr''#'''|'''''example''#'''|'''''result''#'''}}
* name: (Optional, default <tt>{{<nowiki/>PAGENAME}}</tt>) template name
* name: (Optional, default <tt>{{<nowiki/>PAGENAME}}</tt>) template name
* descr: template text description
* descr: template text description
* arg#: (# = number range 1..10) argument name
* param#: (# = number range 1..10) parameter name
* descr#: (# = number range 1..10) argument description
* descr#: (# = number range 1..10) parameter description
* example#: (# = number range 1..5) mediawiki code example - '''to be wrapped between nowiki tags!''' (e.g <tt><nowiki><nowiki>{{Doc/Template}}</nowiki></nowiki></tt>)
* example#: (# = number range 1..5) mediawiki code example - '''to be wrapped between nowiki tags!''' (e.g <tt><nowiki><nowiki>{{Doc/Template}}</nowiki></nowiki></tt>)
* result#: (# = number range 1..5) mediawiki code result - identical to example#, less nowiki tags (e.g <tt><nowiki>{{Doc/Template}}</nowiki></tt>)
* result#: (# = number range 1..5) mediawiki code result - identical to example#, less nowiki tags (e.g <tt><nowiki>{{Doc/Template}}</nowiki></tt>)
Line 113: Line 113:
| name = MyTemplate
| name = MyTemplate
| descr = Template description
| descr = Template description
| arg1 = argument1
| param1 = parameter1
| descr1 = this is the first argument
| descr1 = this is the first parameter
| arg2 = argument2
| param2 = parameter2
| descr2 = (Optional) this is the second argument
| descr2 = (Optional) this is the second parameter
}}</pre>
}}</pre>


Line 122: Line 122:
| name = MyTemplate
| name = MyTemplate
| descr = Template description
| descr = Template description
| arg1 = argument1
| param1 = parameter1
| descr1 = this is the first argument
| descr1 = this is the first parameter
| arg2 = argument2
| param2 = parameter2
| descr2 = (Optional) this is the second argument
| descr2 = (Optional) this is the second parameter
}}
}}


Line 133: Line 133:
| name = MyTemplate
| name = MyTemplate
| descr = Template description
| descr = Template description
| arg1 = argument1
| param1 = parameter1
| descr1 = this is the first argument
| descr1 = this is the first parameter
| arg2 = argument2
| param2 = parameter2
| descr2 = (Optional) this is the second argument
| descr2 = (Optional) this is the second parameter
| example1 = <nowiki><nowiki>{{MyTemplate|Hello there!}}</nowiki></nowiki>
| example1 = <nowiki><nowiki>{{MyTemplate|Hello there!}}</nowiki></nowiki>
| result1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki>
| result1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki>
Line 144: Line 144:
| name = MyTemplate
| name = MyTemplate
| descr = Template description
| descr = Template description
| arg1 = argument1
| param1 = parameter1
| descr1 = this is the first argument
| descr1 = this is the first parameter
| arg2 = argument2
| param2 = parameter2
| descr2 = (Optional) this is the second argument
| descr2 = (Optional) this is the second parameter
| example1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki>
| example1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki>
| result1 = <tt>Hello there!</tt>
| result1 = <tt>Hello there!</tt>

Revision as of 00:56, 13 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|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..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}})
Examples
Code Result
{{Doc/Template}}

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

Usage

{{MyTemplate|parameter1|parameter2}}

  • parameter1: this is the first parameter
  • parameter2: (Optional) this is the second parameter


{{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

Usage

{{MyTemplate|parameter1|parameter2}}

  • parameter1: this is the first parameter
  • parameter2: (Optional) this is the second parameter
Examples
Code Result
{{MyTemplate|Hello there!}} Hello there!