Template:Comma

From Terraria Wiki
Jump to navigation Jump to search
This template is i18n-ready, which means it is easy to localize for different languages. Please see I18n & l10n for templates to learn more.
See Template:Comma/l10n for the localization of this template.
Template-info.svg Documentation The documentation below is transcluded from Template:Comma/doc. (edit | history)

Separate items with commas. It uses the "Oxford Comma" way(for English).

Usage

{{comma|or=y|<item>|<item>|...||<item>}}

or

If set, it will use "or" as the separator between last 2 items. By default it will use "and".

all numbered parameters

List items. Empty parameter(s) will be ignored.

sep1, sep2, sep3

Override default separators. default seprators are ,, and / or (for 2 items), , and /, or (for 3 or more items)

-OR-

{{comma/start|or=y}}{{comma/item|<item>}}{{comma/item|<item>}}{{comma/item|<item>}}{{comma/item|<item>}}{{comma/end|}}

By this way, you can handle a variable number of items(usually used in templates). See {{Distinguish}} for example.

Examples

Code Output
{{comma|A}} A
{{comma|A|B}} A and B
{{comma|A|B|C}} A, B, and C
{{comma|A|B|C|D}} A, B, C, and D
{{comma|A||C|D}} A, C, and D
{{comma|A||C|||||H}} A, C, and H
{{comma|or=y|A}} A
{{comma|or=y|A|B}} A or B
{{comma|or=y|A|B|C}} A, B, or C
{{comma|or=y|A|B|C|D}} A, B, C, or D
{{comma|A|B|C|D|sep1=×|sep3=×...×}} A×B×C×...×D
{{comma|or=y|A|B|C|D|sep1=×|sep3=×...×}} A×B×C×...×D
{{comma/start}}{{comma/item|A}}{{comma/item|B}}{{comma/end}} A and B
{{comma/start}}{{comma/item|A}}{{comma/item|B}}{{comma/item|C}}{{comma/item|D}}{{comma/end}} A, B, C, and D
{{comma/start|or=y}}{{comma/item|A}}{{comma/item|B}}{{comma/item|C}}{{comma/end}} A, B, or C
{{comma/start}}{{comma/item|A}}{{comma/item|B}}{{comma/item|C}}{{comma/end|or=y}} A, B, or C
{{comma/start}}{{comma/end}}
{{comma/start|sep1=×|sep3=×...×}}{{comma/item|A}}{{comma/item|B}}{{comma/item|C}}{{comma/item|D}}{{comma/end}} A×B×C×...×D