Referência rápida

Folha de dicas de reStructuredText (RST)

Guia rápido para reStructuredText (RST): cabeçalhos, marcação inline, diretivas, listas, blocos de código e convenções do Sphinx.

· Publicado

reStructuredText é uma sintaxe de marcação em texto simples legível, amplamente usada nos ecossistemas Python e Sphinx.

Cabeçalhos

Sublinhados (e sobrelinhas opcionais) definem os níveis de título:

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

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

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

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

Formatação inline

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

Listas e tabelas

* 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        |
+------------------+------------------+

Diretivas e blocos de código

.. 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.

Referências

Temas relacionados