Skip to content

Commit

Permalink
chore: simplify docs (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
hairmare authored Aug 4, 2024
1 parent 7f98826 commit 11da508
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
23 changes: 1 addition & 22 deletions docs/gen_ref_pages.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Generate the code reference pages and navigation.
"""Generate the docs page.
From https://mkdocstrings.github.io/recipes/
"""
Expand All @@ -7,27 +7,6 @@

import mkdocs_gen_files

nav = mkdocs_gen_files.Nav()

path = Path("app/")
module_path = path.relative_to(".").with_suffix("")
doc_path = path.relative_to(".").with_suffix(".md")
full_doc_path = Path("reference", doc_path)

parts = tuple(module_path.parts)

nav[parts] = doc_path.as_posix()

full_doc_path.parent.mkdir(parents=True, exist_ok=True)
with mkdocs_gen_files.open(full_doc_path, "w") as fd:
ident = ".".join(parts)
fd.write(f"::: {ident}")

mkdocs_gen_files.set_edit_path(full_doc_path, path)

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

with Path("README.md").open("r") as readme, mkdocs_gen_files.open(
"index.md",
"w",
Expand Down
6 changes: 0 additions & 6 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,9 @@ plugins:
- literate-nav:
nav_file: SUMMARY.md
- section-index
- mkdocstrings:
handlers:
python:
paths: [app]

nav:
- README: index.md
- Python Reference: reference/

watch:
- README.md
- app/

0 comments on commit 11da508

Please sign in to comment.