@@ -194,9 +194,25 @@ nor the ````literal```` role:
194
194
Refer to other documents and sections
195
195
-------------------------------------
196
196
197
- Sphinx _ allows internal references _ between documents.
197
+ Sphinx _ supports internal references _:
198
198
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 (associated link to an anchor associated with a heading
204
+ with a section)
205
+ ========== =========================== ===========================================
206
+
207
+ .. The following is a hack to have a link with literal formatting
208
+ See https://stackoverflow.com/a/4836544 and https://sphinx-doc.org/faq.html#reference-to-arbitrary-locations-in-external-documents
209
+
210
+ .. |doc-dir | replace :: ``:doc: ``
211
+ .. _doc-dir : https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-doc
212
+ .. |ref-dir | replace :: ``:ref: ``
213
+ .. _ref-dir : https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-ref
214
+
215
+ Examples:
200
216
201
217
.. code-block :: rst
202
218
@@ -214,7 +230,7 @@ will render as:
214
230
215
231
See the example :doc: `/gallery/lines_bars_and_markers/simple_plot `
216
232
217
- Sections can also be given reference names . For instance from the
233
+ Sections can also be given reference labels . For instance from the
218
234
:doc: `/users/installing/index ` link:
219
235
220
236
.. code-block :: rst
0 commit comments