Skip to content
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

Ability to add links in signatures #1059

Closed
shimizukawa opened this issue Jan 3, 2015 · 5 comments
Closed

Ability to add links in signatures #1059

shimizukawa opened this issue Jan 3, 2015 · 5 comments
Labels
extensions:autodoc type:enhancement enhance or introduce a new feature
Milestone

Comments

@shimizukawa
Copy link
Member

When generating autodoc it's not possible to insert links for the types mentioned in the docstring signature:

 |  mymethod(...)
 |      MyModule.mymethod(self, MyThing c, func=None) -> MyResult

Here it would be nice to be able to link to MyThing and MyResult. Even if it's not possible to do it automatically, you could still enclose MyResult in `` either in the source code, or via the autodoc-process-signature event. Same applies to MyThing.

If such a thing is attempted today, the `` will be shown as is in the HTML output, and no hyperlink will be generated.


@shimizukawa shimizukawa added type:enhancement enhance or introduce a new feature extensions:autodoc labels Jan 3, 2015
@wheerd
Copy link
Contributor

wheerd commented Oct 5, 2016

There is an extension that does pretty much that: sphinx-autodoc-typehints

@3nids
Copy link

3nids commented Oct 15, 2019

The extension is actually not doing what is asked, i.e. adding links within the signature. Instead, it introduces annotation where it can in the docstring.
Why can't we have links within the signature?

@tk0miya
Copy link
Member

tk0miya commented Oct 20, 2019

Simply, not implemented yet. All your support is welcome :-)

@tk0miya
Copy link
Member

tk0miya commented Jul 12, 2020

Since 3.0, Sphinx converts type-annotations in function signature to cross references (refs: #7341). I think this issue was already resolved. Closing now!

@tk0miya tk0miya closed this as completed Jul 12, 2020
@tk0miya tk0miya added this to the 3.0.0 milestone Jul 12, 2020
@3nids
Copy link

3nids commented Jul 13, 2020

awesome, thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions:autodoc type:enhancement enhance or introduce a new feature
Projects
None yet
Development

No branches or pull requests

4 participants