Chilipp / autodocsumm

Extending your autodoc API docs with a summary
Apache License 2.0
48 stars 14 forks source link

No links to items in summary tables when using __init__.py imports #65

Closed raymanP closed 2 years ago

raymanP commented 2 years ago

Hi dears, if having an module import in __init__.py the links are missing for the class. Sphinx is showing the links correctly, .e.g. for :meth:`mymodule.myclass.mymethod` for the below example.

Example:

.. autoclasssumm:: myclass :autosummary-members:

Chilipp commented 2 years ago

hey @raymanP! I wonder what you get with

.. autosummary::

    myclass.mymethod

Could you please try? I wonder whether this could be related to what I observed quite some time ago in https://github.com/sphinx-doc/sphinx/issues/9069

raymanP commented 2 years ago

hey @Chilipp! Thank you for your fast reply! This also produces an entry without a link. I already tried all possibilities I could imagine.

Classes in the same module which are not in the __init__.py are linked correctly.

Chilipp commented 2 years ago

hey @raymanP! thanks for the confirmation! this is what I expected. It's an upstream issue in autosummary, https://github.com/sphinx-doc/sphinx/issues/9069. It would work, if you import from mymodule.mysubmodule import myclass as _myclass, but unfortunately I do not have any other workaround. One would need to fix the upstream issue

raymanP commented 2 years ago

Great to know.. Thank you @Chilipp! Then I will wait for the upstream fix. :)

raymanP commented 2 years ago

Then we can close this here. Have a nice day ;)