Files
docs/libs/doc-forge/site/search/search_index.json
Vishesh 'ironeagle' Bangotra 8701bf92ac
All checks were successful
continuous-integration/drone/push Build is passing
updated doc forge docs
2026-03-07 16:24:14 +05:30

1 line
89 KiB
JSON

{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"docforge","text":""},{"location":"#docforge","title":"docforge","text":"<p>Renderer-agnostic Python documentation compiler that converts Python docstrings into structured documentation for both humans (MkDocs) and machines (MCP / AI agents).</p> <p><code>doc-forge</code> statically analyzes source code, builds a semantic model of modules, classes, functions, and attributes, and renders that model into documentation outputs without executing user code.</p>"},{"location":"#docforge--installation","title":"Installation","text":"<p>Install using pip:</p> <pre><code>pip install doc-forge\n</code></pre>"},{"location":"#docforge--quick-start","title":"Quick start","text":"<p>Generate a MkDocs site from a Python package:</p> <pre><code>doc-forge build --mkdocs --module my_package\n</code></pre> <p>Generate MCP JSON documentation:</p> <pre><code>doc-forge build --mcp --module my_package\n</code></pre> <p>Serve documentation locally:</p> <pre><code>doc-forge serve --mkdocs --module my_package\n</code></pre>"},{"location":"#docforge--core-concepts","title":"Core concepts","text":"<p>Loader</p> <p>Extracts symbols, signatures, and docstrings using static analysis.</p> <p>Semantic model</p> <p>Structured, renderer-agnostic representation of the API.</p> <p>Renderer</p> <p>Converts the semantic model into output formats such as MkDocs or MCP JSON.</p> <p>Symbol</p> <p>Any documentable object:</p> <pre><code>- module\n- class\n- function\n- method\n- property\n- attribute\n</code></pre>"},{"location":"#docforge--architecture","title":"Architecture","text":"<p><code>doc-forge</code> follows a compiler architecture:</p> <p>Front-end:</p> <pre><code>Static analysis of modules, classes, functions, type hints, and docstrings.\n</code></pre> <p>Middle-end:</p> <pre><code>Builds a semantic model describing symbols and relationships.\n</code></pre> <p>Back-end:</p> <pre><code>Renders documentation using interchangeable renderers.\n</code></pre> <p>This architecture ensures deterministic documentation generation.</p>"},{"location":"#docforge--rendering-pipeline","title":"Rendering pipeline","text":"<p>Typical flow:</p> <pre><code>Python package\n \u2193\nLoader (static analysis)\n \u2193\nSemantic model\n \u2193\nRenderer\n \u2193\nMkDocs site or MCP JSON\n</code></pre>"},{"location":"#docforge--cli-usage","title":"CLI usage","text":"<p>Build MkDocs documentation:</p> <pre><code>doc-forge build --mkdocs --module my_package\n</code></pre> <p>Build MCP documentation:</p> <pre><code>doc-forge build --mcp --module my_package\n</code></pre> <p>Serve MkDocs locally:</p> <pre><code>doc-forge serve --module my_package\n</code></pre>"},{"location":"#docforge--public-api","title":"Public API","text":"<p>Loaders:</p> <pre><code>GriffeLoader\ndiscover_module_paths\n</code></pre> <p>Renderers:</p> <pre><code>MkDocsRenderer\nMCPRenderer\n</code></pre> <p>CLI:</p> <pre><code>main\n</code></pre> <p>Models:</p> <pre><code>models\n</code></pre>"},{"location":"#docforge--google-styled-doc-forge-convention-gsdfc","title":"Google-Styled Doc-Forge Convention (GSDFC)","text":"<p>GSDFC defines how docstrings must be written so they render correctly in MkDocs and remain machine-parsable by doc-forge and AI tooling.</p> <ul> <li>Docstrings are the single source of truth.</li> <li>doc-forge compiles docstrings but does not generate documentation content.</li> <li>Documentation follows the Python import hierarchy.</li> <li>Every public symbol should have a complete and accurate docstring.</li> </ul>"},{"location":"#docforge--general-rules","title":"General rules","text":"<ul> <li>Use Markdown headings at package and module level.</li> <li>Use Google-style structured sections at class, function, and method level.</li> <li>Indent section contents using four spaces.</li> <li>Use type hints in signatures instead of duplicating types in prose.</li> <li>Write summaries in imperative form.</li> <li>Sections are separated by <code>---</code></li> </ul>"},{"location":"#docforge--package-docstrings","title":"Package docstrings","text":"<ul> <li>Package docstrings act as the documentation home page.</li> </ul> <p>Recommended sections:</p> <pre><code>## Summary\n## Installation\n## Quick start\n## Core concepts\n## Architecture\n## Rendering pipeline\n## CLI usage\n## Public API\n## Examples\n## Notes\n</code></pre> Example <p>Package Doc String:</p> <pre><code>'''\nFoo-bar processing framework.\n\nProvides tools for defining Foo objects and executing Bar pipelines.\n\n---\n\n# Installation\n\n pip install foo-bar\n\n---\n\n# Quick start\n\n from foobar import Foo, BarEngine\n\n foo = Foo(\"example\")\n engine = BarEngine([foo])\n\n result = engine.run()\n\n---\n\n# Public API\n\n Foo\n Bar\n BarEngine\n\n---\n'''\n</code></pre>"},{"location":"#docforge--module-docstrings","title":"Module docstrings","text":"<ul> <li>Module docstrings describe a subsystem.</li> </ul> <p>Recommended sections:</p> <pre><code>## Summary\n## Examples\n## Notes\n## Public API\n</code></pre> Example <p>Module Doc String:</p> <pre><code>'''\nFoo execution subsystem.\n\nProvides utilities for executing Foo objects through Bar stages.\n\n---\n\nExample:\n\n from foobar.engine import BarEngine\n from foobar.foo import Foo\n\n foo = Foo(\"example\")\n\n engine = BarEngine([foo])\n engine.run()\n\n---\n'''\n</code></pre>"},{"location":"#docforge--class-docstrings","title":"Class docstrings","text":"<ul> <li>Class docstrings define object responsibility, lifecycle, and attributes.</li> </ul> <p>Recommended sections:</p> <pre><code>Attributes:\nNotes:\nExample:\nRaises:\n</code></pre> Example <p>Simple Foo:</p> <pre><code>class Foo:\n '''\n Represents a unit of work.\n\n Attributes:\n name (str):\n Identifier of the foo instance.\n\n value (int):\n Numeric value associated with foo.\n\n Notes:\n Guarantees:\n\n - instances are immutable after creation\n\n Lifecycle:\n\n - create instance\n - pass to processing engine\n\n Example:\n Create and inspect a Foo:\n\n foo = Foo(\"example\", value=42)\n print(foo.name)\n '''\n</code></pre> <p>Complex Bar:</p> <pre><code>class BarEngine:\n '''\n Executes Foo objects through Bar stages.\n\n Attributes:\n foos (tuple[Foo, ...]):\n Foo instances managed by the engine.\n\n Notes:\n Guarantees:\n\n - deterministic execution order\n\n Example:\n Run engine:\n\n foo1 = Foo(\"a\")\n foo2 = Foo(\"b\")\n\n engine = BarEngine([foo1, foo2])\n engine.run()\n '''\n</code></pre>"},{"location":"#docforge--function-and-method-docstrings","title":"Function and method docstrings","text":"<ul> <li>Function docstrings define API contracts.</li> </ul> <p>Recommended sections:</p> <pre><code>Args:\nReturns:\nRaises:\nYields:\nNotes:\nExample:\n</code></pre> Example <p>Simple process method:</p> <pre><code>def process(foo: Foo, multiplier: int) -&gt; int:\n '''\n Process a Foo instance.\n\n Args:\n foo (Foo):\n Foo instance to process.\n\n multiplier (int):\n Value used to scale foo.\n\n Returns:\n int:\n Processed result.\n\n Raises:\n ValueError:\n If multiplier is negative.\n\n Notes:\n Guarantees:\n\n - foo is not modified\n\n Example:\n Process foo:\n\n foo = Foo(\"example\", value=10)\n\n result = process(foo, multiplier=2)\n print(result)\n '''\n</code></pre> <p>Multiple Examples:</p> <pre><code>def combine(foo_a: Foo, foo_b: Foo) -&gt; Foo:\n '''\n Combine two Foo instances.\n\n Args:\n foo_a (Foo):\n First foo.\n\n foo_b (Foo):\n Second foo.\n\n Returns:\n Foo:\n Combined foo.\n\n Example:\n Basic usage:\n\n foo1 = Foo(\"a\")\n foo2 = Foo(\"b\")\n\n combined = combine(foo1, foo2)\n\n Pipeline usage:\n\n engine = BarEngine([foo1, foo2])\n engine.run()\n '''\n</code></pre>"},{"location":"#docforge--property-docstrings","title":"Property docstrings","text":"<ul> <li>Properties must document return values.</li> </ul> Example <p>Property Doc String:</p> <pre><code>@property\ndef foos(self) -&gt; tuple[Foo, ...]:\n '''\n Return contained Foo instances.\n\n Returns:\n tuple[Foo, ...]:\n Stored foo objects.\n\n Example:\n container = FooContainer()\n\n foos = container.foos\n '''\n</code></pre>"},{"location":"#docforge--attribute-documentation","title":"Attribute documentation","text":"<ul> <li>Document attributes in class docstrings using Attributes:.</li> </ul> Example <p>Attribute Doc String:</p> <pre><code>'''\nRepresents a processing stage.\n\nAttributes:\n id (str):\n Unique identifier.\n\n enabled (bool):\n Whether the stage is active.\n'''\n</code></pre>"},{"location":"#docforge--notes-subsection-grouping","title":"Notes subsection grouping","text":"<ul> <li>Group related information using labeled subsections.</li> </ul> Example <p>Notes Example:</p> <pre><code>Notes:\n **Guarantees:**\n\n - deterministic behavior\n\n **Lifecycle:**\n\n - created during initialization\n - reused across executions\n\n **Thread safety:**\n\n - safe for concurrent reads\n</code></pre>"},{"location":"#docforge--example-formatting","title":"Example formatting","text":"<ul> <li>Use indentation for examples.</li> </ul> Example <p>Single example:</p> <pre><code>Example:\n\n foo = Foo(\"example\")\n process(foo, multiplier=2)\n</code></pre> <p>Multiple examples:</p> <pre><code>Example:\n Create foo:\n\n foo = Foo(\"example\")\n\n Run engine:\n\n engine = BarEngine([foo])\n engine.run()\n</code></pre> <p>Avoid fenced code blocks inside structured sections.</p>"},{"location":"#docforge--separator-rules","title":"Separator rules","text":"<p>Use horizontal separators only at docstring root level to separate sections:</p> <pre><code>---\n</code></pre> <p>Allowed locations:</p> <ul> <li>package docstrings</li> <li>module docstrings</li> <li>major documentation sections</li> </ul> <p>Do not use separators inside code sections.</p>"},{"location":"#docforge--parsing-guarantees","title":"Parsing guarantees","text":"<p>GSDFC ensures doc-forge can deterministically extract:</p> <ul> <li>symbol kind (module, class, function, property, attribute)</li> <li>symbol name</li> <li>parameters</li> <li>return values</li> <li>attributes</li> <li>examples</li> <li>structured Notes subsections</li> </ul> <p>This enables:</p> <ul> <li>reliable MkDocs rendering</li> <li>deterministic MCP export</li> <li>accurate AI semantic interpretation</li> </ul> Notes <ul> <li>doc-forge never executes analyzed modules.</li> <li>Documentation is generated entirely through static analysis.</li> </ul>"},{"location":"#docforge-classes","title":"Classes","text":""},{"location":"#docforge.GriffeLoader","title":"GriffeLoader","text":"<pre><code>GriffeLoader()\n</code></pre> <p>Load Python modules using Griffe and convert them into doc-forge models.</p> <p>This loader uses the Griffe introspection engine to analyze Python source code and transform the extracted information into <code>Project</code>, <code>Module</code>, and <code>DocObject</code> instances used by doc-forge.</p> <p>Initialize the Griffe-backed loader.</p> <p>Creates an internal Griffe loader instance with dedicated collections for modules and source lines.</p>"},{"location":"#docforge.GriffeLoader-functions","title":"Functions","text":""},{"location":"#docforge.GriffeLoader.load_module","title":"load_module","text":"<pre><code>load_module(path: str) -&gt; Module\n</code></pre> <p>Load and convert a single Python module.</p> <p>The module is introspected using Griffe and then transformed into a doc-forge <code>Module</code> model.</p> <p>Parameters:</p> Name Type Description Default <code>path</code> <code>str</code> <p>Dotted import path of the module.</p> required <p>Returns:</p> Type Description <code>Module</code> <p>A populated <code>Module</code> instance.</p>"},{"location":"#docforge.GriffeLoader.load_project","title":"load_project","text":"<pre><code>load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -&gt; Project\n</code></pre> <p>Load multiple modules and assemble them into a Project model.</p> <p>Each module path is introspected and converted into a <code>Module</code> instance. All modules are then aggregated into a single <code>Project</code> object.</p> <p>Parameters:</p> Name Type Description Default <code>module_paths</code> <code>List[str]</code> <p>List of dotted module import paths to load.</p> required <code>project_name</code> <code>Optional[str]</code> <p>Optional override for the project name. Defaults to the top-level name of the first module.</p> <code>None</code> <code>skip_import_errors</code> <code>bool</code> <p>If True, modules that fail to load will be skipped instead of raising an error.</p> <code>None</code> <p>Returns:</p> Type Description <code>Project</code> <p>A populated <code>Project</code> instance containing the loaded modules.</p> <p>Raises:</p> Type Description <code>ValueError</code> <p>If no module paths are provided.</p> <code>ImportError</code> <p>If a module fails to load and <code>skip_import_errors</code> is False.</p>"},{"location":"#docforge.MCPRenderer","title":"MCPRenderer","text":"<p>Renderer that generates MCP-compatible documentation resources.</p> <p>This renderer converts doc-forge project models into structured JSON resources suitable for consumption by systems implementing the Model Context Protocol (MCP).</p>"},{"location":"#docforge.MCPRenderer-functions","title":"Functions","text":""},{"location":"#docforge.MCPRenderer.generate_sources","title":"generate_sources","text":"<pre><code>generate_sources(project: Project, out_dir: Path) -&gt; None\n</code></pre> <p>Generate MCP documentation resources for a project.</p> <p>The renderer serializes each module into a JSON resource and produces supporting metadata files such as <code>nav.json</code> and <code>index.json</code>.</p> <p>Parameters:</p> Name Type Description Default <code>project</code> <code>Project</code> <p>Documentation project model to render.</p> required <code>out_dir</code> <code>Path</code> <p>Directory where MCP resources will be written.</p> required"},{"location":"#docforge.MkDocsRenderer","title":"MkDocsRenderer","text":"<p>Renderer that produces Markdown documentation for MkDocs.</p> <p>Generated pages use mkdocstrings directives to reference Python modules, allowing MkDocs to render API documentation dynamically.</p>"},{"location":"#docforge.MkDocsRenderer-functions","title":"Functions","text":""},{"location":"#docforge.MkDocsRenderer.generate_readme","title":"generate_readme","text":"<pre><code>generate_readme(project: Project, docs_dir: Path, module_is_source: bool | None = None) -&gt; None\n</code></pre> <p>Generate a <code>README.md</code> file from the root module docstring.</p> <p>Behavior:</p> <ul> <li>If <code>module_is_source</code> is True, <code>README.md</code> is written to the project root directory.</li> <li>If False, README generation is currently not implemented.</li> </ul> <p>Parameters:</p> Name Type Description Default <code>project</code> <code>Project</code> <p>Project model containing documentation metadata.</p> required <code>docs_dir</code> <code>Path</code> <p>Directory containing generated documentation sources.</p> required <code>module_is_source</code> <code>bool | None</code> <p>Whether the module is treated as the project source root.</p> <code>None</code>"},{"location":"#docforge.MkDocsRenderer.generate_sources","title":"generate_sources","text":"<pre><code>generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -&gt; None\n</code></pre> <p>Generate Markdown documentation files for a project.</p> <p>This method renders a documentation structure from the provided project model and writes the resulting Markdown files to the specified output directory.</p> <p>Parameters:</p> Name Type Description Default <code>project</code> <code>Project</code> <p>Project model containing modules to document.</p> required <code>out_dir</code> <code>Path</code> <p>Directory where generated Markdown files will be written.</p> required <code>module_is_source</code> <code>bool | None</code> <p>If True, treat the specified module as the documentation root rather than nesting it inside a folder.</p> <code>None</code>"},{"location":"#docforge-functions","title":"Functions","text":""},{"location":"#docforge.discover_module_paths","title":"discover_module_paths","text":"<pre><code>discover_module_paths(module_name: str, project_root: Path | None = None) -&gt; List[str]\n</code></pre> <p>Discover Python modules within a package directory.</p> <p>The function scans the filesystem for <code>.py</code> files inside the specified package and converts them into dotted module import paths.</p> <p>Discovery rules:</p> <ul> <li>Directories containing <code>__init__.py</code> are treated as packages.</li> <li>Each <code>.py</code> file is treated as a module.</li> <li>Results are returned as dotted import paths.</li> </ul> <p>Parameters:</p> Name Type Description Default <code>module_name</code> <code>str</code> <p>Top-level package name to discover modules from.</p> required <code>project_root</code> <code>Path | None</code> <p>Root directory used to resolve module paths. If not provided, the current working directory is used.</p> <code>None</code> <p>Returns:</p> Type Description <code>List[str]</code> <p>A sorted list of unique dotted module import paths.</p> <p>Raises:</p> Type Description <code>FileNotFoundError</code> <p>If the specified package directory does not exist.</p>"},{"location":"cli/","title":"Cli","text":""},{"location":"cli/#docforge.cli","title":"docforge.cli","text":"<p>Command line interface entry point for doc-forge.</p> <p>This module exposes the primary CLI entry function used by the <code>doc-forge</code> command. The actual command implementation resides in <code>docforge.cli.main</code>, while this module provides a stable import path for external tools and the package entry point configuration.</p> <p>The CLI is responsible for orchestrating documentation workflows such as generating renderer sources, building documentation sites, exporting machine-readable documentation bundles, and starting development or MCP servers.</p>"},{"location":"cli/#docforge.cli--typical-usage","title":"Typical usage","text":"<p>The CLI is normally invoked through the installed command:</p> <pre><code>doc-forge &lt;command&gt; [options]\n</code></pre> <p>Programmatic invocation is also possible:</p> <pre><code>from docforge.cli import main\nmain()\n</code></pre>"},{"location":"cli/commands/","title":"Commands","text":""},{"location":"cli/commands/#docforge.cli.commands","title":"docforge.cli.commands","text":""},{"location":"cli/commands/#docforge.cli.commands-classes","title":"Classes","text":""},{"location":"cli/commands/#docforge.cli.commands-functions","title":"Functions","text":""},{"location":"cli/commands/#docforge.cli.commands.build","title":"build","text":"<pre><code>build(mcp: bool, mkdocs: bool, module_is_source: bool, module: Optional[str], project_name: Optional[str], site_name: Optional[str], docs_dir: Path, nav_file: Path, template: Optional[Path], mkdocs_yml: Path, out_dir: Path) -&gt; None\n</code></pre> <p>Build documentation artifacts.</p> <p>This command performs the full documentation build pipeline:</p> <ol> <li>Introspects the Python project using Griffe</li> <li>Generates renderer-specific documentation sources</li> <li>Optionally builds the final documentation output</li> </ol> <p>Depending on the selected options, the build can target:</p> <ul> <li>MkDocs static documentation sites</li> <li>MCP structured documentation resources</li> </ul> <p>Parameters:</p> Name Type Description Default <code>mcp</code> <code>bool</code> <p>Enable MCP documentation generation.</p> required <code>mkdocs</code> <code>bool</code> <p>Enable MkDocs documentation generation.</p> required <code>module_is_source</code> <code>bool</code> <p>Treat the specified module directory as the project root.</p> required <code>module</code> <code>Optional[str]</code> <p>Python module import path to document.</p> required <code>project_name</code> <code>Optional[str]</code> <p>Optional override for the project name.</p> required <code>site_name</code> <code>Optional[str]</code> <p>Display name for the MkDocs site.</p> required <code>docs_dir</code> <code>Path</code> <p>Directory where Markdown documentation sources will be generated.</p> required <code>nav_file</code> <code>Path</code> <p>Path to the navigation specification file.</p> required <code>template</code> <code>Optional[Path]</code> <p>Optional custom MkDocs configuration template.</p> required <code>mkdocs_yml</code> <code>Path</code> <p>Output path for the generated MkDocs configuration.</p> required <code>out_dir</code> <code>Path</code> <p>Output directory for generated MCP resources.</p> required <p>Raises:</p> Type Description <code>UsageError</code> <p>If required options are missing or conflicting.</p>"},{"location":"cli/commands/#docforge.cli.commands.serve","title":"serve","text":"<pre><code>serve(mcp: bool, mkdocs: bool, module: Optional[str], mkdocs_yml: Path, out_dir: Path) -&gt; None\n</code></pre> <p>Serve generated documentation locally.</p> <p>Depending on the selected mode, this command starts either:</p> <ul> <li>A MkDocs development server for browsing documentation</li> <li>An MCP server exposing structured documentation resources</li> </ul> <p>Parameters:</p> Name Type Description Default <code>mcp</code> <code>bool</code> <p>Serve documentation using the MCP server.</p> required <code>mkdocs</code> <code>bool</code> <p>Serve the MkDocs development site.</p> required <code>module</code> <code>Optional[str]</code> <p>Python module import path to serve via MCP.</p> required <code>mkdocs_yml</code> <code>Path</code> <p>Path to the MkDocs configuration file.</p> required <code>out_dir</code> <code>Path</code> <p>Root directory containing MCP documentation resources.</p> required <p>Raises:</p> Type Description <code>UsageError</code> <p>If invalid or conflicting options are provided.</p>"},{"location":"cli/commands/#docforge.cli.commands.tree","title":"tree","text":"<pre><code>tree(module: str, project_name: Optional[str]) -&gt; None\n</code></pre> <p>Display the documentation object tree for a module.</p> <p>This command introspects the specified module and prints a hierarchical representation of the discovered documentation objects, including modules, classes, functions, and members.</p> <p>Parameters:</p> Name Type Description Default <code>module</code> <code>str</code> <p>Python module import path to introspect.</p> required <code>project_name</code> <code>Optional[str]</code> <p>Optional name to display as the project root.</p> required"},{"location":"cli/main/","title":"Main","text":""},{"location":"cli/main/#docforge.cli.main","title":"docforge.cli.main","text":"<p>Command-line entry point for the doc-forge CLI.</p> <p>This module exposes the executable entry point that initializes the Click command group defined in <code>docforge.cli.commands</code>.</p>"},{"location":"cli/main/#docforge.cli.main-functions","title":"Functions","text":""},{"location":"cli/main/#docforge.cli.main.main","title":"main","text":"<pre><code>main() -&gt; None\n</code></pre> <p>Run the doc-forge command-line interface.</p> <p>This function initializes and executes the Click CLI application. It is used as the console entry point when invoking <code>doc-forge</code> from the command line.</p>"},{"location":"cli/mcp_utils/","title":"Mcp Utils","text":""},{"location":"cli/mcp_utils/#docforge.cli.mcp_utils","title":"docforge.cli.mcp_utils","text":""},{"location":"cli/mcp_utils/#docforge.cli.mcp_utils-classes","title":"Classes","text":""},{"location":"cli/mcp_utils/#docforge.cli.mcp_utils-functions","title":"Functions","text":""},{"location":"cli/mcp_utils/#docforge.cli.mcp_utils.generate_resources","title":"generate_resources","text":"<pre><code>generate_resources(module: str, project_name: str | None, out_dir: Path) -&gt; None\n</code></pre> <p>Generate MCP documentation resources from a Python module.</p> <p>The function performs project introspection, builds the internal documentation model, and renders MCP-compatible JSON resources to the specified output directory.</p> <p>Parameters:</p> Name Type Description Default <code>module</code> <code>str</code> <p>Python module import path used as the entry point for documentation generation.</p> required <code>project_name</code> <code>str | None</code> <p>Optional override for the project name used in generated documentation metadata.</p> required <code>out_dir</code> <code>Path</code> <p>Directory where MCP resources (index.json, nav.json, and module data) will be written.</p> required"},{"location":"cli/mcp_utils/#docforge.cli.mcp_utils.serve","title":"serve","text":"<pre><code>serve(module: str, mcp_root: Path) -&gt; None\n</code></pre> <p>Start an MCP server for a pre-generated documentation bundle.</p> <p>The server exposes documentation resources such as project metadata, navigation structure, and module documentation through MCP endpoints.</p> <p>Parameters:</p> Name Type Description Default <code>module</code> <code>str</code> <p>Python module import path used to identify the served documentation instance.</p> required <code>mcp_root</code> <code>Path</code> <p>Path to the directory containing the MCP documentation bundle (index.json, nav.json, and modules/).</p> required <p>Raises:</p> Type Description <code>ClickException</code> <p>If the MCP documentation bundle is missing required files or directories.</p>"},{"location":"cli/mkdocs_utils/","title":"Mkdocs Utils","text":""},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils","title":"docforge.cli.mkdocs_utils","text":""},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils-classes","title":"Classes","text":""},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils-functions","title":"Functions","text":""},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils.build","title":"build","text":"<pre><code>build(mkdocs_yml: Path) -&gt; None\n</code></pre> <p>Build the MkDocs documentation site.</p> <p>This function loads the MkDocs configuration and runs the MkDocs build command to generate the final static documentation site.</p> <p>Parameters:</p> Name Type Description Default <code>mkdocs_yml</code> <code>Path</code> <p>Path to the <code>mkdocs.yml</code> configuration file.</p> required <p>Raises:</p> Type Description <code>ClickException</code> <p>If the configuration file does not exist.</p>"},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils.generate_config","title":"generate_config","text":"<pre><code>generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -&gt; None\n</code></pre> <p>Generate an <code>mkdocs.yml</code> configuration file.</p> <p>The configuration is created by combining a template configuration with a navigation structure derived from the docforge navigation specification.</p> <p>Parameters:</p> Name Type Description Default <code>docs_dir</code> <code>Path</code> <p>Directory containing generated documentation Markdown files.</p> required <code>nav_file</code> <code>Path</code> <p>Path to the <code>docforge.nav.yml</code> navigation specification.</p> required <code>template</code> <code>Path | None</code> <p>Optional path to a custom MkDocs configuration template. If not provided, a built-in template will be used.</p> required <code>out</code> <code>Path</code> <p>Destination path where the generated <code>mkdocs.yml</code> file will be written.</p> required <code>site_name</code> <code>str</code> <p>Display name for the generated documentation site.</p> required <p>Raises:</p> Type Description <code>FileError</code> <p>If the navigation specification or template file cannot be found.</p>"},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils.generate_sources","title":"generate_sources","text":"<pre><code>generate_sources(module: str, docs_dir: Path, project_name: str | None = None, module_is_source: bool | None = None) -&gt; None\n</code></pre> <p>Generate MkDocs Markdown sources for a Python module.</p> <p>This function introspects the specified module, builds the internal documentation model, and renders Markdown documentation files for use with MkDocs.</p> <p>Parameters:</p> Name Type Description Default <code>module</code> <code>str</code> <p>Python module import path used as the entry point for documentation generation.</p> required <code>docs_dir</code> <code>Path</code> <p>Directory where the generated Markdown files will be written.</p> required <code>project_name</code> <code>str | None</code> <p>Optional override for the project name used in documentation metadata.</p> <code>None</code> <code>module_is_source</code> <code>bool | None</code> <p>If True, treat the specified module directory as the project root rather than a nested module.</p> <code>None</code>"},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils.serve","title":"serve","text":"<pre><code>serve(mkdocs_yml: Path) -&gt; None\n</code></pre> <p>Start an MkDocs development server with live reload.</p> <p>The server watches documentation files and automatically reloads the site when changes are detected.</p> <p>Parameters:</p> Name Type Description Default <code>mkdocs_yml</code> <code>Path</code> <p>Path to the <code>mkdocs.yml</code> configuration file.</p> required <p>Raises:</p> Type Description <code>ClickException</code> <p>If the configuration file does not exist.</p>"},{"location":"loaders/","title":"Loaders","text":""},{"location":"loaders/#docforge.loaders","title":"docforge.loaders","text":"<p>Loader layer for doc-forge.</p> <p>The <code>docforge.loaders</code> package is responsible for discovering Python modules and extracting documentation data using static analysis.</p>"},{"location":"loaders/#docforge.loaders--overview","title":"Overview","text":"<p>This layer converts Python source code into an intermediate documentation model used by doc-forge. It performs module discovery, introspection, and initial filtering before the data is passed to the core documentation models.</p> <p>Core capabilities include:</p> <ul> <li>Module discovery \u2013 Locate Python modules and packages within a project.</li> <li>Static introspection \u2013 Parse docstrings, signatures, and object hierarchies using the <code>griffe</code> library without executing the code.</li> <li>Public API filtering \u2013 Exclude private members (names prefixed with <code>_</code>) to produce clean public documentation structures.</li> </ul>"},{"location":"loaders/#docforge.loaders-classes","title":"Classes","text":""},{"location":"loaders/#docforge.loaders.GriffeLoader","title":"GriffeLoader","text":"<pre><code>GriffeLoader()\n</code></pre> <p>Load Python modules using Griffe and convert them into doc-forge models.</p> <p>This loader uses the Griffe introspection engine to analyze Python source code and transform the extracted information into <code>Project</code>, <code>Module</code>, and <code>DocObject</code> instances used by doc-forge.</p> <p>Initialize the Griffe-backed loader.</p> <p>Creates an internal Griffe loader instance with dedicated collections for modules and source lines.</p>"},{"location":"loaders/#docforge.loaders.GriffeLoader-functions","title":"Functions","text":""},{"location":"loaders/#docforge.loaders.GriffeLoader.load_module","title":"load_module","text":"<pre><code>load_module(path: str) -&gt; Module\n</code></pre> <p>Load and convert a single Python module.</p> <p>The module is introspected using Griffe and then transformed into a doc-forge <code>Module</code> model.</p> <p>Parameters:</p> Name Type Description Default <code>path</code> <code>str</code> <p>Dotted import path of the module.</p> required <p>Returns:</p> Type Description <code>Module</code> <p>A populated <code>Module</code> instance.</p>"},{"location":"loaders/#docforge.loaders.GriffeLoader.load_project","title":"load_project","text":"<pre><code>load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -&gt; Project\n</code></pre> <p>Load multiple modules and assemble them into a Project model.</p> <p>Each module path is introspected and converted into a <code>Module</code> instance. All modules are then aggregated into a single <code>Project</code> object.</p> <p>Parameters:</p> Name Type Description Default <code>module_paths</code> <code>List[str]</code> <p>List of dotted module import paths to load.</p> required <code>project_name</code> <code>Optional[str]</code> <p>Optional override for the project name. Defaults to the top-level name of the first module.</p> <code>None</code> <code>skip_import_errors</code> <code>bool</code> <p>If True, modules that fail to load will be skipped instead of raising an error.</p> <code>None</code> <p>Returns:</p> Type Description <code>Project</code> <p>A populated <code>Project</code> instance containing the loaded modules.</p> <p>Raises:</p> Type Description <code>ValueError</code> <p>If no module paths are provided.</p> <code>ImportError</code> <p>If a module fails to load and <code>skip_import_errors</code> is False.</p>"},{"location":"loaders/#docforge.loaders-functions","title":"Functions","text":""},{"location":"loaders/#docforge.loaders.discover_module_paths","title":"discover_module_paths","text":"<pre><code>discover_module_paths(module_name: str, project_root: Path | None = None) -&gt; List[str]\n</code></pre> <p>Discover Python modules within a package directory.</p> <p>The function scans the filesystem for <code>.py</code> files inside the specified package and converts them into dotted module import paths.</p> <p>Discovery rules:</p> <ul> <li>Directories containing <code>__init__.py</code> are treated as packages.</li> <li>Each <code>.py</code> file is treated as a module.</li> <li>Results are returned as dotted import paths.</li> </ul> <p>Parameters:</p> Name Type Description Default <code>module_name</code> <code>str</code> <p>Top-level package name to discover modules from.</p> required <code>project_root</code> <code>Path | None</code> <p>Root directory used to resolve module paths. If not provided, the current working directory is used.</p> <code>None</code> <p>Returns:</p> Type Description <code>List[str]</code> <p>A sorted list of unique dotted module import paths.</p> <p>Raises:</p> Type Description <code>FileNotFoundError</code> <p>If the specified package directory does not exist.</p>"},{"location":"loaders/griffe_loader/","title":"Griffe Loader","text":""},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader","title":"docforge.loaders.griffe_loader","text":"<p>Utilities for loading and introspecting Python modules using Griffe.</p> <p>This module provides the <code>GriffeLoader</code> class and helper utilities used to discover Python modules, introspect their structure, and convert the results into doc-forge documentation models.</p>"},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader-classes","title":"Classes","text":""},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader.GriffeLoader","title":"GriffeLoader","text":"<pre><code>GriffeLoader()\n</code></pre> <p>Load Python modules using Griffe and convert them into doc-forge models.</p> <p>This loader uses the Griffe introspection engine to analyze Python source code and transform the extracted information into <code>Project</code>, <code>Module</code>, and <code>DocObject</code> instances used by doc-forge.</p> <p>Initialize the Griffe-backed loader.</p> <p>Creates an internal Griffe loader instance with dedicated collections for modules and source lines.</p>"},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader.GriffeLoader-functions","title":"Functions","text":""},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader.GriffeLoader.load_module","title":"load_module","text":"<pre><code>load_module(path: str) -&gt; Module\n</code></pre> <p>Load and convert a single Python module.</p> <p>The module is introspected using Griffe and then transformed into a doc-forge <code>Module</code> model.</p> <p>Parameters:</p> Name Type Description Default <code>path</code> <code>str</code> <p>Dotted import path of the module.</p> required <p>Returns:</p> Type Description <code>Module</code> <p>A populated <code>Module</code> instance.</p>"},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader.GriffeLoader.load_project","title":"load_project","text":"<pre><code>load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -&gt; Project\n</code></pre> <p>Load multiple modules and assemble them into a Project model.</p> <p>Each module path is introspected and converted into a <code>Module</code> instance. All modules are then aggregated into a single <code>Project</code> object.</p> <p>Parameters:</p> Name Type Description Default <code>module_paths</code> <code>List[str]</code> <p>List of dotted module import paths to load.</p> required <code>project_name</code> <code>Optional[str]</code> <p>Optional override for the project name. Defaults to the top-level name of the first module.</p> <code>None</code> <code>skip_import_errors</code> <code>bool</code> <p>If True, modules that fail to load will be skipped instead of raising an error.</p> <code>None</code> <p>Returns:</p> Type Description <code>Project</code> <p>A populated <code>Project</code> instance containing the loaded modules.</p> <p>Raises:</p> Type Description <code>ValueError</code> <p>If no module paths are provided.</p> <code>ImportError</code> <p>If a module fails to load and <code>skip_import_errors</code> is False.</p>"},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader-functions","title":"Functions","text":""},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader.discover_module_paths","title":"discover_module_paths","text":"<pre><code>discover_module_paths(module_name: str, project_root: Path | None = None) -&gt; List[str]\n</code></pre> <p>Discover Python modules within a package directory.</p> <p>The function scans the filesystem for <code>.py</code> files inside the specified package and converts them into dotted module import paths.</p> <p>Discovery rules:</p> <ul> <li>Directories containing <code>__init__.py</code> are treated as packages.</li> <li>Each <code>.py</code> file is treated as a module.</li> <li>Results are returned as dotted import paths.</li> </ul> <p>Parameters:</p> Name Type Description Default <code>module_name</code> <code>str</code> <p>Top-level package name to discover modules from.</p> required <code>project_root</code> <code>Path | None</code> <p>Root directory used to resolve module paths. If not provided, the current working directory is used.</p> <code>None</code> <p>Returns:</p> Type Description <code>List[str]</code> <p>A sorted list of unique dotted module import paths.</p> <p>Raises:</p> Type Description <code>FileNotFoundError</code> <p>If the specified package directory does not exist.</p>"},{"location":"models/","title":"Models","text":""},{"location":"models/#docforge.models","title":"docforge.models","text":"<p>Model layer for doc-forge.</p> <p>The <code>docforge.models</code> package defines the core data structures used to represent Python source code as a structured documentation model.</p>"},{"location":"models/#docforge.models--overview","title":"Overview","text":"<p>The model layer forms the central intermediate representation used throughout doc-forge. Python modules and objects discovered during introspection are converted into a hierarchy of documentation models that can later be rendered into different documentation formats.</p> <p>Key components:</p> <ul> <li>Project \u2013 Root container representing an entire documented codebase.</li> <li>Module \u2013 Representation of a Python module or package containing documented members.</li> <li>DocObject \u2013 Recursive structure representing Python objects such as classes, functions, methods, and attributes.</li> </ul> <p>These models are intentionally renderer-agnostic, allowing the same documentation structure to be transformed into multiple output formats (e.g., MkDocs, MCP, or other renderers).</p>"},{"location":"models/#docforge.models-classes","title":"Classes","text":""},{"location":"models/#docforge.models.DocObject","title":"DocObject","text":"<pre><code>DocObject(name: str, kind: str, path: str, signature: Optional[str] = None, docstring: Optional[str] = None)\n</code></pre> <p>Representation of a documented Python object.</p> <p>A <code>DocObject</code> models a single Python entity discovered during introspection. Objects may contain nested members, allowing the structure of modules, classes, and other containers to be represented recursively.</p> <p>Attributes:</p> Name Type Description <code>name</code> <code>str</code> <p>Local name of the object.</p> <code>kind</code> <code>str</code> <p>Type of object (for example <code>class</code>, <code>function</code>, <code>method</code>, or <code>attribute</code>).</p> <code>path</code> <code>str</code> <p>Fully qualified dotted path to the object.</p> <code>signature</code> <code>Optional[str]</code> <p>Callable signature if the object represents a callable.</p> <code>docstring</code> <code>Optional[str]</code> <p>Raw docstring text extracted from the source code.</p> <code>members</code> <code>Dict[str, DocObject]</code> <p>Mapping of member names to child <code>DocObject</code> instances.</p> <p>Initialize a DocObject instance.</p> <p>Parameters:</p> Name Type Description Default <code>name</code> <code>str</code> <p>Local name of the object.</p> required <code>kind</code> <code>str</code> <p>Object type identifier (for example <code>class</code> or <code>function</code>).</p> required <code>path</code> <code>str</code> <p>Fully qualified dotted path of the object.</p> required <code>signature</code> <code>Optional[str]</code> <p>Callable signature if applicable.</p> <code>None</code> <code>docstring</code> <code>Optional[str]</code> <p>Documentation string associated with the object.</p> <code>None</code>"},{"location":"models/#docforge.models.DocObject-functions","title":"Functions","text":""},{"location":"models/#docforge.models.DocObject.add_member","title":"add_member","text":"<pre><code>add_member(obj: DocObject) -&gt; None\n</code></pre> <p>Add a child documentation object.</p> <p>This is typically used when attaching methods to classes or nested objects to their parent containers.</p> <p>Parameters:</p> Name Type Description Default <code>obj</code> <code>DocObject</code> <p>Documentation object to add as a member.</p> required"},{"location":"models/#docforge.models.DocObject.get_all_members","title":"get_all_members","text":"<pre><code>get_all_members() -&gt; Iterable[DocObject]\n</code></pre> <p>Return all child members of the object.</p> <p>Returns:</p> Type Description <code>Iterable[DocObject]</code> <p>An iterable of <code>DocObject</code> instances representing nested members.</p>"},{"location":"models/#docforge.models.DocObject.get_member","title":"get_member","text":"<pre><code>get_member(name: str) -&gt; DocObject\n</code></pre> <p>Retrieve a member object by name.</p> <p>Parameters:</p> Name Type Description Default <code>name</code> <code>str</code> <p>Name of the member to retrieve.</p> required <p>Returns:</p> Type Description <code>DocObject</code> <p>The corresponding <code>DocObject</code> instance.</p> <p>Raises:</p> Type Description <code>KeyError</code> <p>If the member does not exist.</p>"},{"location":"models/#docforge.models.Module","title":"Module","text":"<pre><code>Module(path: str, docstring: Optional[str] = None)\n</code></pre> <p>Representation of a documented Python module or package.</p> <p>A <code>Module</code> stores metadata about the module itself and maintains a collection of top-level documentation objects discovered during introspection.</p> <p>Attributes:</p> Name Type Description <code>path</code> <code>str</code> <p>Dotted import path of the module.</p> <code>docstring</code> <code>Optional[str]</code> <p>Module-level documentation string, if present.</p> <code>members</code> <code>Dict[str, DocObject]</code> <p>Mapping of object names to their corresponding <code>DocObject</code> representations.</p> <p>Initialize a Module instance.</p> <p>Parameters:</p> Name Type Description Default <code>path</code> <code>str</code> <p>Dotted import path identifying the module.</p> required <code>docstring</code> <code>Optional[str]</code> <p>Module-level documentation text, if available.</p> <code>None</code>"},{"location":"models/#docforge.models.Module-functions","title":"Functions","text":""},{"location":"models/#docforge.models.Module.add_object","title":"add_object","text":"<pre><code>add_object(obj: DocObject) -&gt; None\n</code></pre> <p>Add a documented object to the module.</p> <p>Parameters:</p> Name Type Description Default <code>obj</code> <code>DocObject</code> <p>Documentation object to register as a top-level member of the module.</p> required"},{"location":"models/#docforge.models.Module.get_all_objects","title":"get_all_objects","text":"<pre><code>get_all_objects() -&gt; Iterable[DocObject]\n</code></pre> <p>Return all top-level documentation objects in the module.</p> <p>Returns:</p> Type Description <code>Iterable[DocObject]</code> <p>An iterable of <code>DocObject</code> instances representing the</p> <code>Iterable[DocObject]</code> <p>module's public members.</p>"},{"location":"models/#docforge.models.Module.get_object","title":"get_object","text":"<pre><code>get_object(name: str) -&gt; DocObject\n</code></pre> <p>Retrieve a documented object by name.</p> <p>Parameters:</p> Name Type Description Default <code>name</code> <code>str</code> <p>Name of the object to retrieve.</p> required <p>Returns:</p> Type Description <code>DocObject</code> <p>The corresponding <code>DocObject</code> instance.</p> <p>Raises:</p> Type Description <code>KeyError</code> <p>If no object with the given name exists.</p>"},{"location":"models/#docforge.models.Project","title":"Project","text":"<pre><code>Project(name: str)\n</code></pre> <p>Representation of a documentation project.</p> <p>A <code>Project</code> serves as the root container for all modules discovered during introspection. Each module is stored by its dotted import path.</p> <p>Attributes:</p> Name Type Description <code>name</code> <code>str</code> <p>Name of the project.</p> <code>modules</code> <code>Dict[str, Module]</code> <p>Mapping of module paths to <code>Module</code> instances.</p> <p>Initialize a Project instance.</p> <p>Parameters:</p> Name Type Description Default <code>name</code> <code>str</code> <p>Name used to identify the documentation project.</p> required"},{"location":"models/#docforge.models.Project-functions","title":"Functions","text":""},{"location":"models/#docforge.models.Project.add_module","title":"add_module","text":"<pre><code>add_module(module: Module) -&gt; None\n</code></pre> <p>Register a module in the project.</p> <p>Parameters:</p> Name Type Description Default <code>module</code> <code>Module</code> <p>Module instance to add to the project.</p> required"},{"location":"models/#docforge.models.Project.get_all_modules","title":"get_all_modules","text":"<pre><code>get_all_modules() -&gt; Iterable[Module]\n</code></pre> <p>Return all modules contained in the project.</p> <p>Returns:</p> Type Description <code>Iterable[Module]</code> <p>An iterable of <code>Module</code> instances.</p>"},{"location":"models/#docforge.models.Project.get_module","title":"get_module","text":"<pre><code>get_module(path: str) -&gt; Module\n</code></pre> <p>Retrieve a module by its dotted path.</p> <p>Parameters:</p> Name Type Description Default <code>path</code> <code>str</code> <p>Fully qualified dotted module path (for example <code>pkg.module</code>).</p> required <p>Returns:</p> Type Description <code>Module</code> <p>The corresponding <code>Module</code> instance.</p> <p>Raises:</p> Type Description <code>KeyError</code> <p>If the module does not exist in the project.</p>"},{"location":"models/#docforge.models.Project.get_module_list","title":"get_module_list","text":"<pre><code>get_module_list() -&gt; list[str]\n</code></pre> <p>Return the list of module import paths.</p> <p>Returns:</p> Type Description <code>list[str]</code> <p>A list containing the dotted paths of all modules in the project.</p>"},{"location":"models/module/","title":"Module","text":""},{"location":"models/module/#docforge.models.module","title":"docforge.models.module","text":"<p>Documentation model representing a Python module or package.</p> <p>This module defines the <code>Module</code> class used in the doc-forge documentation model. A <code>Module</code> acts as a container for top-level documented objects (classes, functions, variables, and other members) discovered during introspection.</p>"},{"location":"models/module/#docforge.models.module-classes","title":"Classes","text":""},{"location":"models/module/#docforge.models.module.Module","title":"Module","text":"<pre><code>Module(path: str, docstring: Optional[str] = None)\n</code></pre> <p>Representation of a documented Python module or package.</p> <p>A <code>Module</code> stores metadata about the module itself and maintains a collection of top-level documentation objects discovered during introspection.</p> <p>Attributes:</p> Name Type Description <code>path</code> <code>str</code> <p>Dotted import path of the module.</p> <code>docstring</code> <code>Optional[str]</code> <p>Module-level documentation string, if present.</p> <code>members</code> <code>Dict[str, DocObject]</code> <p>Mapping of object names to their corresponding <code>DocObject</code> representations.</p> <p>Initialize a Module instance.</p> <p>Parameters:</p> Name Type Description Default <code>path</code> <code>str</code> <p>Dotted import path identifying the module.</p> required <code>docstring</code> <code>Optional[str]</code> <p>Module-level documentation text, if available.</p> <code>None</code>"},{"location":"models/module/#docforge.models.module.Module-functions","title":"Functions","text":""},{"location":"models/module/#docforge.models.module.Module.add_object","title":"add_object","text":"<pre><code>add_object(obj: DocObject) -&gt; None\n</code></pre> <p>Add a documented object to the module.</p> <p>Parameters:</p> Name Type Description Default <code>obj</code> <code>DocObject</code> <p>Documentation object to register as a top-level member of the module.</p> required"},{"location":"models/module/#docforge.models.module.Module.get_all_objects","title":"get_all_objects","text":"<pre><code>get_all_objects() -&gt; Iterable[DocObject]\n</code></pre> <p>Return all top-level documentation objects in the module.</p> <p>Returns:</p> Type Description <code>Iterable[DocObject]</code> <p>An iterable of <code>DocObject</code> instances representing the</p> <code>Iterable[DocObject]</code> <p>module's public members.</p>"},{"location":"models/module/#docforge.models.module.Module.get_object","title":"get_object","text":"<pre><code>get_object(name: str) -&gt; DocObject\n</code></pre> <p>Retrieve a documented object by name.</p> <p>Parameters:</p> Name Type Description Default <code>name</code> <code>str</code> <p>Name of the object to retrieve.</p> required <p>Returns:</p> Type Description <code>DocObject</code> <p>The corresponding <code>DocObject</code> instance.</p> <p>Raises:</p> Type Description <code>KeyError</code> <p>If no object with the given name exists.</p>"},{"location":"models/object/","title":"Object","text":""},{"location":"models/object/#docforge.models.object","title":"docforge.models.object","text":"<p>Documentation model representing individual Python objects.</p> <p>This module defines the <code>DocObject</code> class, the fundamental recursive unit of the doc-forge documentation model. Each <code>DocObject</code> represents a Python entity such as a class, function, method, or attribute, and may contain nested members that form a hierarchical documentation structure.</p>"},{"location":"models/object/#docforge.models.object-classes","title":"Classes","text":""},{"location":"models/object/#docforge.models.object.DocObject","title":"DocObject","text":"<pre><code>DocObject(name: str, kind: str, path: str, signature: Optional[str] = None, docstring: Optional[str] = None)\n</code></pre> <p>Representation of a documented Python object.</p> <p>A <code>DocObject</code> models a single Python entity discovered during introspection. Objects may contain nested members, allowing the structure of modules, classes, and other containers to be represented recursively.</p> <p>Attributes:</p> Name Type Description <code>name</code> <code>str</code> <p>Local name of the object.</p> <code>kind</code> <code>str</code> <p>Type of object (for example <code>class</code>, <code>function</code>, <code>method</code>, or <code>attribute</code>).</p> <code>path</code> <code>str</code> <p>Fully qualified dotted path to the object.</p> <code>signature</code> <code>Optional[str]</code> <p>Callable signature if the object represents a callable.</p> <code>docstring</code> <code>Optional[str]</code> <p>Raw docstring text extracted from the source code.</p> <code>members</code> <code>Dict[str, DocObject]</code> <p>Mapping of member names to child <code>DocObject</code> instances.</p> <p>Initialize a DocObject instance.</p> <p>Parameters:</p> Name Type Description Default <code>name</code> <code>str</code> <p>Local name of the object.</p> required <code>kind</code> <code>str</code> <p>Object type identifier (for example <code>class</code> or <code>function</code>).</p> required <code>path</code> <code>str</code> <p>Fully qualified dotted path of the object.</p> required <code>signature</code> <code>Optional[str]</code> <p>Callable signature if applicable.</p> <code>None</code> <code>docstring</code> <code>Optional[str]</code> <p>Documentation string associated with the object.</p> <code>None</code>"},{"location":"models/object/#docforge.models.object.DocObject-functions","title":"Functions","text":""},{"location":"models/object/#docforge.models.object.DocObject.add_member","title":"add_member","text":"<pre><code>add_member(obj: DocObject) -&gt; None\n</code></pre> <p>Add a child documentation object.</p> <p>This is typically used when attaching methods to classes or nested objects to their parent containers.</p> <p>Parameters:</p> Name Type Description Default <code>obj</code> <code>DocObject</code> <p>Documentation object to add as a member.</p> required"},{"location":"models/object/#docforge.models.object.DocObject.get_all_members","title":"get_all_members","text":"<pre><code>get_all_members() -&gt; Iterable[DocObject]\n</code></pre> <p>Return all child members of the object.</p> <p>Returns:</p> Type Description <code>Iterable[DocObject]</code> <p>An iterable of <code>DocObject</code> instances representing nested members.</p>"},{"location":"models/object/#docforge.models.object.DocObject.get_member","title":"get_member","text":"<pre><code>get_member(name: str) -&gt; DocObject\n</code></pre> <p>Retrieve a member object by name.</p> <p>Parameters:</p> Name Type Description Default <code>name</code> <code>str</code> <p>Name of the member to retrieve.</p> required <p>Returns:</p> Type Description <code>DocObject</code> <p>The corresponding <code>DocObject</code> instance.</p> <p>Raises:</p> Type Description <code>KeyError</code> <p>If the member does not exist.</p>"},{"location":"models/project/","title":"Project","text":""},{"location":"models/project/#docforge.models.project","title":"docforge.models.project","text":"<p>Documentation model representing a project.</p> <p>This module defines the <code>Project</code> class, the top-level container used by doc-forge to represent a documented codebase. A <code>Project</code> aggregates multiple modules and provides access to them through a unified interface.</p>"},{"location":"models/project/#docforge.models.project-classes","title":"Classes","text":""},{"location":"models/project/#docforge.models.project.Project","title":"Project","text":"<pre><code>Project(name: str)\n</code></pre> <p>Representation of a documentation project.</p> <p>A <code>Project</code> serves as the root container for all modules discovered during introspection. Each module is stored by its dotted import path.</p> <p>Attributes:</p> Name Type Description <code>name</code> <code>str</code> <p>Name of the project.</p> <code>modules</code> <code>Dict[str, Module]</code> <p>Mapping of module paths to <code>Module</code> instances.</p> <p>Initialize a Project instance.</p> <p>Parameters:</p> Name Type Description Default <code>name</code> <code>str</code> <p>Name used to identify the documentation project.</p> required"},{"location":"models/project/#docforge.models.project.Project-functions","title":"Functions","text":""},{"location":"models/project/#docforge.models.project.Project.add_module","title":"add_module","text":"<pre><code>add_module(module: Module) -&gt; None\n</code></pre> <p>Register a module in the project.</p> <p>Parameters:</p> Name Type Description Default <code>module</code> <code>Module</code> <p>Module instance to add to the project.</p> required"},{"location":"models/project/#docforge.models.project.Project.get_all_modules","title":"get_all_modules","text":"<pre><code>get_all_modules() -&gt; Iterable[Module]\n</code></pre> <p>Return all modules contained in the project.</p> <p>Returns:</p> Type Description <code>Iterable[Module]</code> <p>An iterable of <code>Module</code> instances.</p>"},{"location":"models/project/#docforge.models.project.Project.get_module","title":"get_module","text":"<pre><code>get_module(path: str) -&gt; Module\n</code></pre> <p>Retrieve a module by its dotted path.</p> <p>Parameters:</p> Name Type Description Default <code>path</code> <code>str</code> <p>Fully qualified dotted module path (for example <code>pkg.module</code>).</p> required <p>Returns:</p> Type Description <code>Module</code> <p>The corresponding <code>Module</code> instance.</p> <p>Raises:</p> Type Description <code>KeyError</code> <p>If the module does not exist in the project.</p>"},{"location":"models/project/#docforge.models.project.Project.get_module_list","title":"get_module_list","text":"<pre><code>get_module_list() -&gt; list[str]\n</code></pre> <p>Return the list of module import paths.</p> <p>Returns:</p> Type Description <code>list[str]</code> <p>A list containing the dotted paths of all modules in the project.</p>"},{"location":"nav/","title":"Nav","text":""},{"location":"nav/#docforge.nav","title":"docforge.nav","text":"<p>Navigation layer for doc-forge.</p> <p>The <code>docforge.nav</code> package manages the relationship between the logical documentation structure defined by the user and the physical documentation files generated on disk.</p>"},{"location":"nav/#docforge.nav--workflow","title":"Workflow","text":"<ol> <li>Specification \u2013 Users define navigation intent in <code>docforge.nav.yml</code>.</li> <li>Resolution \u2013 <code>resolve_nav</code> expands patterns and matches them against generated Markdown files.</li> <li>Emission \u2013 <code>MkDocsNavEmitter</code> converts the resolved structure into the YAML navigation format required by <code>mkdocs.yml</code>.</li> </ol> <p>This layer separates documentation organization from the underlying source code layout, enabling flexible grouping, ordering, and navigation structures independent of module hierarchy.</p>"},{"location":"nav/#docforge.nav-classes","title":"Classes","text":""},{"location":"nav/#docforge.nav.MkDocsNavEmitter","title":"MkDocsNavEmitter","text":"<p>Emit MkDocs navigation structures from resolved navigation data.</p> <p>The emitter transforms a <code>ResolvedNav</code> object into the YAML-compatible list structure expected by the MkDocs <code>nav</code> configuration field.</p>"},{"location":"nav/#docforge.nav.MkDocsNavEmitter-functions","title":"Functions","text":""},{"location":"nav/#docforge.nav.MkDocsNavEmitter.emit","title":"emit","text":"<pre><code>emit(nav: ResolvedNav) -&gt; List[Dict[str, Any]]\n</code></pre> <p>Generate a navigation structure for <code>mkdocs.yml</code>.</p> <p>Parameters:</p> Name Type Description Default <code>nav</code> <code>ResolvedNav</code> <p>Resolved navigation data describing documentation groups and their associated Markdown files.</p> required <p>Returns:</p> Type Description <code>List[Dict[str, Any]]</code> <p>A list of dictionaries representing the MkDocs navigation layout.</p> <code>List[Dict[str, Any]]</code> <p>Each dictionary maps a navigation label to a page or a list of</p> <code>List[Dict[str, Any]]</code> <p>pages.</p>"},{"location":"nav/#docforge.nav.NavSpec","title":"NavSpec","text":"<pre><code>NavSpec(home: Optional[str], groups: Dict[str, List[str]])\n</code></pre> <p>Parsed representation of a navigation specification.</p> <p>A <code>NavSpec</code> describes the intended documentation navigation layout before it is resolved against the filesystem.</p> <p>Attributes:</p> Name Type Description <code>home</code> <code>Optional[str]</code> <p>Relative path to the documentation home page (for example <code>index.md</code>).</p> <code>groups</code> <code>Dict[str, List[str]]</code> <p>Mapping of navigation group titles to lists of file patterns or glob expressions.</p> <p>Initialize a NavSpec instance.</p> <p>Parameters:</p> Name Type Description Default <code>home</code> <code>Optional[str]</code> <p>Relative path to the home document.</p> required <code>groups</code> <code>Dict[str, List[str]]</code> <p>Mapping of group names to lists of path patterns (glob expressions).</p> required"},{"location":"nav/#docforge.nav.NavSpec-functions","title":"Functions","text":""},{"location":"nav/#docforge.nav.NavSpec.all_patterns","title":"all_patterns","text":"<pre><code>all_patterns() -&gt; List[str]\n</code></pre> <p>Return all path patterns referenced by the specification.</p> <p>Returns:</p> Type Description <code>List[str]</code> <p>A list containing the home document (if defined) and all</p> <code>List[str]</code> <p>group pattern entries.</p>"},{"location":"nav/#docforge.nav.NavSpec.load","title":"load <code>classmethod</code>","text":"<pre><code>load(path: Path) -&gt; NavSpec\n</code></pre> <p>Load a navigation specification from a YAML file.</p> <p>Parameters:</p> Name Type Description Default <code>path</code> <code>Path</code> <p>Filesystem path to the navigation specification file.</p> required <p>Returns:</p> Type Description <code>NavSpec</code> <p>A <code>NavSpec</code> instance representing the parsed configuration.</p> <p>Raises:</p> Type Description <code>FileNotFoundError</code> <p>If the specified file does not exist.</p> <code>ValueError</code> <p>If the file contents are not a valid navigation specification.</p>"},{"location":"nav/#docforge.nav.ResolvedNav","title":"ResolvedNav","text":"<pre><code>ResolvedNav(home: str | None, groups: Dict[str, List[Path]], docs_root: Path | None = None)\n</code></pre> <p>Resolved navigation structure.</p> <p>A <code>ResolvedNav</code> represents navigation data after glob patterns have been expanded and paths validated against the filesystem.</p> <p>Attributes:</p> Name Type Description <code>home</code> <code>Optional[str]</code> <p>Relative path to the documentation home page.</p> <code>groups</code> <code>Dict[str, List[Path]]</code> <p>Mapping of navigation group titles to lists of resolved documentation file paths.</p> <p>Initialize a ResolvedNav instance.</p> <p>Parameters:</p> Name Type Description Default <code>home</code> <code>str | None</code> <p>Relative path to the home page within the documentation root.</p> required <code>groups</code> <code>Dict[str, List[Path]]</code> <p>Mapping of group titles to resolved documentation file paths.</p> required <code>docs_root</code> <code>Path | None</code> <p>Root directory of the documentation source files.</p> <code>None</code>"},{"location":"nav/#docforge.nav.ResolvedNav-functions","title":"Functions","text":""},{"location":"nav/#docforge.nav.ResolvedNav.all_files","title":"all_files","text":"<pre><code>all_files() -&gt; Iterable[Path]\n</code></pre> <p>Iterate over all files referenced by the navigation structure.</p> <p>Returns:</p> Type Description <code>Iterable[Path]</code> <p>An iterable of <code>Path</code> objects representing documentation files.</p> <p>Raises:</p> Type Description <code>RuntimeError</code> <p>If the home page is defined but the documentation root is not available for resolution.</p>"},{"location":"nav/#docforge.nav-functions","title":"Functions","text":""},{"location":"nav/#docforge.nav.load_nav_spec","title":"load_nav_spec","text":"<pre><code>load_nav_spec(path: Path) -&gt; NavSpec\n</code></pre> <p>Load a navigation specification file.</p> <p>This helper function reads a YAML navigation file and constructs a corresponding <code>NavSpec</code> instance.</p> <p>Parameters:</p> Name Type Description Default <code>path</code> <code>Path</code> <p>Path to the navigation specification file.</p> required <p>Returns:</p> Type Description <code>NavSpec</code> <p>A <code>NavSpec</code> instance representing the parsed specification.</p> <p>Raises:</p> Type Description <code>FileNotFoundError</code> <p>If the specification file does not exist.</p> <code>ValueError</code> <p>If the YAML structure is invalid.</p>"},{"location":"nav/#docforge.nav.resolve_nav","title":"resolve_nav","text":"<pre><code>resolve_nav(spec: NavSpec, docs_root: Path) -&gt; ResolvedNav\n</code></pre> <p>Resolve a navigation specification against the filesystem.</p> <p>The function expands glob patterns defined in a <code>NavSpec</code> and verifies that referenced documentation files exist within the documentation root.</p> <p>Parameters:</p> Name Type Description Default <code>spec</code> <code>NavSpec</code> <p>Navigation specification describing documentation layout.</p> required <code>docs_root</code> <code>Path</code> <p>Root directory containing documentation Markdown files.</p> required <p>Returns:</p> Type Description <code>ResolvedNav</code> <p>A <code>ResolvedNav</code> instance containing validated navigation paths.</p> <p>Raises:</p> Type Description <code>FileNotFoundError</code> <p>If the documentation root does not exist or a navigation pattern does not match any files.</p>"},{"location":"nav/mkdocs/","title":"Mkdocs","text":""},{"location":"nav/mkdocs/#docforge.nav.mkdocs","title":"docforge.nav.mkdocs","text":"<p>MkDocs navigation emitter.</p> <p>This module provides the <code>MkDocsNavEmitter</code> class, which converts a <code>ResolvedNav</code> instance into the navigation structure required by the MkDocs <code>nav</code> configuration.</p>"},{"location":"nav/mkdocs/#docforge.nav.mkdocs-classes","title":"Classes","text":""},{"location":"nav/mkdocs/#docforge.nav.mkdocs.MkDocsNavEmitter","title":"MkDocsNavEmitter","text":"<p>Emit MkDocs navigation structures from resolved navigation data.</p> <p>The emitter transforms a <code>ResolvedNav</code> object into the YAML-compatible list structure expected by the MkDocs <code>nav</code> configuration field.</p>"},{"location":"nav/mkdocs/#docforge.nav.mkdocs.MkDocsNavEmitter-functions","title":"Functions","text":""},{"location":"nav/mkdocs/#docforge.nav.mkdocs.MkDocsNavEmitter.emit","title":"emit","text":"<pre><code>emit(nav: ResolvedNav) -&gt; List[Dict[str, Any]]\n</code></pre> <p>Generate a navigation structure for <code>mkdocs.yml</code>.</p> <p>Parameters:</p> Name Type Description Default <code>nav</code> <code>ResolvedNav</code> <p>Resolved navigation data describing documentation groups and their associated Markdown files.</p> required <p>Returns:</p> Type Description <code>List[Dict[str, Any]]</code> <p>A list of dictionaries representing the MkDocs navigation layout.</p> <code>List[Dict[str, Any]]</code> <p>Each dictionary maps a navigation label to a page or a list of</p> <code>List[Dict[str, Any]]</code> <p>pages.</p>"},{"location":"nav/resolver/","title":"Resolver","text":""},{"location":"nav/resolver/#docforge.nav.resolver","title":"docforge.nav.resolver","text":"<p>Navigation resolution utilities.</p> <p>This module resolves a <code>NavSpec</code> against the filesystem by expanding glob patterns and validating that referenced documentation files exist.</p>"},{"location":"nav/resolver/#docforge.nav.resolver-classes","title":"Classes","text":""},{"location":"nav/resolver/#docforge.nav.resolver.ResolvedNav","title":"ResolvedNav","text":"<pre><code>ResolvedNav(home: str | None, groups: Dict[str, List[Path]], docs_root: Path | None = None)\n</code></pre> <p>Resolved navigation structure.</p> <p>A <code>ResolvedNav</code> represents navigation data after glob patterns have been expanded and paths validated against the filesystem.</p> <p>Attributes:</p> Name Type Description <code>home</code> <code>Optional[str]</code> <p>Relative path to the documentation home page.</p> <code>groups</code> <code>Dict[str, List[Path]]</code> <p>Mapping of navigation group titles to lists of resolved documentation file paths.</p> <p>Initialize a ResolvedNav instance.</p> <p>Parameters:</p> Name Type Description Default <code>home</code> <code>str | None</code> <p>Relative path to the home page within the documentation root.</p> required <code>groups</code> <code>Dict[str, List[Path]]</code> <p>Mapping of group titles to resolved documentation file paths.</p> required <code>docs_root</code> <code>Path | None</code> <p>Root directory of the documentation source files.</p> <code>None</code>"},{"location":"nav/resolver/#docforge.nav.resolver.ResolvedNav-functions","title":"Functions","text":""},{"location":"nav/resolver/#docforge.nav.resolver.ResolvedNav.all_files","title":"all_files","text":"<pre><code>all_files() -&gt; Iterable[Path]\n</code></pre> <p>Iterate over all files referenced by the navigation structure.</p> <p>Returns:</p> Type Description <code>Iterable[Path]</code> <p>An iterable of <code>Path</code> objects representing documentation files.</p> <p>Raises:</p> Type Description <code>RuntimeError</code> <p>If the home page is defined but the documentation root is not available for resolution.</p>"},{"location":"nav/resolver/#docforge.nav.resolver-functions","title":"Functions","text":""},{"location":"nav/resolver/#docforge.nav.resolver.resolve_nav","title":"resolve_nav","text":"<pre><code>resolve_nav(spec: NavSpec, docs_root: Path) -&gt; ResolvedNav\n</code></pre> <p>Resolve a navigation specification against the filesystem.</p> <p>The function expands glob patterns defined in a <code>NavSpec</code> and verifies that referenced documentation files exist within the documentation root.</p> <p>Parameters:</p> Name Type Description Default <code>spec</code> <code>NavSpec</code> <p>Navigation specification describing documentation layout.</p> required <code>docs_root</code> <code>Path</code> <p>Root directory containing documentation Markdown files.</p> required <p>Returns:</p> Type Description <code>ResolvedNav</code> <p>A <code>ResolvedNav</code> instance containing validated navigation paths.</p> <p>Raises:</p> Type Description <code>FileNotFoundError</code> <p>If the documentation root does not exist or a navigation pattern does not match any files.</p>"},{"location":"nav/spec/","title":"Spec","text":""},{"location":"nav/spec/#docforge.nav.spec","title":"docforge.nav.spec","text":"<p>Navigation specification model.</p> <p>This module defines the <code>NavSpec</code> class, which represents the navigation structure defined by the user in the doc-forge navigation specification (typically <code>docforge.nav.yml</code>).</p>"},{"location":"nav/spec/#docforge.nav.spec-classes","title":"Classes","text":""},{"location":"nav/spec/#docforge.nav.spec.NavSpec","title":"NavSpec","text":"<pre><code>NavSpec(home: Optional[str], groups: Dict[str, List[str]])\n</code></pre> <p>Parsed representation of a navigation specification.</p> <p>A <code>NavSpec</code> describes the intended documentation navigation layout before it is resolved against the filesystem.</p> <p>Attributes:</p> Name Type Description <code>home</code> <code>Optional[str]</code> <p>Relative path to the documentation home page (for example <code>index.md</code>).</p> <code>groups</code> <code>Dict[str, List[str]]</code> <p>Mapping of navigation group titles to lists of file patterns or glob expressions.</p> <p>Initialize a NavSpec instance.</p> <p>Parameters:</p> Name Type Description Default <code>home</code> <code>Optional[str]</code> <p>Relative path to the home document.</p> required <code>groups</code> <code>Dict[str, List[str]]</code> <p>Mapping of group names to lists of path patterns (glob expressions).</p> required"},{"location":"nav/spec/#docforge.nav.spec.NavSpec-functions","title":"Functions","text":""},{"location":"nav/spec/#docforge.nav.spec.NavSpec.all_patterns","title":"all_patterns","text":"<pre><code>all_patterns() -&gt; List[str]\n</code></pre> <p>Return all path patterns referenced by the specification.</p> <p>Returns:</p> Type Description <code>List[str]</code> <p>A list containing the home document (if defined) and all</p> <code>List[str]</code> <p>group pattern entries.</p>"},{"location":"nav/spec/#docforge.nav.spec.NavSpec.load","title":"load <code>classmethod</code>","text":"<pre><code>load(path: Path) -&gt; NavSpec\n</code></pre> <p>Load a navigation specification from a YAML file.</p> <p>Parameters:</p> Name Type Description Default <code>path</code> <code>Path</code> <p>Filesystem path to the navigation specification file.</p> required <p>Returns:</p> Type Description <code>NavSpec</code> <p>A <code>NavSpec</code> instance representing the parsed configuration.</p> <p>Raises:</p> Type Description <code>FileNotFoundError</code> <p>If the specified file does not exist.</p> <code>ValueError</code> <p>If the file contents are not a valid navigation specification.</p>"},{"location":"nav/spec/#docforge.nav.spec-functions","title":"Functions","text":""},{"location":"nav/spec/#docforge.nav.spec.load_nav_spec","title":"load_nav_spec","text":"<pre><code>load_nav_spec(path: Path) -&gt; NavSpec\n</code></pre> <p>Load a navigation specification file.</p> <p>This helper function reads a YAML navigation file and constructs a corresponding <code>NavSpec</code> instance.</p> <p>Parameters:</p> Name Type Description Default <code>path</code> <code>Path</code> <p>Path to the navigation specification file.</p> required <p>Returns:</p> Type Description <code>NavSpec</code> <p>A <code>NavSpec</code> instance representing the parsed specification.</p> <p>Raises:</p> Type Description <code>FileNotFoundError</code> <p>If the specification file does not exist.</p> <code>ValueError</code> <p>If the YAML structure is invalid.</p>"},{"location":"renderers/","title":"Renderers","text":""},{"location":"renderers/#docforge.renderers","title":"docforge.renderers","text":"<p>Renderers layer for doc-forge.</p> <p>The <code>docforge.renderers</code> package transforms the internal documentation models into files formatted for specific documentation systems.</p>"},{"location":"renderers/#docforge.renderers--overview","title":"Overview","text":"<p>Renderers consume the doc-forge project model and generate output suitable for documentation tools or machine interfaces.</p> <p>Current implementations:</p> <ul> <li>MkDocsRenderer \u2013 Produces Markdown files compatible with MkDocs and the <code>mkdocstrings</code> plugin. It automatically handles package hierarchy and generates <code>index.md</code> files for packages.</li> <li>MCPRenderer \u2013 Emits structured JSON resources designed for consumption by Model Context Protocol (MCP) clients.</li> </ul>"},{"location":"renderers/#docforge.renderers--extending","title":"Extending","text":"<p>New renderers can be added by implementing the <code>DocRenderer</code> protocol defined in <code>docforge.renderers.base</code>.</p>"},{"location":"renderers/#docforge.renderers-classes","title":"Classes","text":""},{"location":"renderers/#docforge.renderers.MCPRenderer","title":"MCPRenderer","text":"<p>Renderer that generates MCP-compatible documentation resources.</p> <p>This renderer converts doc-forge project models into structured JSON resources suitable for consumption by systems implementing the Model Context Protocol (MCP).</p>"},{"location":"renderers/#docforge.renderers.MCPRenderer-functions","title":"Functions","text":""},{"location":"renderers/#docforge.renderers.MCPRenderer.generate_sources","title":"generate_sources","text":"<pre><code>generate_sources(project: Project, out_dir: Path) -&gt; None\n</code></pre> <p>Generate MCP documentation resources for a project.</p> <p>The renderer serializes each module into a JSON resource and produces supporting metadata files such as <code>nav.json</code> and <code>index.json</code>.</p> <p>Parameters:</p> Name Type Description Default <code>project</code> <code>Project</code> <p>Documentation project model to render.</p> required <code>out_dir</code> <code>Path</code> <p>Directory where MCP resources will be written.</p> required"},{"location":"renderers/#docforge.renderers.MkDocsRenderer","title":"MkDocsRenderer","text":"<p>Renderer that produces Markdown documentation for MkDocs.</p> <p>Generated pages use mkdocstrings directives to reference Python modules, allowing MkDocs to render API documentation dynamically.</p>"},{"location":"renderers/#docforge.renderers.MkDocsRenderer-functions","title":"Functions","text":""},{"location":"renderers/#docforge.renderers.MkDocsRenderer.generate_readme","title":"generate_readme","text":"<pre><code>generate_readme(project: Project, docs_dir: Path, module_is_source: bool | None = None) -&gt; None\n</code></pre> <p>Generate a <code>README.md</code> file from the root module docstring.</p> <p>Behavior:</p> <ul> <li>If <code>module_is_source</code> is True, <code>README.md</code> is written to the project root directory.</li> <li>If False, README generation is currently not implemented.</li> </ul> <p>Parameters:</p> Name Type Description Default <code>project</code> <code>Project</code> <p>Project model containing documentation metadata.</p> required <code>docs_dir</code> <code>Path</code> <p>Directory containing generated documentation sources.</p> required <code>module_is_source</code> <code>bool | None</code> <p>Whether the module is treated as the project source root.</p> <code>None</code>"},{"location":"renderers/#docforge.renderers.MkDocsRenderer.generate_sources","title":"generate_sources","text":"<pre><code>generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -&gt; None\n</code></pre> <p>Generate Markdown documentation files for a project.</p> <p>This method renders a documentation structure from the provided project model and writes the resulting Markdown files to the specified output directory.</p> <p>Parameters:</p> Name Type Description Default <code>project</code> <code>Project</code> <p>Project model containing modules to document.</p> required <code>out_dir</code> <code>Path</code> <p>Directory where generated Markdown files will be written.</p> required <code>module_is_source</code> <code>bool | None</code> <p>If True, treat the specified module as the documentation root rather than nesting it inside a folder.</p> <code>None</code>"},{"location":"renderers/base/","title":"Base","text":""},{"location":"renderers/base/#docforge.renderers.base","title":"docforge.renderers.base","text":"<p>Renderer base interfaces and configuration models.</p> <p>This module defines the base protocol and configuration container used by doc-forge renderers. Concrete renderer implementations should implement the <code>DocRenderer</code> protocol.</p>"},{"location":"renderers/base/#docforge.renderers.base-classes","title":"Classes","text":""},{"location":"renderers/base/#docforge.renderers.base.DocRenderer","title":"DocRenderer","text":"<p> Bases: <code>Protocol</code></p> <p>Protocol defining the interface for documentation renderers.</p> <p>Implementations of this protocol are responsible for transforming a <code>Project</code> model into renderer-specific documentation sources.</p>"},{"location":"renderers/base/#docforge.renderers.base.DocRenderer-functions","title":"Functions","text":""},{"location":"renderers/base/#docforge.renderers.base.DocRenderer.generate_sources","title":"generate_sources","text":"<pre><code>generate_sources(project: Project, out_dir: Path) -&gt; None\n</code></pre> <p>Generate renderer-specific documentation sources.</p> <p>Parameters:</p> Name Type Description Default <code>project</code> <code>Project</code> <p>Project model containing modules and documentation objects.</p> required <code>out_dir</code> <code>Path</code> <p>Directory where generated documentation sources should be written.</p> required"},{"location":"renderers/base/#docforge.renderers.base.RendererConfig","title":"RendererConfig","text":"<pre><code>RendererConfig(out_dir: Path, project: Project)\n</code></pre> <p>Configuration container for documentation renderers.</p> <p>A <code>RendererConfig</code> instance groups together the project model and the output directory used during rendering.</p> <p>Attributes:</p> Name Type Description <code>out_dir</code> <code>Path</code> <p>Directory where generated documentation files will be written.</p> <code>project</code> <code>Project</code> <p>Documentation project model to be rendered.</p> <p>Initialize a RendererConfig instance.</p> <p>Parameters:</p> Name Type Description Default <code>out_dir</code> <code>Path</code> <p>Target directory where documentation files should be written.</p> required <code>project</code> <code>Project</code> <p>Introspected project model to render.</p> required"},{"location":"renderers/base/#docforge.renderers.base.RendererConfig-functions","title":"Functions","text":""},{"location":"renderers/mcp_renderer/","title":"Mcp Renderer","text":""},{"location":"renderers/mcp_renderer/#docforge.renderers.mcp_renderer","title":"docforge.renderers.mcp_renderer","text":""},{"location":"renderers/mcp_renderer/#docforge.renderers.mcp_renderer-classes","title":"Classes","text":""},{"location":"renderers/mcp_renderer/#docforge.renderers.mcp_renderer.MCPRenderer","title":"MCPRenderer","text":"<p>Renderer that generates MCP-compatible documentation resources.</p> <p>This renderer converts doc-forge project models into structured JSON resources suitable for consumption by systems implementing the Model Context Protocol (MCP).</p>"},{"location":"renderers/mcp_renderer/#docforge.renderers.mcp_renderer.MCPRenderer-functions","title":"Functions","text":""},{"location":"renderers/mcp_renderer/#docforge.renderers.mcp_renderer.MCPRenderer.generate_sources","title":"generate_sources","text":"<pre><code>generate_sources(project: Project, out_dir: Path) -&gt; None\n</code></pre> <p>Generate MCP documentation resources for a project.</p> <p>The renderer serializes each module into a JSON resource and produces supporting metadata files such as <code>nav.json</code> and <code>index.json</code>.</p> <p>Parameters:</p> Name Type Description Default <code>project</code> <code>Project</code> <p>Documentation project model to render.</p> required <code>out_dir</code> <code>Path</code> <p>Directory where MCP resources will be written.</p> required"},{"location":"renderers/mkdocs_renderer/","title":"Mkdocs Renderer","text":""},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer","title":"docforge.renderers.mkdocs_renderer","text":"<p>MkDocs renderer implementation.</p> <p>This module defines the <code>MkDocsRenderer</code> class, which generates Markdown documentation sources compatible with MkDocs Material and the mkdocstrings plugin.</p> <p>The renderer ensures a consistent documentation structure by:</p> <ul> <li>Creating a root <code>index.md</code> if one does not exist</li> <li>Generating package index pages automatically</li> <li>Linking child modules within parent package pages</li> <li>Optionally generating <code>README.md</code> from the root package docstring</li> </ul>"},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer-classes","title":"Classes","text":""},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer.MkDocsRenderer","title":"MkDocsRenderer","text":"<p>Renderer that produces Markdown documentation for MkDocs.</p> <p>Generated pages use mkdocstrings directives to reference Python modules, allowing MkDocs to render API documentation dynamically.</p>"},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer.MkDocsRenderer-functions","title":"Functions","text":""},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme","title":"generate_readme","text":"<pre><code>generate_readme(project: Project, docs_dir: Path, module_is_source: bool | None = None) -&gt; None\n</code></pre> <p>Generate a <code>README.md</code> file from the root module docstring.</p> <p>Behavior:</p> <ul> <li>If <code>module_is_source</code> is True, <code>README.md</code> is written to the project root directory.</li> <li>If False, README generation is currently not implemented.</li> </ul> <p>Parameters:</p> Name Type Description Default <code>project</code> <code>Project</code> <p>Project model containing documentation metadata.</p> required <code>docs_dir</code> <code>Path</code> <p>Directory containing generated documentation sources.</p> required <code>module_is_source</code> <code>bool | None</code> <p>Whether the module is treated as the project source root.</p> <code>None</code>"},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources","title":"generate_sources","text":"<pre><code>generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -&gt; None\n</code></pre> <p>Generate Markdown documentation files for a project.</p> <p>This method renders a documentation structure from the provided project model and writes the resulting Markdown files to the specified output directory.</p> <p>Parameters:</p> Name Type Description Default <code>project</code> <code>Project</code> <p>Project model containing modules to document.</p> required <code>out_dir</code> <code>Path</code> <p>Directory where generated Markdown files will be written.</p> required <code>module_is_source</code> <code>bool | None</code> <p>If True, treat the specified module as the documentation root rather than nesting it inside a folder.</p> <code>None</code>"},{"location":"servers/","title":"Servers","text":""},{"location":"servers/#docforge.servers","title":"docforge.servers","text":"<p>Server layer for doc-forge.</p> <p>This module exposes server implementations used to provide live access to generated documentation resources. Currently, it includes the MCP documentation server.</p>"},{"location":"servers/#docforge.servers-classes","title":"Classes","text":""},{"location":"servers/#docforge.servers.MCPServer","title":"MCPServer","text":"<pre><code>MCPServer(mcp_root: Path, name: str)\n</code></pre> <p>MCP server for serving a pre-generated documentation bundle.</p> <p>The server exposes documentation resources and diagnostic tools through MCP endpoints backed by JSON files generated by the MCP renderer.</p> <p>Initialize the MCP server.</p> <p>Parameters:</p> Name Type Description Default <code>mcp_root</code> <code>Path</code> <p>Directory containing the generated MCP documentation bundle (for example <code>index.json</code>, <code>nav.json</code>, and <code>modules/</code>).</p> required <code>name</code> <code>str</code> <p>Identifier used for the MCP server instance.</p> required"},{"location":"servers/#docforge.servers.MCPServer-functions","title":"Functions","text":""},{"location":"servers/#docforge.servers.MCPServer.run","title":"run","text":"<pre><code>run(transport: Literal['stdio', 'sse', 'streamable-http'] = 'streamable-http') -&gt; None\n</code></pre> <p>Start the MCP server.</p> <p>Parameters:</p> Name Type Description Default <code>transport</code> <code>Literal['stdio', 'sse', 'streamable-http']</code> <p>Transport mechanism used by the MCP server. Supported options include <code>stdio</code>, <code>sse</code>, and <code>streamable-http</code>.</p> <code>'streamable-http'</code>"},{"location":"servers/mcp_server/","title":"Mcp Server","text":""},{"location":"servers/mcp_server/#docforge.servers.mcp_server","title":"docforge.servers.mcp_server","text":""},{"location":"servers/mcp_server/#docforge.servers.mcp_server-classes","title":"Classes","text":""},{"location":"servers/mcp_server/#docforge.servers.mcp_server.MCPServer","title":"MCPServer","text":"<pre><code>MCPServer(mcp_root: Path, name: str)\n</code></pre> <p>MCP server for serving a pre-generated documentation bundle.</p> <p>The server exposes documentation resources and diagnostic tools through MCP endpoints backed by JSON files generated by the MCP renderer.</p> <p>Initialize the MCP server.</p> <p>Parameters:</p> Name Type Description Default <code>mcp_root</code> <code>Path</code> <p>Directory containing the generated MCP documentation bundle (for example <code>index.json</code>, <code>nav.json</code>, and <code>modules/</code>).</p> required <code>name</code> <code>str</code> <p>Identifier used for the MCP server instance.</p> required"},{"location":"servers/mcp_server/#docforge.servers.mcp_server.MCPServer-functions","title":"Functions","text":""},{"location":"servers/mcp_server/#docforge.servers.mcp_server.MCPServer.run","title":"run","text":"<pre><code>run(transport: Literal['stdio', 'sse', 'streamable-http'] = 'streamable-http') -&gt; None\n</code></pre> <p>Start the MCP server.</p> <p>Parameters:</p> Name Type Description Default <code>transport</code> <code>Literal['stdio', 'sse', 'streamable-http']</code> <p>Transport mechanism used by the MCP server. Supported options include <code>stdio</code>, <code>sse</code>, and <code>streamable-http</code>.</p> <code>'streamable-http'</code>"}]}