Enumerated Lists
A line opening with an enumerator — a number, letter or roman numeral followed
by ., ) or wrapped in () — starts an enumerated list, rendered as
<ol class="sequence format">.
Enumeration Sequences
All five docutils sequences are supported. The sequence is decided by the list's first enumerator and then held for the rest of the list.
Arabic numerals:
First item
Second item
Third item
Lowercase letters:
First item
Second item
Uppercase letters:
First item
Second item
Lowercase roman numerals:
First item
Second item
Third item
Uppercase roman numerals:
First item
Second item
Third item
Enumerator Formats
The same three formats docutils recognises. Unlike Sphinx — which drops the punctuation and renders all three identically — rinx keeps it, so the notation you write is the notation the reader sees.
Suffixed with a period:
Period format
Second item
Suffixed with a right parenthesis:
Right-paren format
Second item
Surrounded by parentheses:
Parenthesised format
Second item
The format is part of the list's identity, so changing it mid-list does not continue the list. These sequences and formats combine freely:
A parenthesised lower-roman list, starting at four
Second item
Auto-Enumeration
#. numbers an item automatically, so items can be reordered without
renumbering them by hand:
Automatically numbered
Second item
Third item
The first item may also be numbered explicitly, with the rest deferred to
#:
Explicitly numbered
Automatically numbered
Also automatic
Starting at Another Number
A list may begin anywhere in its sequence. The starting ordinal is preserved
as the <ol>'s start attribute, and the build reports it as a
diagnostic in case the offset was accidental:
This list starts at five
Sixth item
Multi-Line and Multi-Paragraph Items
An item's body continues for as long as it stays indented past the enumerator, so items may wrap and may hold several paragraphs:
This item's text wraps onto a second source line, which is joined into one paragraph.
This item holds two paragraphs.
The second paragraph stays part of the item because it is still indented relative to the enumerator.
A short third item.
An item's marker may also stand alone, with the body starting on the next line:
The body indent is read from this line rather than assumed from the marker's width.
Second item
Nested Lists
Item bodies are parsed as full block-level RST, so lists nest — in either direction, and to any depth:
An outer arabic item
A nested lower-alpha item
Another nested item
A third level, in roman numerals
Back to the outer list
Enumerated lists nest inside bullet lists and vice versa:
A bullet item
A nested enumerated item
Another one
Other Block Content in an Item
Because item bodies go through the same block dispatch as the document body, they may contain any block construct — directives, literal blocks, tables, cross-references:
An item containing an admonition:
Note
Directives work inside list items.
An item containing a literal block:
return 1
An item cross-referencing the
greetingsmodule and linking to Rinx Example Site.
Lists Inside Directives
The nesting works in the other direction too — an enumerated list is a plain block construct, so it may appear in any directive body:
See also
First thing to see
Second thing to see
When a Line Is Not a List
An enumerator is ambiguous with ordinary prose, so docutils requires the following line to agree: it must be blank, indented, or carry the next enumerator in the sequence. That is what keeps this a paragraph rather than a one-item list:
A. Einstein said this. He was smart.
The same rule keeps a decimal number from opening a list, because the marker must be followed by a space:
1.5 is a number, not a list item.
Note the rule only applies when a non-blank, unindented line follows. Standing
alone, A. Einstein said this. really would become a list — in docutils
too. The spec's advice there is to escape the period.