Module:Delimited template list/doc
More actions
This is the documentation page for Module:Delimited template list
This module expands each non-empty item in a comma-separated list through a template. Whitespace surrounding each item is removed.
The separator between expanded templates is taken from MediaWiki:Comma-separator in the wiki's content language. Local message overrides are respected.
Usage
edit{{#invoke:Delimited template list|main
|ex=a,b
|template=Code
|prefix=font=
|suffix=
|leading=,
}}
This produces the equivalent of:
,{{code|font{{=}}a}}{{int:comma-separator}}{{code|font{{=}}b}}
Invocation from another template
editWhen ex is not passed directly to the module, it is read from the arguments of the template containing the invocation. This allows the module to be placed inline between other template output:
{{Previous template}}{{#invoke:Delimited template list|main
|template=Code
|prefix=font=
|leading=
}}{{Next template}}
If the containing template is called as {{Example|ex=a,b}}, the module uses that value automatically.
Parameters
editex- Comma-separated input. If omitted, the value is read from the parent template. Empty items are ignored.
template- Template expanded once for each item. The default is Template:Code.
prefix- Text prepended to every item before it is passed as the template's first unnamed argument. The default is empty.
suffix- Text appended to every item before it is passed as the template's first unnamed argument. The default is empty.
leading- Text placed before the first expanded template. The default is a comma without a following space. Pass an empty value to suppress it.
Limitations
editThe comma is always treated as a separator and cannot be escaped. Consequently, individual values cannot contain commas.