reStructuredText är en lättläst märksyntax i klartext som används flitigt i Python- och Sphinx-ekosystemet.
Rubriker
Understrykningar (och valfria överstrykningar) anger rubriknivåer:
================
Document Title
================
Section Level 1
===============
Subsection Level 2
------------------
Sub-subsection Level 3
^^^^^^^^^^^^^^^^^^^^^^
Inline-formatering
*emphasis (italics)*
**strong emphasis (bold)**
``inline code literal``
`external hyperlink <https://example.com>`_
Listor & Tabeller
* 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 |
+------------------+------------------+
Direktiv & Kodblock
.. 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.