Just for reference: I've asked practically the same thing here 
<https://groups.google.com/forum/#!topic/sphinx-users/IWcYyOzJ_Lk> but got 
no response yet. I included an example repository if someone wants to have 
a go at this.

Am Mittwoch, 24. Juni 2020 13:21:31 UTC+2 schrieb Yury Gorishniy:
>
> 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/0d6c454c-6561-441b-b25f-ec1089a623d4o%40googlegroups.com.

Reply via email to