reStructuredText域¶
在 1.0 版本加入.
reStructuredText域(名称 rst)提供以下指令:
- .. rst:directive:: name¶
描述一个reStructuredText指令。name 可以是单个指令名称或实际的指令语法(
..前缀和::后缀),带有将以不同方式呈现的参数。例如:.. rst:directive:: foo Foo description. .. rst:directive:: .. bar:: baz Bar description.
将呈现为:
- .. foo::¶
Foo description.
- .. bar:: baz¶
Bar description.
- .. rst:directive:option:: name¶
描述reStructuredText指令的选项。name 可以是单个选项名称或带有参数的选项名称,参数用冒号(
:)分隔。例如:.. rst:directive:: toctree .. rst:directive:option:: caption: caption of ToC .. rst:directive:option:: glob
将呈现为:
- .. toctree::
- :caption: caption of ToC
- :glob:
选项
- :type: description of argument (text)¶
描述选项的值的类型。
例如:
.. 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 description.
提供这些角色是为了引用所描述的对象:
- :rst:dir:¶
引用指令和指令选项。示例:
使用
:rst:dir:`my-directive`引用一个指令。使用
:rst:dir:`my-directive:my-option`引用一个指令选项。
- :rst:role:¶
引用一个角色。示例:
:rst:role:`my-role`。