Skip to content

Commit d9a6e20

Browse files
committed
add labeling of sections inside rst docs
1 parent 0f77371 commit d9a6e20

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

developer/general/rst-documentation-style-guide.rst

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,18 +295,37 @@ Please continue using the above or new ones where appropriate.
295295
Cross referencing:
296296
^^^^^^^^^^^^^^^^^^
297297

298-
Use the `:doc:` role with a path
299298

300-
.. code:: rst
299+
- Use the `:doc:` role with a path and a custom link text:
300+
301+
302+
.. code:: rst
301303
302304
:doc:`contributions </introduction/contributing>`.
303305
306+
- Use the `:doc:` role with a path:
304307

305-
use `:ref:` for specific sections
308+
.. code:: rst
306309
307-
.. code:: rst
310+
:doc:`/introduction/intro`
311+
312+
- Use `:ref:` for specific sections and a custom link text
313+
314+
.. code:: rst
315+
316+
317+
:ref:`What is Qubes OS? <introduction/intro:what is qubes os?>`
318+
319+
- Use `:ref` only with a unique label above the specific section:
320+
321+
.. code:: rst
322+
323+
.. _cross_referencing:
324+
325+
TL;DR: Cross-referencing
326+
------------------------
308327
309-
:ref:`qubes <user/reference/glossary:qube>`
328+
and link to the section from within the documentation using :code:`:ref:`cross_referencing``.
310329

311330

312331
For further information please see :ref:`cross_referencing`.

0 commit comments

Comments
 (0)