{ "module": "docforge.nav", "content": { "path": "docforge.nav", "docstring": "# Navigation Layer\n\nThe `docforge.nav` package manages the mapping between the logical documentation\nstructure and the physical files on disk.\n\n## Workflow\n\n1. **Spec Definition**: Users define navigation intent in `docforge.nav.yml`.\n2. **Resolution**: `resolve_nav` matches patterns in the spec to generated `.md` files.\n3. **Emission**: `MkDocsNavEmitter` produces the final YAML structure for `mkdocs.yml`.\n\nThis abstraction allows doc-forge to support complex grouping and ordering\nindependently of the source code's physical layout.", "objects": { "NavSpec": { "name": "NavSpec", "kind": "class", "path": "docforge.nav.NavSpec", "signature": "", "docstring": "Parsed representation of the docforge navigation specification file.\n\nAttributes:\n home: Path to the home document (e.g., 'index.md').\n groups: Mapping of group titles to lists of path patterns/globs.", "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 NavSpec from a YAML file.\n\nArgs:\n path: The filesystem path to the YAML file.\n\nReturns:\n A NavSpec instance.\n\nRaises:\n FileNotFoundError: If the path does not exist.\n ValueError: If the file content is not a valid NavSpec mapping." }, "all_patterns": { "name": "all_patterns", "kind": "function", "path": "docforge.nav.NavSpec.all_patterns", "signature": "", "docstring": "Get all path patterns referenced in the specification.\n\nReturns:\n A list of all patterns (home plus all groups)." } } }, "load_nav_spec": { "name": "load_nav_spec", "kind": "function", "path": "docforge.nav.load_nav_spec", "signature": "", "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." }, "ResolvedNav": { "name": "ResolvedNav", "kind": "class", "path": "docforge.nav.ResolvedNav", "signature": "", "docstring": "Represents a navigation structure where all patterns and paths have been\nresolved against the actual filesystem contents.\n\nAttributes:\n home: Resolved relative path to the home page.\n groups: Mapping of group titles to lists of absolute or relative Path objects.", "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": "Get an iterable of all resolved files in the navigation structure.\n\nReturns:\n An iterable of Path objects." } } }, "resolve_nav": { "name": "resolve_nav", "kind": "function", "path": "docforge.nav.resolve_nav", "signature": "", "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." }, "MkDocsNavEmitter": { "name": "MkDocsNavEmitter", "kind": "class", "path": "docforge.nav.MkDocsNavEmitter", "signature": "", "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", "members": { "emit": { "name": "emit", "kind": "function", "path": "docforge.nav.MkDocsNavEmitter.emit", "signature": "", "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." } } }, "mkdocs": { "name": "mkdocs", "kind": "module", "path": "docforge.nav.mkdocs", "signature": null, "docstring": "This module provides the MkDocsNavEmitter, which converts a ResolvedNav instance\ninto the specific YAML-ready list structure expected by the MkDocs 'nav'\nconfiguration.", "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": "Represents a navigation structure where all patterns and paths have been\nresolved against the actual filesystem contents.\n\nAttributes:\n home: Resolved relative path to the home page.\n groups: Mapping of group titles to lists of absolute or relative Path objects.", "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": "Get an iterable of all resolved files in the navigation structure.\n\nReturns:\n An iterable of Path objects." } } }, "MkDocsNavEmitter": { "name": "MkDocsNavEmitter", "kind": "class", "path": "docforge.nav.mkdocs.MkDocsNavEmitter", "signature": "", "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", "members": { "emit": { "name": "emit", "kind": "function", "path": "docforge.nav.mkdocs.MkDocsNavEmitter.emit", "signature": "", "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." } } } } }, "resolver": { "name": "resolver", "kind": "module", "path": "docforge.nav.resolver", "signature": null, "docstring": "This module contains the logic for resolving a NavSpec against the physical\nfilesystem. It expands globs and validates that all referenced documents\nactually exist on disk.", "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 the docforge navigation specification file.\n\nAttributes:\n home: Path to the home document (e.g., 'index.md').\n groups: Mapping of group titles to lists of path patterns/globs.", "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 NavSpec from a YAML file.\n\nArgs:\n path: The filesystem path to the YAML file.\n\nReturns:\n A NavSpec instance.\n\nRaises:\n FileNotFoundError: If the path does not exist.\n ValueError: If the file content is not a valid NavSpec mapping." }, "all_patterns": { "name": "all_patterns", "kind": "function", "path": "docforge.nav.resolver.NavSpec.all_patterns", "signature": "", "docstring": "Get all path patterns referenced in the specification.\n\nReturns:\n A list of all patterns (home plus all groups)." } } }, "ResolvedNav": { "name": "ResolvedNav", "kind": "class", "path": "docforge.nav.resolver.ResolvedNav", "signature": "", "docstring": "Represents a navigation structure where all patterns and paths have been\nresolved against the actual filesystem contents.\n\nAttributes:\n home: Resolved relative path to the home page.\n groups: Mapping of group titles to lists of absolute or relative Path objects.", "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": "Get an iterable of all resolved files in the navigation structure.\n\nReturns:\n An iterable of Path objects." } } }, "resolve_nav": { "name": "resolve_nav", "kind": "function", "path": "docforge.nav.resolver.resolve_nav", "signature": "", "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." }, "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": "This module defines the NavSpec class, which represents the user's intent for\ndocumentation navigation as defined in a YAML specification (usually\ndocforge.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 the docforge navigation specification file.\n\nAttributes:\n home: Path to the home document (e.g., 'index.md').\n groups: Mapping of group titles to lists of path patterns/globs.", "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 NavSpec from a YAML file.\n\nArgs:\n path: The filesystem path to the YAML file.\n\nReturns:\n A NavSpec instance.\n\nRaises:\n FileNotFoundError: If the path does not exist.\n ValueError: If the file content is not a valid NavSpec mapping." }, "all_patterns": { "name": "all_patterns", "kind": "function", "path": "docforge.nav.spec.NavSpec.all_patterns", "signature": "", "docstring": "Get all path patterns referenced in the specification.\n\nReturns:\n A list of all patterns (home plus all groups)." } } }, "load_nav_spec": { "name": "load_nav_spec", "kind": "function", "path": "docforge.nav.spec.load_nav_spec", "signature": "", "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." } } } } } }