sphinx/doc/usage/domains/restructuredtext.rst

101 lines
2.1 KiB
ReStructuredText
Raw Normal View History

2023-10-01 13:10:18 -05:00
.. highlight:: rst
2023-10-01 14:03:34 -05:00
===========================
2023-10-01 13:10:18 -05:00
The reStructuredText Domain
2023-10-01 14:03:34 -05:00
===========================
2023-10-01 13:10:18 -05:00
2023-10-01 14:04:02 -05:00
.. versionadded:: 1.0
2023-10-01 13:10:18 -05:00
The reStructuredText domain (name **rst**) provides the following directives:
.. rst:directive:: .. rst:directive:: name
Describes a reStructuredText directive.
The *name* can be a single directive name or actual directive syntax
(`..` prefix and `::` suffix) with arguments that will be rendered differently.
For example::
2023-10-01 13:10:18 -05:00
.. rst:directive:: foo
Foo description.
.. rst:directive:: .. bar:: baz
Bar description.
will be rendered as:
.. rst:directive:: foo
2023-10-02 04:01:41 -05:00
:no-contents-entry:
:no-index-entry:
2023-10-01 13:10:18 -05:00
Foo description.
.. rst:directive:: .. bar:: baz
2023-10-02 04:01:41 -05:00
:no-contents-entry:
:no-index-entry:
2023-10-01 13:10:18 -05:00
Bar description.
.. rst:directive:: .. rst:directive:option:: name
Describes an option for reStructuredText directive. The *name* can be a single option
2023-10-01 13:10:18 -05:00
name or option name with arguments which separated with colon (``:``).
For example::
.. rst:directive:: toctree
.. rst:directive:option:: caption: caption of ToC
.. rst:directive:option:: glob
will be rendered as:
.. rst:directive:: toctree
:no-index:
.. rst:directive:option:: caption: caption of ToC
:no-index:
.. rst:directive:option:: glob
:no-index:
.. rubric:: options
.. rst:directive:option:: type: description of argument
:type: text
Describe the type of option value.
For example::
.. rst:directive:: toctree
.. rst:directive:option:: maxdepth
:type: integer or no value
.. versionadded:: 2.1
.. rst:directive:: .. rst:role:: name
Describes a reStructuredText role. For example::
2023-10-01 13:10:18 -05:00
.. rst:role:: foo
Foo description.
will be rendered as:
.. rst:role:: foo
2023-10-02 04:01:41 -05:00
:no-contents-entry:
:no-index-entry:
2023-10-01 13:10:18 -05:00
Foo description.
.. _rst-xref-roles:
2023-10-01 13:10:18 -05:00
These roles are provided to refer to the described objects:
.. rst:role:: rst:dir
rst:role