Template:Doc/Template

From Bohemia Interactive Community
Revision as of 03:09, 5 January 2021 by Lou Montana (talk | contribs) (Fix example)
Jump to navigation Jump to search

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}})
Examples
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}}

  • argument1: this is the first argument
  • argument2: (Optional) this is the second argument


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

  • argument1: this is the first argument
  • argument2: (Optional) this is the second argument
Examples
Code Result
{{MyTemplate|Hello there!}} Hello there!