Skip to content

Commit

Permalink
Exclude toplevel script
Browse files Browse the repository at this point in the history
  • Loading branch information
oashour committed Apr 21, 2024
1 parent 7e7a35f commit 8709765
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/gen_ref_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
doc_path = path.relative_to(src).with_suffix(".md")
full_doc_path = Path("reference", doc_path)

print(module_path)
parts = tuple(module_path.parts)

if parts[-1] == "__init__":
parts = parts[:-1]
doc_path = doc_path.with_name("index.md")
full_doc_path = full_doc_path.with_name("index.md")
elif parts[-1] == "__main__":
elif parts[-1] in ("__main__", "run"):
continue

nav[parts] = doc_path.as_posix()
Expand All @@ -33,4 +32,4 @@
mkdocs_gen_files.set_edit_path(full_doc_path, path.relative_to(root))

with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file:
nav_file.writelines(nav.build_literate_nav())
nav_file.writelines(nav.build_literate_nav())

0 comments on commit 8709765

Please sign in to comment.