Шаблон:Comma
Перейти до навігації
Перейти до пошуку
Документація Наведена нижче документація запозичена з «Шаблон:Comma/doc». (редагувати | історія)
[оновити]
Для більш повної чи актуальної інформації ви можете переглянути документацію англійською.
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 та B ПОМИЛКА! (очікується: A and B) |
{{comma|A|B|C}} |
A, B, та C ПОМИЛКА! (очікується: A, B, and C) |
{{comma|A|B|C|D}} |
A, B, C, та D ПОМИЛКА! (очікується: A, B, C, and D) |
{{comma|A||C|D}} |
A, C, та D ПОМИЛКА! (очікується: A, C, and D) |
{{comma|A||C|||||H}} |
A, C, та H ПОМИЛКА! (очікується: A, C, and H) |
{{comma|or=y|A}} |
A |
{{comma|or=y|A|B}} |
A чи B ПОМИЛКА! (очікується: A or B) |
{{comma|or=y|A|B|C}} |
A, B, чи C ПОМИЛКА! (очікується: A, B, or C) |
{{comma|or=y|A|B|C|D}} |
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 та B ПОМИЛКА! (очікується: A and B) |
{{comma/start}}{{comma/item|A}}{{comma/item|B}}{{comma/item|C}}{{comma/item|D}}{{comma/end}} |
A, B, C, та D ПОМИЛКА! (очікується: A, B, C, and D) |
{{comma/start|or=y}}{{comma/item|A}}{{comma/item|B}}{{comma/item|C}}{{comma/end}} |
A, B, чи C ПОМИЛКА! (очікується: A, B, or C) |
{{comma/start}}{{comma/item|A}}{{comma/item|B}}{{comma/item|C}}{{comma/end|or=y}} |
A, B, чи C ПОМИЛКА! (очікується: 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 |