if we have a submodule something with a function something inside that submodule, both the function and submodule should appear in the generated docs.
Actual Behavior
only the function appears in the docs. this is because in the self.doc dict of a pdoc.Module, they will have the same key and thus the module will never be added.
on line 755 we have:
for root in iter_modules(self.obj.__path__):
# Ignore if this module was already doc'd.
if root in self.doc:
continue
but this erroneously skips adding the submodule.
the fix might be as simple as appending :module to the root key before we store it in the dict, but I'm not sure if this would break things downstream.
Expected Behavior/Steps to reproduce
if we have a submodule
something
with a functionsomething
inside that submodule, both the function and submodule should appear in the generated docs.Actual Behavior
only the function appears in the docs. this is because in the
self.doc
dict of apdoc.Module
, they will have the same key and thus the module will never be added.on line 755 we have:
but this erroneously skips adding the submodule.
the fix might be as simple as appending
:module
to theroot
key before we store it in the dict, but I'm not sure if this would break things downstream.Additional info