Skip to content

Document autolink role for autosummary #13596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

melissawm
Copy link

Purpose

Adds a documentation section on the autosummary "autolink" role.

References

Closes #1535


The ``:autolink:`` role functions as ``:obj:`` when the name referred can be
resolved to a Python object, and otherwise it becomes simple emphasis.
This can be used as the default role to make links 'smart'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we should be more cautious here. I recall problems with users who've used this as a default role, where really they wanted to use py:obj. I don't have time to find discussion links, though, sorry.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see - I found some past issues in the repo.

How about something like

Suggested change
This can be used as the default role to make links 'smart'.
This can be used as the default role to make links 'smart', but must be used carefully. For example, in the case of multiple objects having the same name, `autolink` could resolve to the wrong object.

@AA-Turner
Copy link
Member

Thank you! One brief comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document the :autolink: role
2 participants