@@ -194,9 +194,24 @@ 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 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:
200
215
201
216
.. code-block :: rst
202
217
@@ -214,7 +229,7 @@ will render as:
214
229
215
230
See the example :doc: `/gallery/lines_bars_and_markers/simple_plot `
216
231
217
- Sections can also be given reference names . For instance from the
232
+ Sections can also be given reference labels . For instance from the
218
233
:doc: `/users/installing/index ` link:
219
234
220
235
.. code-block :: rst
0 commit comments