Difference between revisions of "Help:Lists"
J McKalling (Talk | contribs) m |
J McKalling (Talk | contribs) (→Variable lists: added examples) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{Infobox Help}}'''Lists''' are very easy to create here at the Twinsuniverse. There are two main types of lists: numbered and bulleted. Unlike paragraphs, to separate lines of lists you only need one line break, and not two. |
− | + | ||
− | + | ||
− | + | ||
− | '''Lists''' are very easy to create | + | |
==Bulleted lists== | ==Bulleted lists== | ||
To make a bulleted list, simply put an asterisk (*) at the beginning of each line: | To make a bulleted list, simply put an asterisk (*) at the beginning of each line: | ||
− | < | + | <nowiki>* Twinsen |
− | * | + | * Zoé |
− | * Baldino</ | + | * Baldino</nowiki> |
* Twinsen | * Twinsen | ||
− | * | + | * Zoé |
* Baldino | * Baldino | ||
− | To indent one | + | |
− | < | + | To indent one level in a list, simply add more asterisks: |
− | **Twinsen | + | <nowiki>* Quetches |
− | ** | + | ** Twinsen |
+ | ** Zoé | ||
* Grobos | * Grobos | ||
− | **Baldino | + | ** Baldino |
− | **Zed</ | + | ** Zed</nowiki> |
* Quetches | * Quetches | ||
− | **Twinsen | + | ** Twinsen |
− | ** | + | ** Zoé |
* Grobos | * Grobos | ||
− | **Baldino | + | ** Baldino |
− | **Zed | + | ** Zed |
==Numbered lists== | ==Numbered lists== | ||
Numbered lists are the same, except that the # sign is used instead of *: | Numbered lists are the same, except that the # sign is used instead of *: | ||
− | < | + | <nowiki># Twinsen |
− | # | + | # Zoé |
− | #Baldino</ | + | # Baldino</nowiki> |
− | #Twinsen | + | # Twinsen |
− | # | + | # Zoé |
− | #Baldino | + | # Baldino |
+ | |||
+ | Indenting is also similar: | ||
+ | <nowiki># Quetches | ||
+ | ## Twinsen | ||
+ | ## Zoé | ||
+ | # Grobos | ||
+ | ## Baldino | ||
+ | ## Zed</nowiki> | ||
+ | # Quetches | ||
+ | ## Twinsen | ||
+ | ## Zoé | ||
+ | # Grobos | ||
+ | ## Baldino | ||
+ | ## Zed | ||
+ | |||
+ | ==Combinations== | ||
+ | Lists can have more than two levels as well. Now you know listing is really easy, here is a more complex combination example: | ||
+ | <nowiki>* Quetches | ||
+ | *# Twinsen | ||
+ | *#* Melee | ||
+ | *#* Ranged | ||
+ | *#* Magic | ||
+ | *#* Explosive | ||
+ | *# Zoé | ||
+ | *#* Melee | ||
+ | * Grobos | ||
+ | *# Baldino | ||
+ | *#* Melee | ||
+ | *#* Ranged | ||
+ | *# Zed | ||
+ | *#* Mushrooms</nowiki> | ||
+ | * Quetches | ||
+ | *# Twinsen | ||
+ | *#* Melee | ||
+ | *#* Ranged | ||
+ | *#* Magic | ||
+ | *#* Explosive | ||
+ | *# Zoé | ||
+ | *#* Melee | ||
+ | * Grobos | ||
+ | *# Baldino | ||
+ | *#* Melee | ||
+ | *#* Ranged | ||
+ | *# Zed | ||
+ | *#* Mushrooms | ||
+ | |||
+ | ==Variable lists== | ||
+ | Maybe you want to render a list of items that are rendered by a template or template parameter, and you don't know which items will be non-empty. You will want to prevent empty bullets from being rendered, so in that case the above syntax would not work. Using conditional mechanics could become quite tedious, so instead you could use the {{templatelink|list}} template. | ||
+ | |||
+ | The list template can omit empty list items automatically. It renders the items with bullets or numbers, or as a single-line string with separators. It does not fully support multiple levels of indentation though, and it cannot be embedded safely either. | ||
+ | |||
+ | The following bulleted example assumes we are in a template, which is then called with parameters '''one=some''' and '''two=thing''': | ||
+ | <nowiki>{{list|range=5 | ||
+ | |{{{first|}}} | ||
+ | |{{{one|}}} | ||
+ | |{{{second|}}} | ||
+ | |{{{two|}}} | ||
+ | |{{{third|}}} | ||
+ | }}</nowiki> | ||
+ | |||
+ | {{list|range=5||some||thing|}} | ||
+ | |||
− | + | Alternatively, the template can also be used to separate things on a single line. This could be useful if manual separation becomes too repetitive: | |
− | < | + | <nowiki>Available fruit: {{list|separator=<span style{{=}}"color:blue"> • </span> |
− | + | |Apple | |
− | + | |Banana | |
− | + | |Lemon | |
− | + | |Orange | |
− | + | |Peach | |
− | + | }}</nowiki> | |
− | + | Available fruit: {{list|separator=<span style{{=}}"color:blue"> • </span> | |
− | + | |Apple | |
− | + | |Banana | |
− | + | |Lemon | |
− | + | |Orange | |
+ | |Peach | ||
+ | }} | ||
− | [[ | + | For further details on how to use this template, see its [[Template:list|documentation page]]. |
Latest revision as of 21:54, 11 June 2014
Help Contents | |
---|---|
Bulleted lists
To make a bulleted list, simply put an asterisk (*) at the beginning of each line:
* Twinsen * Zoé * Baldino
- Twinsen
- Zoé
- Baldino
To indent one level in a list, simply add more asterisks:
* Quetches ** Twinsen ** Zoé * Grobos ** Baldino ** Zed
- Quetches
- Twinsen
- Zoé
- Grobos
- Baldino
- Zed
Numbered lists
Numbered lists are the same, except that the # sign is used instead of *:
# Twinsen # Zoé # Baldino
- Twinsen
- Zoé
- Baldino
Indenting is also similar:
# Quetches ## Twinsen ## Zoé # Grobos ## Baldino ## Zed
- Quetches
- Twinsen
- Zoé
- Grobos
- Baldino
- Zed
Combinations
Lists can have more than two levels as well. Now you know listing is really easy, here is a more complex combination example:
* Quetches *# Twinsen *#* Melee *#* Ranged *#* Magic *#* Explosive *# Zoé *#* Melee * Grobos *# Baldino *#* Melee *#* Ranged *# Zed *#* Mushrooms
- Quetches
- Twinsen
- Melee
- Ranged
- Magic
- Explosive
- Zoé
- Melee
- Twinsen
- Grobos
- Baldino
- Melee
- Ranged
- Zed
- Mushrooms
- Baldino
Variable lists
Maybe you want to render a list of items that are rendered by a template or template parameter, and you don't know which items will be non-empty. You will want to prevent empty bullets from being rendered, so in that case the above syntax would not work. Using conditional mechanics could become quite tedious, so instead you could use the {{list}} template.
The list template can omit empty list items automatically. It renders the items with bullets or numbers, or as a single-line string with separators. It does not fully support multiple levels of indentation though, and it cannot be embedded safely either.
The following bulleted example assumes we are in a template, which is then called with parameters one=some and two=thing:
{{list|range=5 |{{{first|}}} |{{{one|}}} |{{{second|}}} |{{{two|}}} |{{{third|}}} }}
- some
- thing
Alternatively, the template can also be used to separate things on a single line. This could be useful if manual separation becomes too repetitive:
Available fruit: {{list|separator=<span style{{=}}"color:blue"> • </span> |Apple |Banana |Lemon |Orange |Peach }}
Available fruit: Apple • Banana • Lemon • Orange • Peach
For further details on how to use this template, see its documentation page.