from collections.abc import Callable from pathlib import Path from typing import Any def build_wiki_nav(wiki_dir: Path) -> list[dict[str, Any]]: """ Derive an MkDocs navigation block from a wiki directory. Args: wiki_dir (Path): Path to the hand-written wiki directory. Returns: list[dict[str, Any]]: Wiki navigation entries compatible with the MkDocs `nav` configuration. Raises: FileNotFoundError: If the wiki directory does not exist. """ ... def _render_entries( base_dir: Path, rel: Callable[[Path], str], ) -> list[dict[str, Any]]: """ Render navigation entries for the children of a wiki directory. Args: base_dir (Path): Directory whose children are rendered. rel (Callable[[Path], str]): Callable converting a wiki file path into a docs-relative path. Returns: list[dict[str, Any]]: Navigation entries for `base_dir` in natural sort order. """ ...