pdoc3 / pdoc

:snake: :arrow_right: :scroll: Auto-generate API documentation for Python projects
https://pdoc3.github.io/pdoc/
GNU Affero General Public License v3.0
1.12k stars 145 forks source link

Exclude empty submodule from docs #374

Open amin-nejad opened 2 years ago

amin-nejad commented 2 years ago

Pdoc by default ignores private classes/functions (names with a leading underscore) in a module from the documentation. However if a module consists entirely of private classes and functions, the submodule still appears within the documentation, except it is simply empty (or displaying just the docstring if there is one). How can I automatically tell pdoc to ignore the module if it doesn't find anything public? I don't want this to be manual because modules change and at some point the module may have something public in it. And I have many modules like this

Additional info

braniii commented 2 years ago

One hack is to make the submodule itself private. Having no public classes or functions, this seems reasonable. But as you pointed out, this is only a hack and not a solution.