machow / quartodoc

Generate API documentation with quarto
https://machow.github.io/quartodoc
MIT License
181 stars 21 forks source link

Inherit docstrings from Base to Derived Class #295

Open ktsitsi opened 1 year ago

ktsitsi commented 1 year ago

I have the case where multiple classes (Derived Classes) - which are implementations of a Base Class - do not inherit the docstrings of abstract functions and attributes of the latter. Although I looked it up I could not really find some option to enable it. I mostly need this cause in the general inheritance case I wouldn't want to make the code verbose with copies of the same docstring in the function & properties of each of the derived class.

Looking up the issues I found this one https://github.com/machow/quartodoc/issues/224. But it does not quite fit my case. I think that it should be sth similar to Sphinx's autodoc_inherit_docstrings = True

machow commented 1 year ago

Hey, thanks for raising this! There is some discussion on https://github.com/mkdocstrings/griffe/issues/96 about adding this functionality to griffe, the tool we use to find python objects.

I think we should have everything to add an inherit_docstrings option to quartodoc, but haven't implemented yet.

edit: linking to the sphinx code so it's easy to find later