reStructuredText域¶
Added in version 1.0.
reStructured文本域(名称 rst )提供以下指令:
- .. rst:directive:: name¶
描述reStructuredtext指令。的 name 可以是单个指令名称或实际指令语法 (.. 前缀和 :: 后缀)的参数将以不同的方式呈现。例如::
.. rst:directive:: foo Foo description. .. rst:directive:: .. bar:: baz Bar description.
将呈现为:
- .. foo::¶
Foo描述。
- .. bar:: baz¶
酒吧描述。
- .. 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描述。
提供这些角色是为了引用所描述的对象:
- :rst:dir:¶
引用指令和指令选项。例子:
使用
:rst:dir:`my-directive
'引用指令。使用
:rst:dir:`my-directive:my-option
'引用指令选项。