reStructuredText 域¶
Added in version 1.0.
reStructuredText领域(名称**rst**)提供以下指令:
- .. rst:directive:: name¶
描述一个reStructuredText指令.*名称*可以是单个指令名称或实际指令语法( .. 前缀和 :: 后缀),带有将以不同方式渲染的参数.例如:
.. 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: caption of ToC
- :glob:
选项
- :type: description of argument (text)¶
描述选项值的类型.
例如:
.. rst:directive:: toctree .. rst:directive:option:: maxdepth :type: integer or no value
Added in version 2.1.
- .. rst:role:: name¶
描述一个 reStructuredText 角色.例如:
.. rst:role:: foo Foo description.
将呈现为:
- :foo:¶
Foo 描述.
这些角色用于引用所描述的对象: