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.

Block and inline elements

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

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

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

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

_images/block-vs-inline-elements.png

Previous: Admonitions | Next: Code examples