Skip to content

Commit

Permalink
Slight api ref generation improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
tandemdude committed Jun 17, 2024
1 parent 2f04939 commit 5568728
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/docs/api_reference_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ def write(self) -> bool:
os.makedirs(api_reference_dir_path, exist_ok=True)

with open(os.path.join(api_reference_dir_path, parts[-1] + ".rst"), "w") as fp:
package_name = self.header_override or ".".join(parts)
package_name = ".".join(parts)
header_text = self.header_override or package_name

package_lines = [
f" {'/'.join([*self.child_prefix, self.path.name, *package.path.relative_to(self.path).parts])}"
Expand All @@ -125,11 +126,11 @@ def write(self) -> bool:

lines = [
self.before_header or "",
"=" * len(package_name),
package_name,
"=" * len(package_name),
"=" * len(header_text),
header_text,
"=" * len(header_text),
"",
".. automodule:: " + ".".join(parts),
".. automodule:: " + package_name,
"",
]

Expand Down

0 comments on commit 5568728

Please sign in to comment.