Files
doc-forge/docforge/nav/resolver.pyi

52 lines
1.1 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from pathlib import Path
from typing import Dict, List, Iterable, Optional
from docforge.nav.spec import NavSpec
class ResolvedNav:
"""
Fully-resolved navigation tree.
- `home` is a semantic, docs-rootrelative path (string)
- `groups` contain resolved filesystem Paths
- Order is preserved
"""
home: Optional[str]
groups: Dict[str, List[Path]]
_docs_root: Optional[Path]
def __init__(
self,
home: str | None,
groups: Dict[str, List[Path]],
docs_root: Path | None = ...,
) -> None: ...
def all_files(self) -> Iterable[Path]:
"""
Return all resolved documentation files in nav order.
Includes the home file (resolved against docs_root)
followed by all group files.
"""
...
def resolve_nav(
spec: NavSpec,
docs_root: Path,
) -> ResolvedNav:
"""
Resolve a NavSpec against a docs directory.
Expands wildcards, validates existence, and
resolves filesystem paths relative to docs_root.
Raises:
FileNotFoundError: if any referenced file is missing
ValueError: if resolution fails
"""
...