====== Working with Lists ======
===== Multiline List Items =====
:?: How can I add a code block or multiple lines in a list item?
:!: The list syntax expects you to put each item in a single line and you may not interrupt numbered lists or the index will restart at 1. This makes it impossible to add tables into a list item for example. However you can add code/file block or line breaks in a list item. For code blocks make sure they start on the same line as your item, for linebreaks use the forced line break syntax ''%%\\%%''.
Here's an example:
- first item
- second item with linebreak\\ second line
- third item with code:
some code
comes here
- fourth item
Which renders like this:
- first item
- second item with linebreak\\ second line
- third item with code:
some code
comes here
- fourth item
You can use the same trick to include other syntax like tables into a list by using the [[plugin:wrap]] plugin to wrap your table.
===== Continue List Numbering =====
:?: Is it possible to have two ordered lists, with the second picking up numbering at where the first stopped?
:!: No, that's currently not possible with the default list syntax. As soon as one list finishes, the numbering restarts:
- first item
- second item
No longer a list
- third item? no, it's the first item of the second list
- first item
- second item
No longer a list
- third item? no, it's the first item of the second list
===== Styling the List Numbering =====
:?: I don't like the default list numbering of ordered lists. How can I change it?
:!: The number format is defined through CSS. The default template defines formatting for the first 4 list levels like this:
div.dokuwiki ol { list-style-type: decimal; }
div.dokuwiki ol ol { list-style-type: upper-roman; }
div.dokuwiki ol ol ol { list-style-type: lower-alpha; }
div.dokuwiki ol ol ol ol { list-style-type: lower-greek; }
You can easily override this in your [[devel:css#user_styles|userstyle.css]].
===== List Plugins =====
There are several plugins that implement alternative syntax for lists and might make things possible that can't be achieved by the default syntax. See [[plugintag>list|Plugins tagged with "list"]].