Editing Module:List/doc
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
This page is not enabled for semantic in-text annotations due to namespace restrictions. Details about how to enable the namespace can be found on the configuration help page.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
This module outputs various kinds of lists. At present, it supports bulleted lists, unbulleted lists, horizontal lists, ordered lists (numbered or alphabetical), and horizontal ordered lists. It allows for easy css styling of the list or of the individual list items. | This module outputs various kinds of lists. At present, it supports bulleted lists, unbulleted lists, horizontal lists, ordered lists (numbered or alphabetical), and horizontal ordered lists. It allows for easy css styling of the list or of the individual list items. | ||
== Usage == | == Usage == | ||
− | + | ; Quick usage | |
− | {{ | + | |
+ | {{pre2|<nowiki>{{</nowiki>#invoke:list<nowiki>|</nowiki>''function''<nowiki>|</nowiki>''first item''<nowiki>|</nowiki>''second item''<nowiki>|</nowiki>''third item''<nowiki>|</nowiki>...<nowiki>}}</nowiki>}} | ||
+ | |||
+ | ; All parameters | ||
− | + | {{pre2| | |
− | {{ | ||
<nowiki>{{</nowiki>#invoke:list<nowiki>|</nowiki>''function'' | <nowiki>{{</nowiki>#invoke:list<nowiki>|</nowiki>''function'' | ||
<nowiki>|</nowiki>''first item''<nowiki>|</nowiki>''second item''<nowiki>|</nowiki>''third item''<nowiki>|</nowiki>... | <nowiki>|</nowiki>''first item''<nowiki>|</nowiki>''second item''<nowiki>|</nowiki>''third item''<nowiki>|</nowiki>... | ||
Line 28: | Line 25: | ||
}} | }} | ||
− | + | ; Arguments passed from parent template | |
− | {{ | + | |
+ | {{pre2|<nowiki>{{</nowiki>#invoke:list<nowiki>|</nowiki>''function''<nowiki>}}</nowiki>}} | ||
+ | |||
+ | ; Functions | ||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
Line 37: | Line 36: | ||
! Produces | ! Produces | ||
! Example output | ! Example output | ||
− | |||
|- | |- | ||
| <code>bulleted</code> | | <code>bulleted</code> | ||
| Bulleted lists | | Bulleted lists | ||
| {{#invoke:list|bulleted|First item|Second item|Third item}} | | {{#invoke:list|bulleted|First item|Second item|Third item}} | ||
− | |||
|- | |- | ||
| <code>unbulleted</code> | | <code>unbulleted</code> | ||
| Unbulleted lists | | Unbulleted lists | ||
| {{#invoke:list|unbulleted|First item|Second item|Third item}} | | {{#invoke:list|unbulleted|First item|Second item|Third item}} | ||
− | |||
|- | |- | ||
| <code>horizontal</code> | | <code>horizontal</code> | ||
| Horizontal bulleted lists | | Horizontal bulleted lists | ||
| {{#invoke:list|horizontal|First item|Second item|Third item}} | | {{#invoke:list|horizontal|First item|Second item|Third item}} | ||
− | |||
|- | |- | ||
| <code>ordered</code> | | <code>ordered</code> | ||
| Ordered lists (numbered lists and alphabetical lists) | | Ordered lists (numbered lists and alphabetical lists) | ||
| {{#invoke:list|ordered|First item|Second item|Third item}} | | {{#invoke:list|ordered|First item|Second item|Third item}} | ||
− | |||
|- | |- | ||
| <code>horizontal_ordered</code> | | <code>horizontal_ordered</code> | ||
| Horizontal ordered lists | | Horizontal ordered lists | ||
| {{#invoke:list|horizontal_ordered|First item|Second item|Third item}} | | {{#invoke:list|horizontal_ordered|First item|Second item|Third item}} | ||
− | |||
|} | |} | ||
== Parameters == | == Parameters == | ||
+ | |||
* Positional parameters (<code>1</code>, <code>2</code>, <code>3</code>...) - these are the list items. If no list items are present, the module will output nothing. | * Positional parameters (<code>1</code>, <code>2</code>, <code>3</code>...) - these are the list items. If no list items are present, the module will output nothing. | ||
* <code>start</code> - sets the start item for ordered lists. This can be a start number for numbered lists, or a start letter for alphabetical lists. Horizontal ordered lists only support numbers. | * <code>start</code> - sets the start item for ordered lists. This can be a start number for numbered lists, or a start letter for alphabetical lists. Horizontal ordered lists only support numbers. | ||
* <code>type</code> - the type of marker used in ordered lists. Possible values are "1" for numbers (the default), "A" for uppercase letters, "a" for lowercase letters, "I" for uppercase [[Roman numerals]], and "i" for lowercase Roman numerals. Not supported in horizontal ordered lists. See also the <code>list_style_type</code> parameter. | * <code>type</code> - the type of marker used in ordered lists. Possible values are "1" for numbers (the default), "A" for uppercase letters, "a" for lowercase letters, "I" for uppercase [[Roman numerals]], and "i" for lowercase Roman numerals. Not supported in horizontal ordered lists. See also the <code>list_style_type</code> parameter. | ||
− | * <code>list_style_type</code> - the type of marker used in ordered lists. This uses CSS styling, and has more types available than the <code>type</code> parameter, which uses an [[html attribute]]. Possible values are listed at [ | + | * <code>list_style_type</code> - the type of marker used in ordered lists. This uses CSS styling, and has more types available than the <code>type</code> parameter, which uses an [[html attribute]]. Possible values are listed at [http://www.w3schools.com/cssref/pr_list-style-type.asp W3schools' list-style-type page]. Support may vary by browser. <code>list-style-type</code> is an alias for this parameter. |
* <code>class</code> - a custom class for the {{tag|div}} tags surrounding the list, e.g. <code>plainlinks</code>. | * <code>class</code> - a custom class for the {{tag|div}} tags surrounding the list, e.g. <code>plainlinks</code>. | ||
* <code>style</code> - a custom css style for the {{tag|div}} tags surrounding the list, e.g. <code>font-size: 90%;</code>. | * <code>style</code> - a custom css style for the {{tag|div}} tags surrounding the list, e.g. <code>font-size: 90%;</code>. | ||
Line 80: | Line 74: | ||
== Examples == | == Examples == | ||
− | + | ; Bulleted lists | |
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
! Code !! Result | ! Code !! Result | ||
Line 94: | Line 89: | ||
|} | |} | ||
− | + | ; Unbulleted lists | |
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
! Code !! Result | ! Code !! Result | ||
Line 108: | Line 104: | ||
|} | |} | ||
− | + | ; Horizontal lists | |
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
! Code !! Result | ! Code !! Result | ||
Line 119: | Line 116: | ||
|} | |} | ||
− | === | + | ; Unbulleted lists |
+ | |||
+ | {| class="wikitable" | ||
+ | ! Code !! Result | ||
+ | |- | ||
+ | | <code><nowiki>{{#invoke:list|unbulleted|First item|Second item|Third item}}</nowiki></code> | ||
+ | | {{#invoke:list|unbulleted|First item|Second item|Third item}} | ||
+ | |- | ||
+ | | <code><nowiki>{{#invoke:list|unbulleted|First item|Second item|Third item|item_style=color:blue;}}</nowiki></code> | ||
+ | | {{#invoke:list|unbulleted|First item|Second item|Third item|item_style=color:blue;}} | ||
+ | |- | ||
+ | | <code><nowiki>{{#invoke:list|unbulleted|First item|Second item|Third item|item1_style=background-color:yellow;|item2_style=background-color:silver;}}</nowiki></code> | ||
+ | | {{#invoke:list|unbulleted|First item|Second item|Third item|item1_style=background-color:yellow;|item2_style=background-color:silver;}} | ||
+ | |} | ||
+ | |||
+ | ; Ordered lists | ||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
! Code !! Result | ! Code !! Result | ||
Line 129: | Line 142: | ||
| {{#invoke:list|ordered|First item|Second item|Third item|start=3}} | | {{#invoke:list|ordered|First item|Second item|Third item|start=3}} | ||
|- | |- | ||
− | | | + | | <code><nowiki>{{#invoke:list|ordered|First item|Second item|Third item|type=i}</nowiki></code> |
| {{#invoke:list|ordered|First item|Second item|Third item|type=i}} | | {{#invoke:list|ordered|First item|Second item|Third item|type=i}} | ||
|- | |- | ||
− | | | + | | <code><nowiki>{{#invoke:list|ordered|First item|Second item|Third item|list_style_type=lower-greek}}</nowiki></code> |
| {{#invoke:list|ordered|First item|Second item|Third item|list_style_type=lower-greek}} | | {{#invoke:list|ordered|First item|Second item|Third item|list_style_type=lower-greek}} | ||
|} | |} | ||
− | + | ; Horizontal ordered lists | |
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
! Code !! Result | ! Code !! Result | ||
Line 149: | Line 163: | ||
| {{#invoke:list|horizontal_ordered|First item|Second item|Third item|indent=2}} | | {{#invoke:list|horizontal_ordered|First item|Second item|Third item|indent=2}} | ||
|} | |} | ||
− | |||
− | |||
− | |||
== See also == | == See also == | ||
− | |||
− | + | * [[Module:Br separated entries]] | |
− | |||
− | [[ | ||
− |