Skip to content

Commit

Permalink
move code out of src & fix reference autogeneration accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
kushaangupta committed Oct 7, 2024
1 parent 88df175 commit df77deb
Show file tree
Hide file tree
Showing 58 changed files with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/gen_ref_pages.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
"""Generate the code reference pages."""
import os
from itertools import chain
from pathlib import Path

import mkdocs_gen_files


nav = mkdocs_gen_files.Nav()
mod_symbol = ''#<code class="doc-symbol doc-symbol-nav doc-symbol-module"></code>'
mod_symbol = '<code class="doc-symbol doc-symbol-nav doc-symbol-module"></code>'

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

for path in sorted(chain(src.rglob("*.py"), src.rglob("*.pyi"))):
for path in sorted(src.rglob("*.py")):
if path.relative_to(src).parts[0] != "neuro_py":
continue
module_path = path.relative_to(src).with_suffix("")
doc_path = path.relative_to(src).with_suffix(".md")
full_doc_path = Path("reference", doc_path)
Expand All @@ -26,6 +29,7 @@
continue

nav_parts = [f"{mod_symbol} {part}" for part in parts]
print(nav_parts)
nav[tuple(nav_parts)[-2:]] = doc_path.as_posix()

with mkdocs_gen_files.open(full_doc_path, "w") as fd:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit df77deb

Please sign in to comment.