@@ -187,9 +187,24 @@ nor the ````literal```` role:
187
187
Referring to other documents and sections
188
188
-----------------------------------------
189
189
190
- Sphinx _ allows internal references _ between documents.
190
+ Sphinx _ supports internal references _:
191
191
192
- Documents can be linked with the ``:doc: `` directive:
192
+ ========== =============== ===========================================
193
+ Role Links target Representation in rendered HTML
194
+ ========== =============== ===========================================
195
+ |doc-dir |_ document link to a page
196
+ |ref-dir |_ reference label link to an anchor associated with a heading
197
+ ========== =============== ===========================================
198
+
199
+ .. The following is a hack to have a link with literal formatting
200
+ See https://stackoverflow.com/a/4836544
201
+
202
+ .. |doc-dir | replace :: ``:doc: ``
203
+ .. _doc-dir : https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-doc
204
+ .. |ref-dir | replace :: ``:ref: ``
205
+ .. _ref-dir : https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-ref
206
+
207
+ Examples:
193
208
194
209
.. code-block :: rst
195
210
@@ -207,7 +222,7 @@ will render as:
207
222
208
223
See the example :doc: `/gallery/lines_bars_and_markers/simple_plot `
209
224
210
- Sections can also be given reference names . For instance from the
225
+ Sections can also be given reference labels . For instance from the
211
226
:doc: `/users/installing/index ` link:
212
227
213
228
.. code-block :: rst
0 commit comments