Skip to content

Commit

Permalink
feat: compress logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgepiloto committed Jan 18, 2024
1 parent 2926b95 commit e62b09c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions autoapi/mappers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,10 @@ def output_child_rst(self, obj, obj_parent, detail_dir, source_suffix):
# should be created for a class and its children:
# detail_dir / obj_parent_name / index.rst (example/Foo/index.rst)
# detail_dir / obj_parent_name / obj_name.rst (example/Foo/foo.rst)
own_page_level = self.app.config.autoapi_own_page_level
function_page_level = _OWN_PAGE_LEVELS.index("function")
is_level_beyond_function = function_page_level < desired_page_level
if obj.type in ["exception", "class"]:
if own_page_level == "function":
if not is_level_beyond_function:
outfile = f"{obj.short_name}{source_suffix}"
path = os.path.join(detail_dir, outfile)
else:
Expand Down

0 comments on commit e62b09c

Please sign in to comment.