{ "module": "docforge.renderers.mkdocs_renderer", "content": { "path": "docforge.renderers.mkdocs_renderer", "docstring": "# Summary\n\nMkDocs renderer implementation.\n\nThis module defines the `MkDocsRenderer` class, which generates Markdown\ndocumentation sources compatible with MkDocs Material and the mkdocstrings\nplugin.\n\nThe renderer ensures a consistent documentation structure by:\n\n- Creating a root `index.md` if one does not exist\n- Generating package index pages automatically\n- Linking child modules within parent package pages\n- Optionally generating `README.md` from the root package docstring", "objects": { "Path": { "name": "Path", "kind": "alias", "path": "docforge.renderers.mkdocs_renderer.Path", "signature": "", "docstring": null }, "Project": { "name": "Project", "kind": "class", "path": "docforge.renderers.mkdocs_renderer.Project", "signature": "", "docstring": "Representation of a documentation project.\n\nA `Project` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name (str):\n Name of the project.\n\n modules (Dict[str, Module]):\n Mapping of module paths to `Module` instances.", "members": { "name": { "name": "name", "kind": "attribute", "path": "docforge.renderers.mkdocs_renderer.Project.name", "signature": "", "docstring": null }, "modules": { "name": "modules", "kind": "attribute", "path": "docforge.renderers.mkdocs_renderer.Project.modules", "signature": "", "docstring": null }, "add_module": { "name": "add_module", "kind": "function", "path": "docforge.renderers.mkdocs_renderer.Project.add_module", "signature": "", "docstring": "Register a module in the project.\n\nArgs:\n module (Module):\n Module instance to add to the project." }, "get_module": { "name": "get_module", "kind": "function", "path": "docforge.renderers.mkdocs_renderer.Project.get_module", "signature": "", "docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path (str):\n Fully qualified dotted module path (for example `pkg.module`).\n\nReturns:\n Module:\n The corresponding `Module` instance.\n\nRaises:\n KeyError:\n If the module does not exist in the project." }, "get_all_modules": { "name": "get_all_modules", "kind": "function", "path": "docforge.renderers.mkdocs_renderer.Project.get_all_modules", "signature": "", "docstring": "Return all modules contained in the project.\n\nReturns:\n Iterable[Module]:\n An iterable of `Module` instances." }, "get_module_list": { "name": "get_module_list", "kind": "function", "path": "docforge.renderers.mkdocs_renderer.Project.get_module_list", "signature": "", "docstring": "Return the list of module import paths.\n\nReturns:\n list[str]:\n A list containing the dotted paths of all modules in the project." } } }, "Module": { "name": "Module", "kind": "class", "path": "docforge.renderers.mkdocs_renderer.Module", "signature": "", "docstring": "Representation of a documented Python module or package.\n\nA `Module` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path (str):\n Dotted import path of the module.\n\n docstring (Optional[str]):\n Module-level documentation string, if present.\n\n members (Dict[str, DocObject]):\n Mapping of object names to their corresponding `DocObject` representations.", "members": { "path": { "name": "path", "kind": "attribute", "path": "docforge.renderers.mkdocs_renderer.Module.path", "signature": "", "docstring": null }, "docstring": { "name": "docstring", "kind": "attribute", "path": "docforge.renderers.mkdocs_renderer.Module.docstring", "signature": "", "docstring": null }, "members": { "name": "members", "kind": "attribute", "path": "docforge.renderers.mkdocs_renderer.Module.members", "signature": "", "docstring": null }, "add_object": { "name": "add_object", "kind": "function", "path": "docforge.renderers.mkdocs_renderer.Module.add_object", "signature": "", "docstring": "Add a documented object to the module.\n\nArgs:\n obj (DocObject):\n Documentation object to register as a top-level member of the module." }, "get_object": { "name": "get_object", "kind": "function", "path": "docforge.renderers.mkdocs_renderer.Module.get_object", "signature": "", "docstring": "Retrieve a documented object by name.\n\nArgs:\n name (str):\n Name of the object to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If no object with the given name exists." }, "get_all_objects": { "name": "get_all_objects", "kind": "function", "path": "docforge.renderers.mkdocs_renderer.Module.get_all_objects", "signature": "", "docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing the module's public members." } } }, "MkDocsRenderer": { "name": "MkDocsRenderer", "kind": "class", "path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer", "signature": "", "docstring": "Renderer that produces Markdown documentation for MkDocs.\n\nGenerated pages use mkdocstrings directives to reference Python modules,\nallowing MkDocs to render API documentation dynamically.", "members": { "name": { "name": "name", "kind": "attribute", "path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.name", "signature": null, "docstring": null }, "generate_sources": { "name": "generate_sources", "kind": "function", "path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources", "signature": "", "docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project (Project):\n Project model containing modules to document.\n\n out_dir (Path):\n Directory where generated Markdown files will be written.\n\n module_is_source (bool, optional):\n If True, treat the specified module as the documentation root\n rather than nesting it inside a folder." }, "generate_readme": { "name": "generate_readme", "kind": "function", "path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme", "signature": "", "docstring": "Generate a `README.md` file from the root module docstring.\n\nBehavior:\n\n- If `module_is_source` is True, `README.md` is written to the project\n root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project (Project):\n Project model containing documentation metadata.\n\n docs_dir (Path):\n Directory containing generated documentation sources.\n\n module_is_source (bool, optional):\n Whether the module is treated as the project source root." } } } } } }