User login

ReStructured Text

Format code blocks within bulletted lists with ReStructured Text (rst)

The trick is to use the double-colon (::) at the end of the text where you want to introduce the code block with a single colon, and then indent the code block four spaces while only indenting the regular text two spaces. Do this even though you want the non-code lines of text to visually appear at the same indent as the code block and the original introducing line of the bullet.

The following ReStructured Text (ReST) markup, typically put in a .rst file, for example:

Syndicate content