Template:Docparam/doc

From MafiaWiki
Jump to: navigation, search

For use on template documentation pages. Adds header and category.

Based on {{directionbox}}.

Usage

Place the following at the top of the documentation page:

<noinclude>{{Documentationpage}}</noinclude>

Parameters

Optionalx14px
(default: "First part of {{PAGENAME}}")
{{#replace:{{#replace:{{#replace:{{#replace:<unnamed 1> // page|| }}| >> | up to }}| // | or }}| ++ |, }}

Name of the page the documentation page belongs to.

Optionalx14px
(default: "default")
{{#replace:{{#replace:{{#replace:{{#replace:type|| }}| >> | up to }}| // | or }}| ++ |, }}

Allows to specify the type of documentation page and alters display text accordingly.

Available options:

  • default: This page is a normal documentation page.
  • standard: This page is a standard documentation page for all templates based on a specific meta template.

Template for standardized formatting of template parameters in template documentation.

Usage

{{Docparam|name=parameter|req=yes|desc=description}}

Parameters

Requiredx14px
{{#replace:{{#replace:{{#replace:{{#replace:<unnamed 1> // name|| }}| >> | up to }}| // | or }}| ++ |, }}

Name of the parameter(s). Certain strings are automatically translated to allow for specification of alternative choices or parameter ranges.

Translated strings (all of these need to be enclosed by spaces):

  • >> is converted to a dash with spaces around it (" - "); used to indicate parameter ranges (e.g. "game1 - game5").
  • // is converted to " or "; used for alternative choices (e.g. "<unnamed 1> or title").
  • ++ is converted to a comma with a trailing space (", "); used for listing parameters which are separate but work the same (e.g. "contentA1, contentB1").
Optionalx14px
{{#replace:{{#replace:{{#replace:{{#replace:default ++ default2|| }}| >> | up to }}| // | or }}| ++ |, }}

The default value(s) of the parameter.

Requiredx14px
{{#replace:{{#replace:{{#replace:{{#replace:desc|| }}| >> | up to }}| // | or }}| ++ |, }}

Description of the parameter.

Sometimes required or at least one requiredx14px
(default: "yes")
{{#replace:{{#replace:{{#replace:{{#replace:req|| }}| >> | up to }}| // | or }}| ++ |, }}

Specifies whether this parameter is required for the template to function.

Available options:

  • no: Completely optional.
  • semi: Parameter is required in certain circumstances but optional in others. For a range of parameters (set via up to, this means that at least one of them is required.
  • yes: Always required.

Copy/paste

{{Docparam|name=|req=|default=|desc=

}}

Examples

Simple

{{Docparam|name=parameter|req=yes|default=|desc=
Description
}}

results in:

Requiredx14px
{{#replace:{{#replace:{{#replace:{{#replace:parameter|| }}| >> | up to }}| // | or }}| ++ |, }}

Description

Advanced

{{Docparam|name=parameter // alternative ++ similar1 >> similar3|req=no|default=default setting|desc=
Description
}}

results in:

Optionalx14px
(default: "default setting")
{{#replace:{{#replace:{{#replace:{{#replace:parameter // alternative ++ similar1 >> similar3|| }}| >> | up to }}| // | or }}| ++ |, }}

Description