Clever reST¶

Place ‘List’ in ‘Empty List Item’ in ‘Definition Description’¶

Goal:

This is what we want to achieve:

<dl>
<dt>
Message
</dt>
<dd>
<ul>
<li>
<!-- WE DON'T WANT ANY OTHER TEXT HERE -->
<ul>
<li>Hello</li>
<li>World!</li>
</ul>
</li>
</ul>
</dd>
</dl>


reST source:

This is the reST code we write. Message is going to be the definition term DT because (1) the next line is NOT empty (2) AND it is indented. That creates a definition list DL. Then we use the star * to open a list item LI of an unordered list UL. The list item consists of nothing but a nested list for which we are using the plus sign + - just because it looks nice. Any allowed character would do. As usual the nested list is preceded by (at least) one empty line and it is indented. The empty lines 6 and 11 are optional and could be multiple empty lines:

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Message * + Hello + World! * + Hello + World! * + Hello + World! 

Result:

And this is how it looks like:

Message
• Hello
• World!
• Hello
• World!
• Hello
• World!