{ "module": "docforge.nav", "content": { "path": "docforge.nav", "docstring": "Navigation layer for doc-forge.\n\nThe ``docforge.nav`` package manages the relationship between the logical\ndocumentation structure defined by the user and the physical documentation\nfiles generated on disk.\n\n---\n\nWorkflow\n--------\n\n1. **Specification** – Users define navigation intent in ``docforge.nav.yml``.\n2. **Resolution** – ``resolve_nav`` expands patterns and matches them against\n generated Markdown files.\n3. **Emission** – ``MkDocsNavEmitter`` converts the resolved structure into\n the YAML navigation format required by ``mkdocs.yml``.\n\nThis layer separates documentation organization from the underlying source\ncode layout, enabling flexible grouping, ordering, and navigation structures\nindependent of module hierarchy.\n\n---", "objects": { "NavSpec": { "name": "NavSpec", "kind": "class", "path": "docforge.nav.NavSpec", "signature": "", "docstring": "Parsed representation of a navigation specification.\n\nA ``NavSpec`` describes the intended documentation navigation layout before\nit is resolved against the filesystem.\n\nAttributes:\n home: Relative path to the documentation home page (for example\n ``index.md``).\n groups: Mapping of navigation group titles to lists of file patterns\n or glob expressions.", "members": { "home": { "name": "home", "kind": "attribute", "path": "docforge.nav.NavSpec.home", "signature": "", "docstring": null }, "groups": { "name": "groups", "kind": "attribute", "path": "docforge.nav.NavSpec.groups", "signature": "", "docstring": null }, "load": { "name": "load", "kind": "function", "path": "docforge.nav.NavSpec.load", "signature": "", "docstring": "Load a navigation specification from a YAML file.\n\nArgs:\n path: Filesystem path to the navigation specification file.\n\nReturns:\n A ``NavSpec`` instance representing the parsed configuration.\n\nRaises:\n FileNotFoundError: If the specified file does not exist.\n ValueError: If the file contents are not a valid navigation\n specification." }, "all_patterns": { "name": "all_patterns", "kind": "function", "path": "docforge.nav.NavSpec.all_patterns", "signature": "", "docstring": "Return all path patterns referenced by the specification.\n\nReturns:\n A list containing the home document (if defined) and all\n group pattern entries." } } }, "load_nav_spec": { "name": "load_nav_spec", "kind": "function", "path": "docforge.nav.load_nav_spec", "signature": "", "docstring": "Load a navigation specification file.\n\nThis helper function reads a YAML navigation file and constructs a\ncorresponding ``NavSpec`` instance.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A ``NavSpec`` instance representing the parsed specification.\n\nRaises:\n FileNotFoundError: If the specification file does not exist.\n ValueError: If the YAML structure is invalid." }, "ResolvedNav": { "name": "ResolvedNav", "kind": "class", "path": "docforge.nav.ResolvedNav", "signature": "", "docstring": "Resolved navigation structure.\n\nA ``ResolvedNav`` represents navigation data after glob patterns have been\nexpanded and paths validated against the filesystem.\n\nAttributes:\n home: Relative path to the documentation home page.\n groups: Mapping of navigation group titles to lists of resolved\n documentation file paths.", "members": { "home": { "name": "home", "kind": "attribute", "path": "docforge.nav.ResolvedNav.home", "signature": "", "docstring": null }, "groups": { "name": "groups", "kind": "attribute", "path": "docforge.nav.ResolvedNav.groups", "signature": "", "docstring": null }, "all_files": { "name": "all_files", "kind": "function", "path": "docforge.nav.ResolvedNav.all_files", "signature": "", "docstring": "Iterate over all files referenced by the navigation structure.\n\nReturns:\n An iterable of ``Path`` objects representing documentation files.\n\nRaises:\n RuntimeError: If the home page is defined but the documentation\n root is not available for resolution." } } }, "resolve_nav": { "name": "resolve_nav", "kind": "function", "path": "docforge.nav.resolve_nav", "signature": "", "docstring": "Resolve a navigation specification against the filesystem.\n\nThe function expands glob patterns defined in a ``NavSpec`` and verifies\nthat referenced documentation files exist within the documentation root.\n\nArgs:\n spec: Navigation specification describing documentation layout.\n docs_root: Root directory containing documentation Markdown files.\n\nReturns:\n A ``ResolvedNav`` instance containing validated navigation paths.\n\nRaises:\n FileNotFoundError: If the documentation root does not exist or a\n navigation pattern does not match any files." }, "MkDocsNavEmitter": { "name": "MkDocsNavEmitter", "kind": "class", "path": "docforge.nav.MkDocsNavEmitter", "signature": "", "docstring": "Emit MkDocs navigation structures from resolved navigation data.\n\nThe emitter transforms a ``ResolvedNav`` object into the YAML-compatible\nlist structure expected by the MkDocs ``nav`` configuration field.", "members": { "emit": { "name": "emit", "kind": "function", "path": "docforge.nav.MkDocsNavEmitter.emit", "signature": "", "docstring": "Generate a navigation structure for ``mkdocs.yml``.\n\nArgs:\n nav: Resolved navigation data describing documentation groups\n and their associated Markdown files.\n\nReturns:\n A list of dictionaries representing the MkDocs navigation layout.\n Each dictionary maps a navigation label to a page or a list of\n pages." } } }, "mkdocs": { "name": "mkdocs", "kind": "module", "path": "docforge.nav.mkdocs", "signature": null, "docstring": "MkDocs navigation emitter.\n\nThis module provides the ``MkDocsNavEmitter`` class, which converts a\n``ResolvedNav`` instance into the navigation structure required by the\nMkDocs ``nav`` configuration.", "members": { "Path": { "name": "Path", "kind": "alias", "path": "docforge.nav.mkdocs.Path", "signature": "", "docstring": null }, "List": { "name": "List", "kind": "alias", "path": "docforge.nav.mkdocs.List", "signature": "", "docstring": null }, "Dict": { "name": "Dict", "kind": "alias", "path": "docforge.nav.mkdocs.Dict", "signature": "", "docstring": null }, "Any": { "name": "Any", "kind": "alias", "path": "docforge.nav.mkdocs.Any", "signature": "", "docstring": null }, "ResolvedNav": { "name": "ResolvedNav", "kind": "class", "path": "docforge.nav.mkdocs.ResolvedNav", "signature": "", "docstring": "Resolved navigation structure.\n\nA ``ResolvedNav`` represents navigation data after glob patterns have been\nexpanded and paths validated against the filesystem.\n\nAttributes:\n home: Relative path to the documentation home page.\n groups: Mapping of navigation group titles to lists of resolved\n documentation file paths.", "members": { "home": { "name": "home", "kind": "attribute", "path": "docforge.nav.mkdocs.ResolvedNav.home", "signature": "", "docstring": null }, "groups": { "name": "groups", "kind": "attribute", "path": "docforge.nav.mkdocs.ResolvedNav.groups", "signature": "", "docstring": null }, "all_files": { "name": "all_files", "kind": "function", "path": "docforge.nav.mkdocs.ResolvedNav.all_files", "signature": "", "docstring": "Iterate over all files referenced by the navigation structure.\n\nReturns:\n An iterable of ``Path`` objects representing documentation files.\n\nRaises:\n RuntimeError: If the home page is defined but the documentation\n root is not available for resolution." } } }, "MkDocsNavEmitter": { "name": "MkDocsNavEmitter", "kind": "class", "path": "docforge.nav.mkdocs.MkDocsNavEmitter", "signature": "", "docstring": "Emit MkDocs navigation structures from resolved navigation data.\n\nThe emitter transforms a ``ResolvedNav`` object into the YAML-compatible\nlist structure expected by the MkDocs ``nav`` configuration field.", "members": { "emit": { "name": "emit", "kind": "function", "path": "docforge.nav.mkdocs.MkDocsNavEmitter.emit", "signature": "", "docstring": "Generate a navigation structure for ``mkdocs.yml``.\n\nArgs:\n nav: Resolved navigation data describing documentation groups\n and their associated Markdown files.\n\nReturns:\n A list of dictionaries representing the MkDocs navigation layout.\n Each dictionary maps a navigation label to a page or a list of\n pages." } } } } }, "resolver": { "name": "resolver", "kind": "module", "path": "docforge.nav.resolver", "signature": null, "docstring": "Navigation resolution utilities.\n\nThis module resolves a ``NavSpec`` against the filesystem by expanding glob\npatterns and validating that referenced documentation files exist.", "members": { "Path": { "name": "Path", "kind": "alias", "path": "docforge.nav.resolver.Path", "signature": "", "docstring": null }, "Dict": { "name": "Dict", "kind": "alias", "path": "docforge.nav.resolver.Dict", "signature": "", "docstring": null }, "Iterable": { "name": "Iterable", "kind": "alias", "path": "docforge.nav.resolver.Iterable", "signature": "", "docstring": null }, "List": { "name": "List", "kind": "alias", "path": "docforge.nav.resolver.List", "signature": "", "docstring": null }, "glob": { "name": "glob", "kind": "alias", "path": "docforge.nav.resolver.glob", "signature": "", "docstring": null }, "NavSpec": { "name": "NavSpec", "kind": "class", "path": "docforge.nav.resolver.NavSpec", "signature": "", "docstring": "Parsed representation of a navigation specification.\n\nA ``NavSpec`` describes the intended documentation navigation layout before\nit is resolved against the filesystem.\n\nAttributes:\n home: Relative path to the documentation home page (for example\n ``index.md``).\n groups: Mapping of navigation group titles to lists of file patterns\n or glob expressions.", "members": { "home": { "name": "home", "kind": "attribute", "path": "docforge.nav.resolver.NavSpec.home", "signature": "", "docstring": null }, "groups": { "name": "groups", "kind": "attribute", "path": "docforge.nav.resolver.NavSpec.groups", "signature": "", "docstring": null }, "load": { "name": "load", "kind": "function", "path": "docforge.nav.resolver.NavSpec.load", "signature": "", "docstring": "Load a navigation specification from a YAML file.\n\nArgs:\n path: Filesystem path to the navigation specification file.\n\nReturns:\n A ``NavSpec`` instance representing the parsed configuration.\n\nRaises:\n FileNotFoundError: If the specified file does not exist.\n ValueError: If the file contents are not a valid navigation\n specification." }, "all_patterns": { "name": "all_patterns", "kind": "function", "path": "docforge.nav.resolver.NavSpec.all_patterns", "signature": "", "docstring": "Return all path patterns referenced by the specification.\n\nReturns:\n A list containing the home document (if defined) and all\n group pattern entries." } } }, "ResolvedNav": { "name": "ResolvedNav", "kind": "class", "path": "docforge.nav.resolver.ResolvedNav", "signature": "", "docstring": "Resolved navigation structure.\n\nA ``ResolvedNav`` represents navigation data after glob patterns have been\nexpanded and paths validated against the filesystem.\n\nAttributes:\n home: Relative path to the documentation home page.\n groups: Mapping of navigation group titles to lists of resolved\n documentation file paths.", "members": { "home": { "name": "home", "kind": "attribute", "path": "docforge.nav.resolver.ResolvedNav.home", "signature": null, "docstring": null }, "groups": { "name": "groups", "kind": "attribute", "path": "docforge.nav.resolver.ResolvedNav.groups", "signature": null, "docstring": null }, "all_files": { "name": "all_files", "kind": "function", "path": "docforge.nav.resolver.ResolvedNav.all_files", "signature": "", "docstring": "Iterate over all files referenced by the navigation structure.\n\nReturns:\n An iterable of ``Path`` objects representing documentation files.\n\nRaises:\n RuntimeError: If the home page is defined but the documentation\n root is not available for resolution." } } }, "resolve_nav": { "name": "resolve_nav", "kind": "function", "path": "docforge.nav.resolver.resolve_nav", "signature": "", "docstring": "Resolve a navigation specification against the filesystem.\n\nThe function expands glob patterns defined in a ``NavSpec`` and verifies\nthat referenced documentation files exist within the documentation root.\n\nArgs:\n spec: Navigation specification describing documentation layout.\n docs_root: Root directory containing documentation Markdown files.\n\nReturns:\n A ``ResolvedNav`` instance containing validated navigation paths.\n\nRaises:\n FileNotFoundError: If the documentation root does not exist or a\n navigation pattern does not match any files." }, "Optional": { "name": "Optional", "kind": "alias", "path": "docforge.nav.resolver.Optional", "signature": "", "docstring": null } } }, "spec": { "name": "spec", "kind": "module", "path": "docforge.nav.spec", "signature": null, "docstring": "Navigation specification model.\n\nThis module defines the ``NavSpec`` class, which represents the navigation\nstructure defined by the user in the doc-forge navigation specification\n(typically ``docforge.nav.yml``).", "members": { "Path": { "name": "Path", "kind": "alias", "path": "docforge.nav.spec.Path", "signature": "", "docstring": null }, "Dict": { "name": "Dict", "kind": "alias", "path": "docforge.nav.spec.Dict", "signature": "", "docstring": null }, "List": { "name": "List", "kind": "alias", "path": "docforge.nav.spec.List", "signature": "", "docstring": null }, "Optional": { "name": "Optional", "kind": "alias", "path": "docforge.nav.spec.Optional", "signature": "", "docstring": null }, "yaml": { "name": "yaml", "kind": "alias", "path": "docforge.nav.spec.yaml", "signature": "", "docstring": null }, "NavSpec": { "name": "NavSpec", "kind": "class", "path": "docforge.nav.spec.NavSpec", "signature": "", "docstring": "Parsed representation of a navigation specification.\n\nA ``NavSpec`` describes the intended documentation navigation layout before\nit is resolved against the filesystem.\n\nAttributes:\n home: Relative path to the documentation home page (for example\n ``index.md``).\n groups: Mapping of navigation group titles to lists of file patterns\n or glob expressions.", "members": { "home": { "name": "home", "kind": "attribute", "path": "docforge.nav.spec.NavSpec.home", "signature": null, "docstring": null }, "groups": { "name": "groups", "kind": "attribute", "path": "docforge.nav.spec.NavSpec.groups", "signature": null, "docstring": null }, "load": { "name": "load", "kind": "function", "path": "docforge.nav.spec.NavSpec.load", "signature": "", "docstring": "Load a navigation specification from a YAML file.\n\nArgs:\n path: Filesystem path to the navigation specification file.\n\nReturns:\n A ``NavSpec`` instance representing the parsed configuration.\n\nRaises:\n FileNotFoundError: If the specified file does not exist.\n ValueError: If the file contents are not a valid navigation\n specification." }, "all_patterns": { "name": "all_patterns", "kind": "function", "path": "docforge.nav.spec.NavSpec.all_patterns", "signature": "", "docstring": "Return all path patterns referenced by the specification.\n\nReturns:\n A list containing the home document (if defined) and all\n group pattern entries." } } }, "load_nav_spec": { "name": "load_nav_spec", "kind": "function", "path": "docforge.nav.spec.load_nav_spec", "signature": "", "docstring": "Load a navigation specification file.\n\nThis helper function reads a YAML navigation file and constructs a\ncorresponding ``NavSpec`` instance.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A ``NavSpec`` instance representing the parsed specification.\n\nRaises:\n FileNotFoundError: If the specification file does not exist.\n ValueError: If the YAML structure is invalid." } } } } } }