Skip to content

Commit

Permalink
Make a dedicated section for cross-reference syntax in docs
Browse files Browse the repository at this point in the history
... and rename the current "Cross-referencing syntax" page
to "Cross-references", of which "Syntax" is one subsection.
  • Loading branch information
timhoffm committed Oct 7, 2024
1 parent b832ce5 commit daa076f
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 daa076f

Please sign in to comment.