クイックリファレンス

reStructuredText (RST) チートシート

reStructuredText (RST) のクイックリファレンス:見出し階層、インライン装飾、リストと表、コードブロック、Sphinx ディレクティブを網羅。

· 公開日

reStructuredText は、Python や Sphinx のドキュメントエコシステムで広く使われている読みやすいプレーンテキストマークアップ構文です。

見出し

下線(および任意の上線)の文字種によって見出しレベルを定義します:

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

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

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

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

インライン装飾

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

リストと表

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

ディレクティブとコードブロック

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

リファレンス

関連テーマ