You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

67 lines
1.4 KiB

////
Included in:
- user-manual: Ordered lists: Introduction
- writers guide: ordering the things
////
Sometimes, we need to number the items in a list.
Instinct might tell you to prefix each item with a number, like in this next list:
[source]
----
include::ex-o-list.adoc[tag=base-num]
----
The above works, but
since the numbering is obvious, the AsciiDoc processor will insert the numbers for you if you omit them:
[source]
----
include::ex-o-list.adoc[tag=base]
----
====
include::ex-o-list.adoc[tag=base]
====
If you decide to use number for your ordered list, you have to keep them sequential.
This differs from other lightweight markup languages.
It's one way to adjust the numbering offset of a list.
For instance, you can type:
[source]
----
include::ex-o-list.adoc[tag=base-num-start]
----
However, in general the best practice is to use the `start` attribute to configure this sort of thing:
[source]
----
include::ex-o-list.adoc[tag=base-start]
----
To present the items in reverse order, add the `reversed` option:
[source]
----
include::ex-o-list.adoc[tag=reversed]
----
====
include::ex-o-list.adoc[tag=reversed]
====
You can give a list a title by prefixing the line with a dot immediately followed by the text (without leaving any space after the dot).
Here's an example of a list with a title:
[source]
----
include::ex-o-list.adoc[tag=base-t]
----
====
include::ex-o-list.adoc[tag=base-t]
====