Skip to content

Commit 38f174e

Browse files
committed
gen_ref_pages: minor improvements
1 parent 875e3c2 commit 38f174e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

scripts/gen_ref_pages.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,20 @@
1111

1212
for path in sorted((src / "stagpy").rglob("*.py")):
1313
module_path = path.relative_to(src).with_suffix("")
14-
doc_path = path.relative_to(src).with_suffix(".md")
14+
doc_path = module_path.with_suffix(".md")
1515

1616
parts = module_path.parts
1717

1818
if parts[-1] == "__init__":
1919
parts = parts[:-1]
20-
doc_path = doc_path.with_name("index.md")
21-
22-
full_doc_path = Path("reference", doc_path)
20+
doc_path = doc_path.with_stem("index")
2321

2422
if any(p.startswith("_") for p in parts):
2523
continue
2624

2725
nav[parts] = doc_path.as_posix()
2826

27+
full_doc_path = Path("reference", doc_path)
2928
with mkdocs_gen_files.open(full_doc_path, "w") as fd:
3029
identifier = ".".join(parts)
3130
print("::: " + identifier, file=fd)

0 commit comments

Comments
 (0)