Skip to content

Commit

Permalink
fix: Fix view/edit URIs in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Feb 29, 2024
1 parent ec927c7 commit 574f096
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions project/scripts/gen_ref_nav.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
nav = mkdocs_gen_files.Nav()
mod_symbol = '<code class="doc-symbol doc-symbol-nav doc-symbol-module"></code>'

src = Path(__file__).parent.parent / "src"
root = Path(__file__).parent.parent
src = root / "src"

for path in sorted(src.rglob("*.py")):
module_path = path.relative_to(src).with_suffix("")
Expand All @@ -30,7 +31,7 @@
ident = ".".join(parts)
fd.write(f"::: {ident}")

mkdocs_gen_files.set_edit_path(full_doc_path, ".." / path)
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())

0 comments on commit 574f096

Please sign in to comment.