Skip to content

Commit e62b09c

Browse files
committed
feat: compress logic
1 parent 2926b95 commit e62b09c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

autoapi/mappers/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,10 @@ def output_child_rst(self, obj, obj_parent, detail_dir, source_suffix):
359359
# should be created for a class and its children:
360360
# detail_dir / obj_parent_name / index.rst (example/Foo/index.rst)
361361
# detail_dir / obj_parent_name / obj_name.rst (example/Foo/foo.rst)
362-
own_page_level = self.app.config.autoapi_own_page_level
362+
function_page_level = _OWN_PAGE_LEVELS.index("function")
363+
is_level_beyond_function = function_page_level < desired_page_level
363364
if obj.type in ["exception", "class"]:
364-
if own_page_level == "function":
365+
if not is_level_beyond_function:
365366
outfile = f"{obj.short_name}{source_suffix}"
366367
path = os.path.join(detail_dir, outfile)
367368
else:

0 commit comments

Comments
 (0)