Template:ListFormat: Difference between revisions
From Archaelund Wiki
(Created page with "<onlyinclude><includeonly>{{#switch:{{{2|}}} |Bullets = {{#replace:{{{1|}}}|;| • }} |Diamonds = {{#replace:{{{1|}}}|;| ♦ }} |Arrows = {{#replace:{{{...") |
No edit summary |
||
| Line 3: | Line 3: | ||
|Diamonds = {{#replace:{{{1|}}}|;| ♦ }} | |Diamonds = {{#replace:{{{1|}}}|;| ♦ }} | ||
|Arrows = {{#replace:{{{1|}}}|;| → }} | |Arrows = {{#replace:{{{1|}}}|;| → }} | ||
|Blanks = {{#replace:{{{1|}}}|;| }} | |||
|UList = {{#if:{{{1|}}}|<ul>{{#replace:<li>{{#replace:{{{1}}}|;|</li><li>}}</li>|<li></li>|}}</ul>}} | |UList = {{#if:{{{1|}}}|<ul>{{#replace:<li>{{#replace:{{{1}}}|;|</li><li>}}</li>|<li></li>|}}</ul>}} | ||
|UList0 = {{#if:{{{1|}}}|<ul style="margin-top:0; margin-bottom:0;">{{#replace:<li>{{#replace:{{{1}}}|;|</li><li>}}</li>|<li></li>|}}</ul>}} | |UList0 = {{#if:{{{1|}}}|<ul style="margin-top:0; margin-bottom:0;">{{#replace:<li>{{#replace:{{{1}}}|;|</li><li>}}</li>|<li></li>|}}</ul>}} | ||
|OList = {{#if:{{{1|}}}|<ol>{{#replace:<li>{{#replace:{{{1}}}|;|</li><li>}}</li>|<li></li>|}}</ol>}} | |OList = {{#if:{{{1|}}}|<ol>{{#replace:<li>{{#replace:{{{1}}}|;|</li><li>}}</li>|<li></li>|}}</ol>}} | ||
|OList0 = {{#if:{{{1|}}}|<ol style="margin-top:0; margin-bottom:0;">{{#replace:<li>{{#replace:{{{1}}}|;|</li><li>}}</li>|<li></li>|}}</ol>}} | |OList0 = {{#if:{{{1|}}}|<ol style="margin-top:0; margin-bottom:0;">{{#replace:<li>{{#replace:{{{1}}}|;|</li><li>}}</li>|<li></li>|}}</ol>}} | ||
|#default = {{{1|}}} | |#default = {{{1|}}} | ||
}}</includeonly></onlyinclude> | }}</includeonly></onlyinclude> | ||
{{Documentation}} | {{Documentation}} | ||
[[Category:General Templates]] | [[Category:General Templates]] | ||
Latest revision as of 12:05, 21 March 2020
Description
This template generates various output formats from semicolon-separated lists (i.e. "item1; item2; item3; ...").
Usage
{{ListFormat|<semicolon-separated list>|<format>}}
Make sure that there are no leading or trailing semicolons in the input list, since this may cause empty entries in the output list of some formats.
Format options
| Format | Description | Example output |
|---|---|---|
| Bullets | Places all items in a single line, separated by bullets. | item1 • item2 • item3 |
| Diamonds | Places all items in a single line, separated by diamonds. | item1 ♦ item2 ♦ item3 |
| Arrows | Places all items in a single line, separated by right arrows. | item1 → item2 → item3 |
| Blanks | Places all items in a single line, separated by blank spaces. | item1 item2 item3 |
| UList | Generates an unordered (bulleted) list. |
|
| UList0 | Generates an unordered (bulleted) list with zero margin above and below. Prevents alignment issues in multi-column lists. |
|
| OList | Generates an ordered (numbered) list. |
|
View/Edit documentation page