Skip to content

Commit

Permalink
Make a dedicated section for cross-reference syntax in docs (#12984)
Browse files Browse the repository at this point in the history
  • Loading branch information
timhoffm authored Oct 7, 2024
1 parent 545eaf5 commit b2d69a7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Sphinx
.. admonition:: 🔗 Powerful Cross-Referencing
:class: sphinx-feature

Create :ref:`cross-references <xref-syntax>`
Create :ref:`cross-references <xref>`
within your project,
and even across :ref:`different projects <ext-intersphinx>`.
Include references to
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/narrative-documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Adding cross-references
-----------------------

One powerful feature of Sphinx is the ability to seamlessly add
:ref:`cross-references <xref-syntax>` to specific parts of the documentation:
:ref:`cross-references <xref>` to specific parts of the documentation:
a document, a section, a figure, a code object, etc. This tutorial is full of
them!

Expand Down
13 changes: 9 additions & 4 deletions doc/usage/referencing.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
.. _xref-syntax:
.. _xref:

========================
Cross-referencing syntax
========================
================
Cross-references
================

One of Sphinx's most useful features is creating automatic cross-references
through semantic cross-referencing roles.
A cross reference to an object description, such as ``:func:`spam```,
will create a link to the place where ``spam()`` is documented,
appropriate to each output format (HTML, PDF, ePUB, etc.).

.. _xref-syntax:

Syntax
------

Sphinx supports various cross-referencing roles to create links
to other elements in the documentation.
In general, writing ``:role:`target``` creates a link to
Expand Down
4 changes: 2 additions & 2 deletions doc/usage/restructuredtext/roles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ They are written as ``:rolename:`content```.
See :doc:`/usage/domains/index` for roles added by domains.


Cross-referencing syntax
------------------------
Cross-references
----------------

See :doc:`/usage/referencing/`.

Expand Down

0 comments on commit b2d69a7

Please sign in to comment.