Re: Including code blocks in a list without breaking the item numbering
Posted by
mojavelinux on
Jun 09, 2014; 7:34am
URL: https://discuss.asciidoctor.org/Including-code-blocks-in-a-list-without-breaking-the-item-numbering-tp1781p1800.html
Andy,
Another convention I strongly recommend when using complex content in a list item is to nest that content in an open block. The open block effectively becomes a "catch-all" container that explicitly sets the boundaries of the list item.
Here's an example:
. Item #1
+
--
attached paragraph
[source,java]
----
public class Person {
private String name;
// ...
}
----
another paragraph
--
. Item #2
We are discussing the option of allowing the list continuation lines (the lines with the + sign) to be indented so they are easier to trace. Many users, including myself, sense a friction with aligning the list continuation with the margin. See
https://github.com/asciidoctor/asciidoctor/issues/686.
Cheers,