Hi! I have the following setup (the questions are at the end of the post):
sphinx==3.1.1 (also using sphinx.ext.napoleon and
sphinx_autodoc_typehints(typehints_fully_qualified=True,
always_document_param_types=True), but turning the extensions on/off
changes literally nothing).
------------------
- docs
- source
- bar.rst
- baz.rst
- foo
- bar.py
- baz.py
------------------
foo/bar.py:
class Bar:
"""..."""
pass
foo/baz.py:
from third_part import Qux
from .bar import Bar
def baz(x: Bar, y: Qux):
"""..."""
...
docs/source/baz.rst:
foo.baz
=======
.. currentmodule:: foo.baz
.. automodule:: foo.baz
:members:
The problem: everything is correctly parsed in displayed, but "Bar" and
"Qux" in the signature of "baz" are not links, it is plain text.
Intersphinx is correctly configured for "third_party".
1. I've seen somewhere that with third-party modules there are no ways to
make this work. Is it correct?
2. Ok, even if true, is the problem also unsolvable even for .Bar, which is
a part of my package?
I know that I can "solve" 1-2 by putting the types manually in the
docstring, but the whole point is not to duplicate types in the signature
and in the docstring.
3. A related (I think) question. Example:
https://pytorch.org/docs/stable/nn.html#parameters We see that the argument
"data" has the type "Tensor", which is a link(!).
In the source code, they don't do anything special, the just say "data
(Tensor): ...". How did they do that?
--
You received this message because you are subscribed to the Google Groups
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sphinx-users/d580305f-befe-4a16-9621-562f42795d4bo%40googlegroups.com.