reStructuredText and Sphinx Reference

Example based gentle reference of the reStructuredText and Sphinx syntax, directives, roles and common issues. It demonstrates almost all the markup making it also good for testing Sphinx themes. Free and open-source.

Body elements

Body elements are big group of various elements that serve as a container for another body or inline elements like strong, inline image, etc. They create “blocks” with usually entire available width and height equal to its child elements.

Inline and block elements

reStructuredText contains two types of elements: block and inline-level.

Block-level elements appear in the text as the rectangular objects which do no break across lines. Examples of block elements: section title, paragraph, bullet list, and many more.

Inline elements are part of the document text flow and they do break across lines. Inlines are e.g. emphasis (italic), strong emphasis (bold), inline literal (code example in monospace font) and few more.

It is very intuitive to differentiate between inline and block elements.

_images/block-vs-inline-elements.png

Previous: Admonitions | Next: Images