standardize packaging, tooling, docs, CI, and licensing
This commit is contained in:
@@ -7,7 +7,7 @@ MkDocs ``nav`` configuration.
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
from typing import List, Dict, Any
|
||||
from typing import Any
|
||||
|
||||
from docforge.nav.resolver import ResolvedNav
|
||||
|
||||
@@ -20,7 +20,7 @@ class MkDocsNavEmitter:
|
||||
list structure expected by the MkDocs ``nav`` configuration field.
|
||||
"""
|
||||
|
||||
def emit(self, nav: ResolvedNav) -> List[Dict[str, Any]]:
|
||||
def emit(self, nav: ResolvedNav) -> list[dict[str, Any]]:
|
||||
"""
|
||||
Generate a navigation structure for ``mkdocs.yml``.
|
||||
|
||||
@@ -33,7 +33,7 @@ class MkDocsNavEmitter:
|
||||
Each dictionary maps a navigation label to a page or a list of
|
||||
pages.
|
||||
"""
|
||||
result: List[Dict[str, Any]] = []
|
||||
result: list[dict[str, Any]] = []
|
||||
|
||||
# Home entry (semantic path)
|
||||
if nav.home:
|
||||
@@ -41,7 +41,7 @@ class MkDocsNavEmitter:
|
||||
|
||||
# Group entries
|
||||
for group, paths in nav.groups.items():
|
||||
entries: List[str] = []
|
||||
entries: list[str] = []
|
||||
for p in paths:
|
||||
# Convert filesystem path back to docs-relative path
|
||||
rel_path = self._to_relative(p, nav._docs_root)
|
||||
@@ -75,7 +75,7 @@ class MkDocsNavEmitter:
|
||||
path_str = path.as_posix()
|
||||
docs_root_str = docs_root.as_posix()
|
||||
if path_str.startswith(docs_root_str + "/"):
|
||||
return path_str[len(docs_root_str) + 1:]
|
||||
return path_str[len(docs_root_str) + 1 :]
|
||||
|
||||
# Fallback for other cases
|
||||
return path.as_posix().split("/docs/", 1)[-1]
|
||||
|
||||
Reference in New Issue
Block a user