go-org-orgwiki/org/testdata/lists.org
Niklas Fasching 21f1af7d48 Add support for custom numbering of ordered list using [@\d+]
org mode supports [1] setting the value attribute [2] of ordered list items to
change the numbering for the current and following items. Let's do the same. As
the attribute has no meaning for other types of lists [2] we'll just not
support it for those cases [3].

[1] https://orgmode.org/manual/Plain-Lists.html#Plain-Lists
[2] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li#attributes
[3]
Org mode seems to instead set the id attribute for e.g. unordered lists
starting with `[@\d+]\s` - but I don't really see the value in that and will
skip that for now.
2021-04-17 15:43:19 +02:00

1.6 KiB

  • unordered list item 1
  • list item with empty first and second line
    normally an empty line breaks the list item - but we make an exception for the first line and don't count it towards that limit
  • unordered list item 2 - with inline markup

    1. ordered sublist item 1

      1. ordered sublist item 1
      2. ordered sublist item 2
      3. ordered sublist item 3
    2. ordered sublist item 2
    3. list item with empty first and second line - see above
  • unordered list item 3 - and a link and some lines of text

    1. and another subitem

      echo with a block
    2. and another one with a table

      a b c
      1 2 3

      and text with an empty line in between as well!

  • unordered list item 4

    with an example
    
    that spans multiple lines
    

descriptive lists

term
details continued details
?
details without a term
term
details on a new line
term

details on a new line (with an empty line in between) continued

echo "Hello World!"

some list termination tests

  • unordered 1
  • unordered 2
  1. ordered 1
  2. ordered 2
  1. ordered 1
  2. ordered 2
  • unordered 1
  • unordered 2
  1. ordered 1
  2. ordered 2
unordered descriptive
1
unordered descriptive
2
ordered descriptive
1
ordered descriptive
2
  • unordered 1
  • unordered 2
  1. use `[@n]` to change the value of list items
  2. foobar
  3. that even works in combination with list statuses (`[ ]`)