1.1. Use of whitespace

All reStructuredText files use an indentation of three (3) spaces; no tabs are allowed. The maximum line length is 80 characters for normal text, but tables, deeply indented code samples and long links may extend beyond that. Code example bodies should use normal four-(4)-space indentation.

Make generous use of blank lines where applicable; they help group things together.

1.1.1. Indentation

Indentation is meaningful in Sphinx and reStructuredText text. Usually, indenting a section means that is “belongs to” the line it is indented under.

for example
1
2
3
4
.. figure:: path-to-image.*

   This is the caption of the figure. Notice that it is indented under
   the line defining the figure.

The rules for indentation are:

  • Use spaces, not tabs.

  • Generally, indent three (3) spaces.

  • Code example, indent four (4) spaces, except reStructuredText examples.

The exception to the three (3) spaces rule is Unordered (bullet) Lists and Ordered (numbered) Lists, where indentation follows the content of the list item.

unordered (bulleted) list

(2) spaces
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
* This is a list item.

  This is some additional content related to first item. Notice that
  it is indented to the same column as the first line of content.
  In this case, that's three (2) spaces.

.
.
.

* The N-th item in a list.

ordered (numbered) list

(4) spaces
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
1.  This is a list item.

    This is some additional content related to Item 1. Notice that
    it is indented to the same column as the first line of content.
    In this case, that's three (3) spaces.

.
.
.

10. The tenth item in a list.

    This related content will be indented four (4) spaces.