Skip to content

Commit 25ab3d7

Browse files
melissawmAA-Turner
andauthored
Document the autolink role for autosummary (#13596)
Co-authored-by: Adam Turner <[email protected]>
1 parent 74627b2 commit 25ab3d7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

doc/usage/extensions/autosummary.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,3 +412,27 @@ the title of a page.
412412
Stub pages are generated also based on these directives.
413413

414414
.. _`escape filter`: https://jinja.palletsprojects.com/en/3.0.x/templates/#jinja-filters.escape
415+
416+
Autolink role
417+
-------------
418+
419+
.. rst:role:: autolink
420+
421+
The ``:autolink:`` role functions as ``:py:obj:`` when the referenced *name*
422+
can be resolved to a Python object, and otherwise it becomes simple emphasis.
423+
424+
There are some known design flaws.
425+
For example, in the case of multiple objects having the same name,
426+
:rst:role:`!autolink` could resolve to the wrong object.
427+
It will fail silently if the referenced object is not found,
428+
for example due to a spelling mistake or renaming.
429+
This is sometimes unwanted behaviour.
430+
431+
Some users choose to configure their :confval:`default_role` to ``autolink``
432+
for 'smart' referencing using the default interpreted text role (```content```).
433+
434+
.. seealso::
435+
436+
:rst:role:`any`
437+
438+
:rst:role:`py:obj`

0 commit comments

Comments
 (0)