Comments (4)
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 Figure
is your shortened alias for the link to plotly.graph_objects.Figure
. (Needless to say for this to work properly you'll need intersphinx correctly setup for plotly).
The usual way of writing these links would be using the shortened ~
syntax, so you'd write ~plotly.graph_objects.Figure
or just .Figure
- note that on occasion Sphinx won't be able to resolve all links depending on the context and if the referenced class is affected by one of the bugs listed in #11991
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
from sphinx.
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
Figure
is your shortened alias for the link toplotly.graph_objects.Figure
. (Needless to say for this to work properly you'll need intersphinx correctly setup for plotly).The usual way of writing these links would be using the shortened
~
syntax, so you'd write~plotly.graph_objects.Figure
or just.Figure
- note that on occasion Sphinx won't be able to resolve all links depending on the context and if the referenced class is affected by one of the bugs listed in #11991The 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 figure (:py:class:
Figure<plotly.graph_objects.Figure>)
), because the link is actually clickable.
The issue comes from the return type, that is obtained from the type signature (using "sphinx_autodoc_typehints"
extension).
For all return values, I get a clickable link, except from Figure
objects from Plotly (in the code, from plotly.graph_objects import Figure
.).
from sphinx.
The issue comes from ... (using "sphinx_autodoc_typehints" extension).
Exactly! You should post this issue at their repository since it's their extension that proposes to extract the type from the signature.
I think you misunderstood my problem.
I understood it perfectly fine!
from sphinx.
Ok, will do that then :-)
from sphinx.
Related Issues (20)
- LaTeX/ImageConverter: Regression with `data:` URIs HOT 1
- Have emoji and U+28FF working in sphinx ``lualatex`` generated for titles and code HOT 6
- Should `defusedxml` be moved to the runtime dependencies? HOT 5
- When compiling linux kernel(drm-tis), failed at module `docutils.nodes` for no attribute โreprunicodeโ HOT 11
- sphinx-build hard-codes the python path into the exe HOT 7
- ext.napoleon to work with ext.todo HOT 2
- `:loading: embed` on images does not work as expected HOT 7
- ``todo`` directive treat repeated special characters as headers
- toc_object_entries uses language (Python) scoping instead of documentation scoping HOT 2
- TOWER_HOST=https://awx.example.org TOWER_USERNAME=example TOWER_PASSWORD=secret make clean html HOT 1
- Index pages use `–` but it can not be used in ePub HOT 3
- Internationalization doc mentions deprecated transifex-client HOT 1
- 7.3.7: missing `defusedxml` install time dependency HOT 2
- THYDUX COIN ๐ ๐ฅ
- Multiple labels inside math directives HOT 1
- LaTeX: footnote mark may indicate "Page N, M" but footnote M is already on page N
- Gettext builder cannot extract 'option' directive HOT 3
- `autodoc_class_signature = "separated"` cause a warning for enum with no `__init__` HOT 12
- [search] issues with the new HTML search algorithm HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sphinx.