Lists

List types

List behavior

Bulleted and Numbered Lists

Bulleted list items start with a dash or an asterisk followed by a space or tab character. Bulleted list syntaxes are:

- List item.
* List item.

Numbered list items start with an optional number or letter followed by a period followed by a space or tab character. List numbering is optional. Numbered list syntaxes are:

.  Integer numbered list item.
1. Integer numbered list item with optional numbering.
.. Lowercase letter numbered list item.
a. Lowercase letter numbered list item with optional numbering.

Here are some examples:

- Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  * Fusce euismod commodo velit.
  * Qui in magna commodo, est labitur dolorum an. Est ne magna primis
    adolescens. Sit munere ponderum dignissim et. Minim luptatum et
    vel.
  * Vivamus fringilla mi eu lacus.
  * Donec eget arcu bibendum nunc consequat lobortis.
- Nulla porttitor vulputate libero.
  . Fusce euismod commodo velit.
  . Vivamus fringilla mi eu lacus.
    .. Fusce euismod commodo velit.
    .. Vivamus fringilla mi eu lacus.
  . Donec eget arcu bibendum nunc consequat lobortis.
- Praesent eget purus quis magna eleifend eleifend.
  1. Fusce euismod commodo velit.
    a. Fusce euismod commodo velit.
    b. Vivamus fringilla mi eu lacus.
    c. Donec eget arcu bibendum nunc consequat lobortis.
  2. Vivamus fringilla mi eu lacus.
  3. Donec eget arcu bibendum nunc consequat lobortis.
  4. Nam fermentum mattis ante.

.Spaced List Example
- Praesent 1.

  * Vivamus fringilla mi eu lacus.

    - Fusce euismod - *same type can not be used again in sub lists*

  * Donec eget arcu bibendum nunc consequat lobortis.
    - Fusce euismod commodo velit.

- Praesent 2.

  . Fusce euismod commodo velit.

    .. Fusce euismod commodo velit.

    .. Vivamus fringilla mi eu lacus.

    .. Donec eget arcu bibendum nunc consequat lobortis.

  . Vivamus fringilla mi eu lacus.
+
  title KNOPPIX
        root   (hd0,0)
        kernel /boot.knoppix/isolinux/linux 2 fromhd=/dev/hda4 lang=us
        initrd /boot.knoppix/isolinux/minirt.gz
+
notice the fromhd parameter: it's the location of the /KNOPPIX directory.

  . Donec eget arcu bibendum nunc consequat lobortis.

  . Nam fermentum mattis ante.

Which render as:

  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

    • Fusce euismod commodo velit.
    • Qui in magna commodo, est labitur dolorum an. Est ne magna primis adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel.
    • Vivamus fringilla mi eu lacus.
    • Donec eget arcu bibendum nunc consequat lobortis.
  • Nulla porttitor vulputate libero.

    1. Fusce euismod commodo velit.
    2. Vivamus fringilla mi eu lacus.

      1. Fusce euismod commodo velit.
      2. Vivamus fringilla mi eu lacus.
    3. Donec eget arcu bibendum nunc consequat lobortis.
  • Praesent eget purus quis magna eleifend eleifend.

    1. Fusce euismod commodo velit.

      1. Fusce euismod commodo velit.
      2. Vivamus fringilla mi eu lacus.
      3. Donec eget arcu bibendum nunc consequat lobortis.
    2. Vivamus fringilla mi eu lacus.
    3. Donec eget arcu bibendum nunc consequat lobortis.
    4. Nam fermentum mattis ante.

Spaced List Example

  • Praesent 1.

    • Vivamus fringilla mi eu lacus.
  • Fusce euismod - same type can not be used again in sub lists

    • Donec eget arcu bibendum nunc consequat lobortis.
  • Fusce euismod commodo velit.
  • Praesent 2.

    1. Fusce euismod commodo velit.

      1. Fusce euismod commodo velit.
      2. Vivamus fringilla mi eu lacus.
      3. Donec eget arcu bibendum nunc consequat lobortis.
    2. Vivamus fringilla mi eu lacus.

      title KNOPPIX
            root   (hd0,0)
            kernel /boot.knoppix/isolinux/linux 2 fromhd=/dev/hda4 lang=us
            initrd /boot.knoppix/isolinux/minirt.gz

      notice the fromhd parameter: it's the location of the /KNOPPIX directory.

    3. Donec eget arcu bibendum nunc consequat lobortis.
    4. Nam fermentum mattis ante.

List Item Continuation

To include subsequent block elements in list items (in addition to implicitly included nested lists and Literal paragraphs) place a separator line containing a single plus character between the list item and the ensuing list continuation element. Multiple block elements (excluding section Titles and BlockTitles) may be included in a list item using this technique. For example:

Here's an example of list item continuation:

1. List item one.
+
List item one continued with a second paragraph followed by an
Indented block.
+
.................
$ ls *.sh
$ mv *.sh ~/tmp
.................
+
List item one continued with a third paragraph.

2. List item two.

   List item two literal paragraph (no continuation required).

-  Nested list (item one).

   Nested list literal paragraph (no continuation required).
+
Nested list appended list item one paragraph

-  Nested list item two.

Renders:

  1. List item one.

    List item one continued with a second paragraph followed by a Listing block.

    $ ls *.sh
    $ mv *.sh ~/tmp

    List item one continued with a third paragraph.

  2. List item two.

    List item two literal paragraph (no continuation required).
    • Nested list (item one).

      Nested list literal paragraph (no continuation required).

      Nested list appended list item one paragraph

    • Nested list item two.

List Block

A List block is a special delimited block containing a list element.

  • All elements between in the List Block are part of the preceding list item. In this respect the List block behaves like List Item Continuation except that list items contained within the block do not require explicit + list item continuation lines:
  • The block delimiter is a single line containing two dashes.
  • Any block title or attributes are passed to the first element inside the block.

The List Block is useful for:

  1. Lists with long multi-element list items.
  2. Nesting a list within a parent list item (by default nested lists follow the preceding list item).

Here's an example of a nested list block:

.Nested List Block
1. List item one.
+
This paragraph is part of the preceding list item
+
--
a. This list is nested and does not require explicit item continuation.

This paragraph is part of the preceding list item

b. List item b.

This paragraph belongs to list item b.
--
+
This paragraph belongs to item 1.

1. dupe of list item one.
+
--

Then followed by,

a bunch or two parargraphs.

Or maybe more.

Note that the preceding + is vitally imporant. Check with next example.
--

2. Item 2 of the outer list.
--
Then followed by,

a bunch or two parargraphs.

Or maybe more.
--
3. Item 3 of the outer list.

Renders:

Nested List Block

  1. List item one.

    This paragraph is part of the preceding list item

    1. This list is nested and does not require explicit item continuation.

      This paragraph is part of the preceding list item

    2. List item b.

      This paragraph belongs to list item b.

    This paragraph belongs to item 1.

  2. dupe of list item one.

    Then followed by,

    a bunch or two parargraphs.

    Or maybe more.

    Note that the preceding + is vitally imporant. Check with next example.

  3. Item 2 of the outer list.

Then followed by,

a bunch or two parargraphs.

Or maybe more.

  1. Item 3 of the outer list.

Vertical Labeled Lists

Tags: html definitions

Labeled list items consist of one or more text labels followed the text of the list item.

An item label begins a line with an alphanumeric character hard against the left margin and ends with a double colon :: or semi-colon ;;.

The list item text consists of one or more lines of text starting on the line immediately following the label and can be followed by nested List or ListParagraph elements. Item text can be optionally indented.

Here are some examples:

Lorem::
  Fusce euismod commodo velit.
+
Fusce euismod commodo velit.
+
  Fusce euismod commodo velit.

Lorem::
+
--

Fusce euismod commodo velit.

Fusce euismod commodo velit.

  Fusce euismod commodo velit.

  Fusce euismod commodo velit.
--

Ipsum::
  Vivamus fringilla mi eu lacus.
  * Vivamus fringilla mi eu lacus.
  * Donec eget arcu bibendum nunc consequat lobortis.
Dolor::
  Donec eget arcu bibendum nunc consequat lobortis.
  'Suspendisse';;
    A massa id sem aliquam auctor.
  'Morbi';;
    Pretium nulla vel lorem.
  'In';;
    Dictum mauris in urna.

. why this is still with last item?

. and this?

Lorem::
  Fusce euismod commodo velit.

Where would this parargraph be?

Lorem::
  Fusce euismod commodo velit.

. how about this?

Which render as:

Lorem

Fusce euismod commodo velit.

Fusce euismod commodo velit.

Fusce euismod commodo velit.
Lorem

Fusce euismod commodo velit.

Fusce euismod commodo velit.

Fusce euismod commodo velit.
Fusce euismod commodo velit.
Ipsum

Vivamus fringilla mi eu lacus.

  • Vivamus fringilla mi eu lacus.
  • Donec eget arcu bibendum nunc consequat lobortis.
Dolor

Donec eget arcu bibendum nunc consequat lobortis.

Suspendisse
A massa id sem aliquam auctor.
Morbi
Pretium nulla vel lorem.
In

Dictum mauris in urna.

  1. why this is still with last item?
  2. and this?
Lorem
Fusce euismod commodo velit.

Where would this parargraph be?

Lorem

Fusce euismod commodo velit.

  1. how about this?

Horizontal Labeled Lists

Horizontal labeled lists differ from vertical labeled lists in that the label and the list item sit side-by-side as opposed to the item under the label. Item text must begin on the same line as the label.

Here are some examples:

*Lorem*:: Fusce euismod commodo velit.
  Qui in magna commodo, est labitur dolorum an. Est ne magna primis
  adolescens.

  Fusce euismod commodo velit.

*Ipsum*:: Vivamus fringilla mi eu lacus.
  * Vivamus fringilla mi eu lacus.
  * Donec eget arcu bibendum nunc consequat lobortis.
*Dolor*:: Donec eget arcu bibendum nunc consequat lobortis.
  Sit munere ponderum dignissim et. Minim luptatum et vel.

Which render as:

Lorem

Fusce euismod commodo velit. Qui in magna commodo, est labitur dolorum an. Est ne magna primis adolescens.

Fusce euismod commodo velit.

Ipsum

Vivamus fringilla mi eu lacus.

  • Vivamus fringilla mi eu lacus.
  • Donec eget arcu bibendum nunc consequat lobortis.

Dolor

Donec eget arcu bibendum nunc consequat lobortis. Sit munere ponderum dignissim et. Minim luptatum et vel.

[Warning]
  • Use vertical labeled lists in preference to horizontal labeled lists — current PDF toolchains do not make a good job of determining the relative column widths.
  • If you are generating DocBook markup the horizontal labeled lists should be nested because the DocBook XML V4.2 DTD does not permit nested informal tables (although DocBook XSL Stylesheets process them correctly).

Question and Answer Lists

AsciiDoc comes pre-configured with a labeled list for generating DocBook question and answer (Q&A) lists (?? label delimiter). Example:

Question one??
        Answer one.
Question two??
        Answer two.

Renders:

1. Question one
2. Question two
1.

Question one

Answer one.

2.

Question two

Answer two.

Glossary Lists

AsciiDoc comes pre-configured with a labeled list (:- label delimiter) for generating DocBook glossary lists. Example:

A glossary term:-
    The corresponding definition.
A second glossary term:-
    The corresponding definition.

For working examples see the article.txt and book.txt documents in the AsciiDoc ./doc distribution directory.

[Note]

To generate valid DocBook output glossary lists must be located in a glossary section.

Bibliography Lists

AsciiDoc comes with a predefined itemized list (+ item bullet) for generating bibliography entries. Example: