This page is not available in every language. Missing translations are disabled in the language selector.

Quick reference

reStructuredText (RST) Cheatsheet

A quick reference guide for reStructuredText (RST): syntax headings, inline markup, directives, lists, code blocks, and Sphinx conventions.

· Published

reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax used extensively in the Python and Sphinx documentation ecosystems.

Headings

Underlines (and optional overlines) define header levels:

================
Document Title
================

Section Level 1
===============

Subsection Level 2
------------------

Sub-subsection Level 3
^^^^^^^^^^^^^^^^^^^^^^

Inline Formatting

*emphasis (italics)*
**strong emphasis (bold)**
``inline code literal``
`external hyperlink <https://example.com>`_

Lists & Tables

* Bullet item 1
* Bullet item 2

1. Numbered item 1
2. Numbered item 2

+------------------+------------------+
| Header Column 1  | Header Column 2  |
+==================+==================+
| Cell 1, 1        | Cell 1, 2        |
+------------------+------------------+

Directives & Code Blocks

.. code-block:: python
    :linenos:

    def greet(name):
        return f"Hello, {name}!"

.. note::
    This is an informational callout note.

.. warning::
    This is a critical warning message.

References

Related topics