*emphasis* | Italic text |
**strong emphasis** | Bold text |
``inline literal`` | Inline code |
`interpreted text` | Interpreted text (role) |
:role:`text` | Role with explicit name |
|substitution| | Substitution reference |
_`inline target` | Inline target |
`link text`_ | Hyperlink reference |
======
Title
====== | Title (overline + underline) |
Section
======= | Section (underline) |
Subsection
---------- | Subsection |
Subsubsection
^^^^^^^^^^^^ | Subsubsection |
Paragraph
""""""""" | Paragraph |
* Item 1
* Item 2 | Bullet list |
- Item 1
- Item 2 | Bullet list (dash) |
1. First
2. Second | Numbered list |
#. Auto-numbered | Auto-numbered list |
term
Definition | Definition list |
:field: value | Field list |
-a option a
-b option b | Option list |
::
code block | Literal block |
text::
code | Paragraph-attached block |
.. code-block:: python
code | Code block with syntax |
>>> print("hello")
hello | Doctest block |
Indented paragraph | Block quote |
| Line 1
| Line 2 | Line block |
-- Attribution | Attribution |
https://example.com | Standalone URL |
`Link text <https://url>`_ | Inline link |
`Link text`_
.. _Link text: url | Named reference |
`anonymous link`__
__ url | Anonymous link |
section_
.. _section: | Internal reference |
:ref:`label` | Reference to label |
:doc:`document` | Reference to document |
:py:func:`function` | Python function ref |
:py:class:`Class` | Python class ref |
:py:mod:`module` | Python module ref |
:download:`file.zip` | Downloadable file |
text [1]_
.. [1] Footnote text | Numbered footnote |
text [#]_
.. [#] Auto footnote | Auto-numbered footnote |
text [#name]_
.. [#name] Named | Named auto-footnote |
text [*]_
.. [*] Symbol footnote | Symbol footnote |
[citation]_
.. [citation] Citation text | Citation |
.. note::
Note text | Note admonition |
.. warning::
Warning text | Warning admonition |
.. tip::
Tip text | Tip admonition |
.. important::
Important text | Important admonition |
.. danger::
Danger text | Danger admonition |
.. seealso::
See also text | See also |
.. image:: path/image.png | Image |
.. figure:: path/image.png
:caption: Caption | Figure with caption |
.. contents:: | Table of contents |
.. toctree::
:maxdepth: 2
doc1
doc2 | TOC tree |
.. include:: filename.rst | Include file |
.. raw:: html
<br> | Raw content |
.. image:: img.png
:width: 200px | Width option |
.. image:: img.png
:height: 100px | Height option |
.. image:: img.png
:scale: 50% | Scale option |
.. image:: img.png
:alt: Alt text | Alt text option |
.. image:: img.png
:align: center | Alignment option |
+-------+-------+
| A | B |
+=======+=======+
| 1 | 2 |
+-------+-------+ | Grid table |
===== =====
A B
===== =====
1 2
===== ===== | Simple table |
.. csv-table:: Title
:header: "A", "B"
1, 2
3, 4 | CSV table directive |
.. csv-table::
:file: data.csv | CSV from file |
.. list-table::
:header-rows: 1
* - A
- B
* - 1
- 2 | List table |
.. automodule:: module
:members: | Auto-document module |
.. autoclass:: Class
:members: | Auto-document class |
.. autofunction:: function | Auto-document function |
.. versionadded:: 1.0 | Version added |
.. versionchanged:: 2.0 | Version changed |
.. deprecated:: 3.0 | Deprecated |
:math:`E = mc^2` | Inline math |
:abbr:`HTML (HyperText Markup Language)` | Abbreviation |
:guilabel:`OK` | GUI label |
:menuselection:`File --> Save` | Menu selection |
:kbd:`Ctrl+C` | Keyboard input |
:command:`ls` | OS command |
:file:`path/to/file` | File path |