reStructuredText 領域

版本 1.0 新增。

reStructuredText 領域 (名稱 rst) 提供以下指令

.. rst:directive:: name

描述 reStructuredText 指令。name 可以是單一指令名稱或實際的指令語法 (包含 .. 前綴和 :: 後綴),以及會以不同方式呈現的參數。例如

.. rst:directive:: foo

   Foo description.

.. rst:directive:: .. bar:: baz

   Bar description.

將會呈現為

.. foo::

Foo 描述。

.. bar:: baz

Bar 描述。

.. rst:directive:option:: name

描述 reStructuredText 指令的選項。name 可以是單一選項名稱或包含參數的選項名稱,參數以冒號 (:) 分隔。例如

.. rst:directive:: toctree

   .. rst:directive:option:: caption: caption of ToC

   .. rst:directive:option:: glob

將會呈現為

.. toctree::
:caption: ToC 標題
:glob

選項

:type: 參數 描述 (文字)

描述選項值的類型。

例如

.. rst:directive:: toctree

   .. rst:directive:option:: maxdepth
      :type: integer or no value

版本 2.1 新增。

.. rst:role:: name

描述 reStructuredText 角色。例如

.. rst:role:: foo

   Foo description.

將會呈現為

:foo:

Foo 描述。

提供這些角色以參考描述的物件

:rst:dir:

參考指令和指令選項。範例

  • 使用 :rst:dir:`my-directive` 來參考指令。

  • 使用 :rst:dir:`my-directive:my-option` 來參考指令選項。

:rst:role:

參考角色。範例::rst:role:`my-role`