Make the domain referencing role targets more specific

This commit is contained in:
Adam Turner 2024-07-14 05:54:36 +01:00
parent 00758033d3
commit 26576590ed
9 changed files with 14 additions and 17 deletions

View File

@ -75,7 +75,7 @@ Cross-referencing Python objects
By default, most of these directives generate entities that can be By default, most of these directives generate entities that can be
cross-referenced from any part of the documentation by using cross-referenced from any part of the documentation by using
:ref:`a corresponding role <python-roles>`. For the case of functions, :ref:`a corresponding role <python-xref-roles>`. For the case of functions,
you can use :rst:role:`py:func` for that, as follows: you can use :rst:role:`py:func` for that, as follows:
.. code-block:: rst .. code-block:: rst

View File

@ -85,7 +85,7 @@ introduction paragraph in ``index.rst``:
Check out the :doc:`usage` section for further information. Check out the :doc:`usage` section for further information.
The :rst:role:`doc` :ref:`role <rst-roles-alt>` you used automatically The :rst:role:`doc` :ref:`role <rst-roles>` you used automatically
references a specific document in the project, in this case the ``usage.rst`` references a specific document in the project, in this case the ``usage.rst``
you created earlier. you created earlier.

View File

@ -128,7 +128,7 @@ The C domain (name **c**) is suited for documentation of C API.
Describes a C type, either as a typedef, or the alias for an unspecified Describes a C type, either as a typedef, or the alias for an unspecified
type. type.
.. _c-roles: .. _c-xref-roles:
Cross-referencing C constructs Cross-referencing C constructs
------------------------------ ------------------------------

View File

@ -568,7 +568,7 @@ following fields:
.. versionadded:: 4.3 .. versionadded:: 4.3
The ``retval`` field type. The ``retval`` field type.
.. _cpp-roles: .. _cpp-xref-roles:
Cross-referencing Cross-referencing
----------------- -----------------

View File

@ -120,7 +120,7 @@ The JavaScript domain (name **js**) provides the following directives:
Describes the attribute *name* of *object*. Describes the attribute *name* of *object*.
.. _js-roles: .. _js-xref-roles:
These roles are provided to refer to the described objects: These roles are provided to refer to the described objects:

View File

@ -655,7 +655,7 @@ word "or"::
:vartype a_var: str or int :vartype a_var: str or int
:rtype: float or str :rtype: float or str
.. _python-roles: .. _python-xref-roles:
Cross-referencing Python objects Cross-referencing Python objects
-------------------------------- --------------------------------

View File

@ -91,7 +91,7 @@ The reStructuredText domain (name **rst**) provides the following directives:
Foo description. Foo description.
.. _rst-roles: .. _rst-xref-roles:
These roles are provided to refer to the described objects: These roles are provided to refer to the described objects:

View File

@ -75,11 +75,11 @@ Cross-referencing objects
These roles are described with their respective domains: These roles are described with their respective domains:
* :ref:`Python <python-roles>` * :ref:`Python <python-xref-roles>`
* :ref:`C <c-roles>` * :ref:`C <c-xref-roles>`
* :ref:`C++ <cpp-roles>` * :ref:`C++ <cpp-xref-roles>`
* :ref:`JavaScript <js-roles>` * :ref:`JavaScript <js-xref-roles>`
* :ref:`ReST <rst-roles>` * :ref:`reStructuredText <rst-xref-roles>`
.. _ref-role: .. _ref-role:

View File

@ -53,7 +53,7 @@ Be aware of some restrictions of this markup:
These restrictions may be lifted in future versions of the docutils. These restrictions may be lifted in future versions of the docutils.
It is also possible to replace or expand upon some of this inline markup with It is also possible to replace or expand upon some of this inline markup with
roles. Refer to :ref:`rst-roles-alt` for more information. roles. Refer to :ref:`rst-roles` for more information.
Lists and Quote-like blocks Lists and Quote-like blocks
@ -281,10 +281,7 @@ at the beginning of documents. Refer to :doc:`field-lists` for more
information. information.
.. TODO This ref should be 'rst-roles', but that already exists. Rename the .. _rst-roles:
.. other ones
.. _rst-roles-alt:
Roles Roles
----- -----