|
|
| Line 132: |
Line 132: |
| |} | | |} |
| Blank lines between items of an ordered list will not only cause the same problems as in the previous example, but will also restart the numbering at "1". This cannot be fixed without complex wiki markup (defeating ease-of-editing expectations), so double-spacing should always be avoided in numbered lists. | | Blank lines between items of an ordered list will not only cause the same problems as in the previous example, but will also restart the numbering at "1". This cannot be fixed without complex wiki markup (defeating ease-of-editing expectations), so double-spacing should always be avoided in numbered lists. |
|
| |
| === Description (definition, association) lists ===
| |
| {{anchor|Definition lists|Association (definition) lists}}
| |
| <!-- [[Wikipedia:Definition list]] and [[Wikipedia:Semicolon]] redirect here -->
| |
| {{Shortcut|MOS:DEFLIST}}
| |
|
| |
| Wikipedia has a special markup for {{dfn|description lists}} (formerly called ''{{dfn|definition lists}}'' in [[HTML4]] and ''{{dfn|association lists}}'' in [[HTML5]]). A description list contains groups of "terms and definitions, metadata topics and values, questions and answers, or any other groups of name–value data".<ref>{{citation|author=[[W3C]]|title=HTML5: A Vocabulary and Associated APIs for HTML and XHTML, W3C Working Draft|date=5 April 2011|url=http://www.w3.org/TR/2011/WD-html5-20110405/grouping-content.html#the-dl-element}}.</ref>
| |
|
| |
| There are templates for producing description lists such as glossaries, in ways that provide for richer, more complex content than bare wikimarkup syntax. The basic format of a ''{{dfn|[[WP:Manual of Style/Glossaries#Template-structured|template-structured description list]]}}'' is:
| |
|
| |
| {| class="wikitable"
| |
| |-
| |
| !Wikitext
| |
| !Appearance
| |
| |-
| |
| |
| |
| {{tlx|glossary}}<br />
| |
| {{tlx|term|name 1}}<br />
| |
| {{tlx|defn|value 1}}<br />
| |
| {{tnull|term|name 2}}<br />
| |
| {{tnull|defn|value 2}}<br />
| |
| {{tnull|term|name 3}}<br />
| |
| {{tnull|defn|value 3}}<br />
| |
| {{tlx|glossary end}}
| |
| |
| |
| {{glossary}}
| |
| {{term|name 1}}
| |
| {{defn|value 1}}
| |
| {{term|name 2}}
| |
| {{defn|value 2}}
| |
| {{term|name 3}}
| |
| {{defn|value 3}}
| |
| {{glossary end}}
| |
| |}
| |
|
| |
| The content in any {{tl|defn}} can be complex, including multiple paragraphs, block quotations, sub-lists, etc. See [[Template:Glossary]] for full documentation.
| |
|
| |
| The simpler, but very functionality-limited and easily broken, basic wikimarkup format is:
| |
|
| |
| {{markup
| |
| |
| |
| ; name 1 : value 1
| |
| ; name 2 : value 2
| |
| ; name 3 : value 3
| |
| |
| |
| ; name 1 : value 1
| |
| ; name 2 : value 2
| |
| ; name 3 : value 3
| |
| }}
| |
|
| |
| An alternative source layout is to put the name on a separate line straight after the term, like so:
| |
|
| |
| {{markup
| |
| |
| |
| ; name 1
| |
| : This is the value associated with the first name and may be quite long, but must be one unbroken line in the source.
| |
| ; name 2
| |
| : This is the value associated with the second name, which may also be long.
| |
| |
| |
| ; name 1
| |
| : This is the value associated with the first term and may be quite long, but must be one unbroken line in the source.
| |
| ; name 2
| |
| : This is the value associated with the second term, which may also be long.
| |
| }}
| |
|
| |
| This still keeps the names and values within a single description list, and the alternation of typically short names and longer values makes the separate components easy to spot while editing. The resulting layout and HTML are identical to that generated by the single-line syntax.
| |
|
| |
| {{em|A major weakness of both variants of <code>;</code>-and-<code>:</code> markup is that they are easily broken by later editors attempting to create multi-line values.}} Use of template-structured formatting resolves that problem.
| |
|
| |
| Use structured or description list format instead of other, made-up formats, as they may not fit reader and editor expectations, hamper reusability of Wikipedia content, make automated processing more difficult, or introduce usability and accessibility problems.
| |
|
| |
| As with unordered (bulleted) lists, items in description lists should not be double-spaced, as it causes each entry to be its own bogus "list" in the output, obviating the point of putting the entries in list markup to begin with.
| |
|
| |
| In some cases, tables are better-suited to associating content than description lists.
| |
|
| |
| Note that when colons are used for [[WP:INDENT|indentation]], in articles or on talk pages, they too are rendered in HTML as description lists. It is preferable to use [[Template:Indent]] or one of its variants, especially in articles.
| |
|
| |
|
| === Tables === | | === Tables === |