Skip to content

Commit

Permalink
refactor: Add mod symbol type in navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jun 2, 2023
1 parent 90ba486 commit cf605f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion project/scripts/gen_ref_nav.py
Expand Up @@ -5,6 +5,7 @@
import mkdocs_gen_files

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

for path in sorted(Path("src").rglob("*.py")):
module_path = path.relative_to("src").with_suffix("")
Expand All @@ -20,7 +21,8 @@
elif parts[-1].startswith("_"):
continue

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

with mkdocs_gen_files.open(full_doc_path, "w") as fd:
ident = ".".join(parts)
Expand Down

0 comments on commit cf605f9

Please sign in to comment.