| 1 |
.. highlight:: rst |
| 2 |
|
| 3 |
=========================== |
| 4 |
The reStructuredText Domain |
| 5 |
=========================== |
| 6 |
|
| 7 |
.. versionadded:: 1.0 |
| 8 |
|
| 9 |
The reStructuredText domain (name **rst**) provides the following directives: |
| 10 |
|
| 11 |
.. rst:directive:: .. rst:directive:: name |
| 12 |
|
| 13 |
Describes a reStructuredText directive. |
| 14 |
The *name* can be a single directive name or actual directive syntax |
| 15 |
(`..` prefix and `::` suffix) with arguments that will be rendered differently. |
| 16 |
For example:: |
| 17 |
|
| 18 |
.. rst:directive:: foo |
| 19 |
|
| 20 |
Foo description. |
| 21 |
|
| 22 |
.. rst:directive:: .. bar:: baz |
| 23 |
|
| 24 |
Bar description. |
| 25 |
|
| 26 |
will be rendered as: |
| 27 |
|
| 28 |
.. rst:directive:: foo |
| 29 |
:no-contents-entry: |
| 30 |
:no-index-entry: |
| 31 |
|
| 32 |
Foo description. |
| 33 |
|
| 34 |
.. rst:directive:: .. bar:: baz |
| 35 |
:no-contents-entry: |
| 36 |
:no-index-entry: |
| 37 |
|
| 38 |
Bar description. |
| 39 |
|
| 40 |
.. rst:directive:: .. rst:directive:option:: name |
| 41 |
|
| 42 |
Describes an option for reStructuredText directive. The *name* can be a single option |
| 43 |
name or option name with arguments which separated with colon (``:``). |
| 44 |
For example:: |
| 45 |
|
| 46 |
.. rst:directive:: toctree |
| 47 |
|
| 48 |
.. rst:directive:option:: caption: caption of ToC |
| 49 |
|
| 50 |
.. rst:directive:option:: glob |
| 51 |
|
| 52 |
will be rendered as: |
| 53 |
|
| 54 |
.. rst:directive:: toctree |
| 55 |
:no-index: |
| 56 |
|
| 57 |
.. rst:directive:option:: caption: caption of ToC |
| 58 |
:no-index: |
| 59 |
|
| 60 |
.. rst:directive:option:: glob |
| 61 |
:no-index: |
| 62 |
|
| 63 |
.. rubric:: options |
| 64 |
|
| 65 |
.. rst:directive:option:: type: description of argument |
| 66 |
:type: text |
| 67 |
|
| 68 |
Describe the type of option value. |
| 69 |
|
| 70 |
For example:: |
| 71 |
|
| 72 |
.. rst:directive:: toctree |
| 73 |
|
| 74 |
.. rst:directive:option:: maxdepth |
| 75 |
:type: integer or no value |
| 76 |
|
| 77 |
.. versionadded:: 2.1 |
| 78 |
|
| 79 |
.. rst:directive:: .. rst:role:: name |
| 80 |
|
| 81 |
Describes a reStructuredText role. For example:: |
| 82 |
|
| 83 |
.. rst:role:: foo |
| 84 |
|
| 85 |
Foo description. |
| 86 |
|
| 87 |
will be rendered as: |
| 88 |
|
| 89 |
.. rst:role:: foo |
| 90 |
:no-contents-entry: |
| 91 |
:no-index-entry: |
| 92 |
|
| 93 |
Foo description. |
| 94 |
|
| 95 |
.. _rst-xref-roles: |
| 96 |
|
| 97 |
These roles are provided to refer to the described objects: |
| 98 |
|
| 99 |
.. rst:role:: rst:dir |
| 100 |
|
| 101 |
Reference directives and directive options. Examples: |
| 102 |
|
| 103 |
* Use ``:rst:dir:`my-directive``` to reference a directive. |
| 104 |
* Use ``:rst:dir:`my-directive:my-option``` to reference a |
| 105 |
directive option. |
| 106 |
|
| 107 |
.. rst:role:: rst:role |
| 108 |
|
| 109 |
Reference a role. Example: ``:rst:role:`my-role```. |