Zettelmarkup: Nested Lists

00001007030200 · Info · (manual) · #manual #zettelmarkup #zettelstore

There are thee kinds of lists that can be nested: ordered lists, unordered lists, and quotation lists.

Ordered lists are specified with the number sign (“#”, U+0023), unordered lists use the asterisk (“*”, U+002A), and quotation lists are specified with the greater-than sing (“>”, U+003E). Let's call these three characters list characters.

Any nested list item is specified by a non-empty sequence of list characters, followed by a space character and a sequence of inline elements. In case of a quotation list as the last list character, the space character followed by a sequence of inline elements is optional. The number / count of list characters gives the nesting of the lists. If the following lines should also be part of the list item, exactly the same number of spaces must be given at the beginning of each of the following lines as it is the lists are nested, plus one additional space character. In other words: the inline elements must begin at the same column as it was on the previous line.

The resulting sequence on inline elements is merged into a paragraph. Appropriately indented paragraphs can specified after the first one. Since each blocks-structured element has to be specified at the first position of a line, none of the nested list items may contain anything else than paragraphs.

Some examples:

# One
# Two
# Three

is rendered in HTML as

  1. One
  2. Two
  3. Three

Similar an unordered list:

* A
* B
* C

is rendered in HTML as

  • A
  • B
  • C

A quotation list is in most cases not a real list. Mostly, it results by copying replies from emails:

> Please add some
> more parsers to
> the Zettelstore software.

is rendered in HTML as

Please add some more parsers to the Zettelstore software.

You can freely mix these three types of nested lists. And you can nest them:

* A
*# A.1
*# A.2
*#* A.2.a
*#* A.2.b
*#> Quote A.2.b.I
*#># A.2.b.I.1
*#># A.2.b.I.2
*# A.3
* B

* C

is rendered in HTML as:

  • A

    1. A.1

    2. A.2

      • A.2.a
      • A.2.b

      Quote A.2.b.I

      1. A.2.b.I.1
      2. A.2.b.I.2
    3. A.3

  • B

  • C

Please note that two lists cannot be separated by an empty line. Instead you should put a horizonal rule (“thematic break”) between them. You could also use a mark element or a hard line break to separate the two lists:

# One
# Two
[!sep]
# Uno
# Due
---
# Eins
# Zwei
\
# Une
# Deux

is rendered in HTML as

  1. One
  2. Two

  1. Uno
  2. Due

  1. Eins
  2. Zwei
  1. Une
  2. Deux

Here an example using multiple paragraphs:

* Para A-1

  Para A-2
* Para B-1
  (continued)

  Para B-2
** Para B.b-1

   Para B.b-2
  Para B-3

is rendered in HTML as

  • Para A-1

    Para A-2

  • Para B-1 (continued)

    Para B-2

    • Para B.b-1

      Para B.b-2

    Para B-3