Literal Blocks

Created on Oct. 26, 2012, 12:28 p.m. by Hevok & updated by Hevok on May 2, 2013, 5:11 p.m.

A paragraph containing only two colons indicates that the following indented or quoted text is a literal block (i.e. where no markup processing is done), which are used e.g. to illustrate plaintext markup.

Whitespace, newlines, blank lines and
all kinds of markup (like *this* or
\this) is preserved by literal blocks.

The paragraph containing only '::'
will be omitted from the result.

The :: may be tracked onto the very end of any paragraph. The :: will be omitted it is preceded by whitespace. The :: will be converted to a single colon if preceded by text, like this:

It's very convenient to use this form.

Literal blocks end when text returns to the preceding paragraph's indentation. This means that something like this is possible:

    We start here
  and continue here
and end here.

Per-line quoting can also be used on unindented literal blocks:

> Useful for quotes from email and
> for Haskell literate programming.

Tags: documentation, rest
Categories: Tutorial
Parent: reStructuredText

Update entry (Admin) | See changes

Comment on This Data Unit