Closed abrahammurciano closed 2 years ago
I found that by setting the __all__
variable in my __init__.py
files to all the things I wanted to import, pdoc3 took it into account and included the documentation one level higher, like I wanted.
For example, in my described setup, I changed my main_module/sub_mod_a/__init__.py
to look like this:
from .file_1 import Class1
from .file_2 import Class2
# I added this:
__all__ = (
"Class1",
"Class2",
)
Background
Suppose I have a directory structure like so:
The classes are imported by their
sub_mod_x
module so you'd be able to import classes like this:instead of the more verbose:
Question
I'd like the pdoc3 page for
main_module.sub_mod_a
to show the full documentation of all the classes that module imports in its__init__.py
instead of showing links tomain_module.sub_mod_a.file_1
andmain_module.sub_mod_a.file_2
.Is there a way to do this?