readthedocs / sphinx-autoapi

A new approach to API documentation in Sphinx.
https://sphinx-autoapi.readthedocs.io/
MIT License
439 stars 131 forks source link

If a module/file is skipped via autoapi-skip-member, documentation for child modules/files are still generated #333

Closed richard-engineering closed 2 years ago

richard-engineering commented 2 years ago

Let's say I have a project:

lib
  module_a
    module_a1
    module_a2
  module_b

If I specify module_a to be skipped in autoapi-skip-member, the files for module_a1/module_a2 will still be generated (but not linked to in the documentation for lib/index.html).

I updated my code to also track this to skip the associated child classes as well. While this works in preventing generation of the documention in question, I still get empty lib/module_a/module_a1/index.html files that are generated despite everything in those modules/files being skipped. If a module/file is empty (all marked skipped, nothing links to it), sphinx-autoapi should not generate an empty file.

(Ideally it would be good if we had a way to hook into the children generation code as I am defining inclusion/exclusion on parent objects)

richard-engineering commented 2 years ago

I figured out how to resolve this, and changes might break other use cases.