sbi icon indicating copy to clipboard operation
sbi copied to clipboard

Automaticity for building API docs

Open jan-matthis opened this issue 6 years ago • 4 comments

  • Currently, methods of parent classes are not listed in reference docs. Luckily, this will be addressed in a future version of mkdocstrings, see https://github.com/pawamoy/mkdocstrings/issues/78, https://github.com/pawamoy/pytkdocs/issues/18
  • We would like to avoid repetition of parameters in abstract classes and children which inherit from them. This would require merging the "Args: " sections of the respective strings. We could write our own function/decorator to do that. Alternatively, we could potentially contribute this functionality to custom_inherit, a package which tackles the problem of docstring inheritance supporting numerous docstring styles including ours, see: https://github.com/rsokl/custom_inherit/issues/25

jan-matthis avatar Apr 09 '20 12:04 jan-matthis

This might be an alternative plugin to use for API docs, just came out a few days ago: https://github.com/daizutabi/mkapi

jan-matthis avatar Jun 16 '20 12:06 jan-matthis

@jan-matthis mkdocstrings now support inheritance, if you want to give it a try :slightly_smiling_face:

pawamoy avatar Jun 22 '20 16:06 pawamoy

@pawamoy Thanks a lot! Gave it a try, and inheritance is working now 🚀

There is one issue remaining before making use of it: With inheritance in place, __call__ gets listed before __init__ due to alphabetical sorting. This might be confusing to users, so I'll probably wait for https://github.com/pawamoy/mkdocstrings/issues/102, https://github.com/pawamoy/pytkdocs/issues/29 before adopting

jan-matthis avatar Jun 23 '20 13:06 jan-matthis

Context for hackathon: I created a PR draft that addresses this but needs further work. I suggest reading the #964 description and understand the concept of mkdocs and mkdocstring via the comments here, and then continue working on #964.

janfb avatar Mar 01 '24 08:03 janfb