-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Intersphinx Mapping link not working with Plotly objects in signature #12360
Comments
The example you're showing is convoluted to say the least, i.e: Keyword Args:
figure (:py:class:`Figure<plotly.graph_objects.Figure>`):
The figure that draws contents of the scene. Here, unless I'm mistaken, you're not "declaring" but inserting an explicit cross-reference in the type field. So The usual way of writing these links would be using the shortened The surest way to get this working, currently, is to explicitly write the return type into the docstring (notice that the one field/link you're complaining about is the one you're not writing out explicitly but instead expect Sphinx to extract&link automatically from the signature, so instead of: Return:
The canvas or figure that is reused for this context. try writing the type explicitly: Returns:
Figure: Description of return value or with the path as specified in the docs in the link until you find what works: Returns:
~.plotly.graph_objects.Figure: Description of return value |
I think you misunderstood my problem. This example you cite works properly (i.e., where I put The issue comes from the return type, that is obtained from the type signature (using For all return values, I get a clickable link, except from |
Exactly! You should post this issue at their repository since it's their extension that proposes to extract the type from the signature.
I understood it perfectly fine! |
Ok, will do that then :-) |
Describe the bug
Hello,
For some (unknown) reasons, it appears that Sphinx does not correctly link to the objects if they were defined in the signature. I would love to have all my external references actually work.
The following code
produces:
As you can see, the handwritten reference to
Figure
is clickable, but not the one from the signature.This is also in other online documentation, see
plot_terminator_improvement
from the Neptuna Python package:In this function, I return one of three possible plot types, and we can clearly see that the only one failing is the Ploty one:
How to Reproduce
I don't have much time to build a minimal example, but I can link to my docs: https://differt.eertmans.be/v0.0.12/reference/differt.plotting.html#differt.plotting.process_plotly_kwargs.
Environment Information
Sphinx extensions
The text was updated successfully, but these errors were encountered: