Module:Sandbox/BrandonXLF/Module:Map params/doc
Appearance
![]() | This is a documentation subpage for Module:Sandbox/BrandonXLF/Module:Map params. It may contain usage information, categories and other content that is not part of the original module page. |
![]() | This module depends on the following other modules: |
{{#invoke:Map params|map}}
maps parameters received by a function to wikitext using |1=
or to a template call using |call=
.
Usage
{{#invoke:Map params|main|parameters}}
Parameters
Input
|prefixn=
- The prefix of the parameters to process. All registered prefixes will be checked to determine if a number is present in the provided arguments.|prefix1=
defaults to processing unnamed parameters.|extran=
- An extra parameter to pass to the wikitext or template being called. If the extra parameter is suffixed with a number (same as prefixed parameters but not checked to determine if a number is present), add the suffix(i)
. For example,style(i)
.|sparse=
- Set toyes
to support parameter lists with gaps. Defaults tono
.|optnum=
- Whether or not to support passing the first parameter without a number, i.e. allow it to be|prefix=
rather than|prefix1=
. Defaults toyes
.
Map to
|1=
- The wikitext to map parameters to. Parameters are substituted with their number removed, i.e.|itemn=
becomes|item=
etc. The parameter{{{i}}}
is replaced with the current index.|call=
- Template to call. Parameters are passed with their number removed, i.e.|itemn=
becomes|item=
etc. The parameter{{{i}}}
is the current index. Overrides|1=
.
Concatenation
|sep=
- Separator to add between outputs. Outer spaces can be added with{{sp}}
or 
.|conj=
- Special separator to use before the final output.
Advanced
|expand=
- Whether or not to expand templates, parser functions, extension tags, etc. after substituting parameters. This is most useful when|1=
is used without<nowiki>...</nowiki>
tags and can provide a slight performance advantage. Only relevant when using|1=
. Defaults toyes
.
See also
Tests
Basic
{{{@}}}{{{@}}}{{{@}}}
Separator
{{{@}}} + {{{@}}} + {{{@}}}
Conjunction
{{{@}}} + {{{@}}} = {{{@}}}
Start
3 = {{{@}}}, 4 = {{{@}}}, 5 = {{{@}}}
Extra
{{{@}}}i + {{{@}}}i + {{{@}}}i
Sparse
1 = {{{@}}}, 2 = {{{@}}}, 3 = {{{@}}}, 4 = {{{@}}}, 1000 = {{{@}}}
Sparse and start
3 = {{{@}}}, 4 = {{{@}}}, 1000 = {{{@}}}
Prefix
A + B + C
No first number
A + B + C
First number required
Sparse prefix
A + B + C
Sparse no first number
A + B + C
Sparse first number required
B + C
Multiple prefixes
3 (HDR3) = ITM3, 4 = ITM4, 5 (HDR5) = No item, 100 = ITM100
Prefix extra
1 = ITM1, 2 (HDR1) = ITM2
No expand with nowiki
{{2x|{{{@}}}}}{{2x|{{{@}}}}}{{2x|{{{@}}}}}
No expand without nowiki
{{{@}}}{{{@}}}{{{@}}}{{{@}}}{{{@}}}{{{@}}}
Call
AABBCC