Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eae95fc

Browse filesBrowse files
timhoffmstory645
andcommitted
DOC: Clarify the difference between document and section references
Co-authored-by: hannah <story645@gmail.com>
1 parent 0dc8c2f commit eae95fc
Copy full SHA for eae95fc

File tree

Expand file treeCollapse file tree

1 file changed

+18
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+18
-3
lines changed

‎doc/devel/document.rst

Copy file name to clipboardExpand all lines: doc/devel/document.rst
+18-3Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,24 @@ nor the ````literal```` role:
194194
Refer to other documents and sections
195195
-------------------------------------
196196

197-
Sphinx_ allows internal references_ between documents.
197+
Sphinx_ supports internal references_:
198198

199-
Documents can be linked with the ``:doc:`` directive:
199+
========== =============== ===========================================
200+
Role Links target Representation in rendered HTML
201+
========== =============== ===========================================
202+
|doc-dir|_ document link to a page
203+
|ref-dir|_ reference label link to an anchor associated with a heading
204+
========== =============== ===========================================
205+
206+
.. The following is a hack to have a link with literal formatting
207+
See https://stackoverflow.com/a/4836544
208+
209+
.. |doc-dir| replace:: ``:doc:``
210+
.. _doc-dir: https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-doc
211+
.. |ref-dir| replace:: ``:ref:``
212+
.. _ref-dir: https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-ref
213+
214+
Examples:
200215

201216
.. code-block:: rst
202217
@@ -214,7 +229,7 @@ will render as:
214229

215230
See the example :doc:`/gallery/lines_bars_and_markers/simple_plot`
216231

217-
Sections can also be given reference names. For instance from the
232+
Sections can also be given reference labels. For instance from the
218233
:doc:`/users/installing/index` link:
219234

220235
.. code-block:: rst

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.