Wikispecies:List formatting

From Wikispecies
Jump to navigation Jump to search

Do not separate list items by leaving empty lines or tabular column breaks between them. This includes items in a description list (a list made with a leading colon) or an unordered list. Lists are meant to group elements that belong together, but MediaWiki will interpret the blank line as the end of one list and start a new one. Excessive double line breaks also disrupt screen readers, which will announce multiple lists when only one was intended, and therefore may mislead or confuse users of these programs. Such improper formatting can also more than triple the length of time it takes them to read the list.

Likewise, do not switch between initial list marker types (colons, asterisks or hash signs) in one list.

Talk pages[edit]

The guidance on this page applies to talk pages as well as articles.

Repeated failure to indent talk page comments correctly may, after warnings, result in your editing privileges being revoked.

Basic[edit]

For example, in a discussion, do YesY this best practice:

* Support.  I like this idea.  [[User:Example]] 
** Question:  What do you like about it?  [[User:Example 2]]

or YesY this acceptable practice:

* Support.  I like this idea.  [[User:Example]] 
*: Question:  What do you like about it?  [[User:Example 2]] 

but N don't do this (switch type from bullet list to description list):

* Support.  I like this idea.  [[User:Example]] 
:: Question:  What do you like about it?  [[User:Example 2]] 

nor N this (switch type from bullet list to description list):

* Support.  I like this idea.  [[User:Example]] 
:* Question:  What do you like about it?  [[User:Example 2]] 

nor N this (leave blank lines between list items):

* Support.  I like this idea.  [[User:Example]]

** Question:  What do you like about it?  [[User:Example 2]]

nor N this (jump more than one level):

* Support.  I like this idea.  [[User:Example]]
*** Question:  What do you like about it?  [[User:Example 2]]

Multiple paragraphs within list items[edit]

Normal MediaWiki list markup is unfortunately incompatible with normal MediaWiki paragraph markup. To put multiple paragraphs in a list item, YesY separate them with <p>:

* This is one item.<p>This is another paragraph within this item.
* This is another item.

Do not N use line breaks to simulate paragraphs, because they have different semantics:

* This is one item.<br>This is the same paragraph, with a line break before it.
* This is another item.

Definitely do not N attempt to use a colon to match the indentation level, since (as mentioned above) it produces three separate lists:

* This is one item.
: This is an entirely separate list.
* This is a third list.

Indentation[edit]

A colon (:) at the start of a line marks that line in the MediaWiki parser as the <dd>...</dd> part of an HTML description list (<dl>...</dl>)[1] The visual effect in most Web browsers is to indent the line. This is used, for example, to indicate replies in a threaded discussion on talk pages. However, this markup alone is missing the required <dt> (term) element of a description list, to which the <dd> (description/definition) pertains. As can be seen by inspecting the code sent to the browser, this results in broken HTML (i.e. it fails validation[2]). The result is that assistive technology, such as screen readers, will announce a description list that does not exist, which is confusing for any visitor unused to Wikipedia's broken markup. This is not ideal for accessibility, semantics, or reuse, but is currently commonly used, despite the problems it causes for users of screen readers.

Blank lines must not be placed between colon-indented lines of text – especially in article content. This is interpreted by the software as marking the end of a list and the start of a new one. If a blank line is needed, place the same number of colons on it as those preceding the text below the blank line, for instance:

: Text here.
:
: More text.

Another solution is new-paragraph markup, but it must be in one unbroken line in the wiki code:

: Text here.<p>More text.</p>

Vertical lists[edit]

Bulleted vertical lists[edit]

For bulleted vertical lists, do not separate items by leaving blank lines between them. If list items are separated by more than one line break, the HTML list will be ended before the line break, and another HTML list will be opened after the line break. This effectively breaks what is seen as one list into several smaller lists for those using screen readers. For example, for the coding:

* White rose
* Yellow rose

* Pink rose

* Red rose

the software partially suppresses line spaces and therefore it looks like this:

  • White rose
  • Yellow rose
  • Pink rose
  • Red rose

but will be read by a screen reader as: "List of 2 items: (bullet) White rose, (bullet) Yellow rose, list end. List of 1 items: (bullet) Pink rose, list end. List of 1 items: (bullet) Red rose, list end."

Do not separate list items with line breaks (<br>). Use {{Plainlist}} if the list is to remain vertical; or consider {{Flatlist}} if the list could be better rendered horizontally (in-line) as described in the following two sections.

Unbulleted vertical lists[edit]

For unbulleted lists running down the page, the templates {{Plainlist}} is available, to improve accessibility and semantic meaningfulness by marking up what is clearly a list rather than including <br /> line breaks, which should not be used—see above. They differ only in the wiki-markup used to create the list. Note that because these are templates, the text of each list item cannot contain the vertical bar symbol (|) unless it is replaced by {{!}} or is contained within <nowiki>...</nowiki> tags. Similarly it can't contain the equals sign (=), unless replaced with {{=}} or contained within <nowiki>...</nowiki>, though you can bypass this by naming the parameters (|1=, |2= etc.).

Example of plainlist
Wikitext Renders as
{{plainlist |
* White rose
* Yellow rose
* Pink rose
* Red rose
}}
  • White rose
  • Yellow rose
  • Pink rose
  • Red rose

Alternatively, in templates, such lists may be styled with the class "plainlist".

Horizontal lists[edit]

For lists running across the page, and in single rows in infoboxes and other tables, the templates {{Flatlist}} is available to improve accessibility and semantic meaningfulness. This feature makes use of the correct HTML markup for each list item, rather than including bullet characters which, for example, are read out (e.g., "dot cat dot dog dot horse dot...") by the assistive software used by people who are blind. The templates differ only in the wiki-markup used to create the list. Note that because these are templates, the text of each list item cannot contain the vertical bar symbol ( | ) unless it is replaced by {{!}} or is contained within <nowiki>...</nowiki> tags.

Example of flatlist
Wikitext Renders as
{{flatlist |
* White rose
* Yellow rose
* Pink rose
* Red rose
}}
  • White rose
  • Yellow rose
  • Pink rose
  • Red rose

Alternatively, in templates, lists may be styled with the class hlist.

  1. HTML description lists were formerly called definition lists and association lists. The <dl><dt>...</dt><dd>...</dd></dl> structure is the same; only the terminology has changed between HTML specification versions.
  2. Markup Validation Service: Check the markup (HTML, XHTML, …) of Web documents. Validator.W3.org. World Wide Web Consortium (2017). The validator failure reported is "Error: Element dl is missing a required child element."