mirror of
https://github.com/readthedocs/sphinx-autoapi
synced 2024-11-19 15:25:31 +00:00
Fixed autodoc not documenting anything in submodules or subpackages
This commit is contained in:
parent
a1f1fd8651
commit
66cf2ed4d0
@ -36,18 +36,20 @@ class AutoapiDocumenter(autodoc.Documenter):
|
||||
raise AttributeError(name)
|
||||
|
||||
def import_object(self):
|
||||
path_stack = list(reversed(self.fullname.split('.')))
|
||||
objects = self.env.autoapi_mapper.objects
|
||||
parent = objects[utils.slugify(path_stack.pop())]
|
||||
while parent and path_stack:
|
||||
parent = self.get_attr(parent, path_stack.pop(), None)
|
||||
max_splits = self.fullname.count('.')
|
||||
for num_splits in range(max_splits, 0, -1):
|
||||
path_stack = list(reversed(self.fullname.rsplit('.', num_splits)))
|
||||
objects = self.env.autoapi_mapper.objects
|
||||
parent = objects[path_stack.pop()]
|
||||
while parent and path_stack:
|
||||
parent = self.get_attr(parent, path_stack.pop(), None)
|
||||
|
||||
if not parent:
|
||||
return False
|
||||
if parent:
|
||||
self.object = parent
|
||||
self.object_name = parent.name
|
||||
return True
|
||||
|
||||
self.object = parent
|
||||
self.object_name = parent.name
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_real_modname(self):
|
||||
# Return a fake modname so that nothing can be imported
|
||||
|
Loading…
Reference in New Issue
Block a user