From 03caf5ce4c969897d9ce6153a144d0b809f3ff41 Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Wed, 21 Jan 2026 17:59:46 +0530 Subject: [PATCH 1/7] refactor: restructure CLI and improve documentation/typing - Consolidated CLI commands into [build](cci:1://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/docforge/cli/mkdocs/logic.py:48:0-58:46) and [serve](cci:1://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/docforge/cli/commands.py:70:0-92:32) using `--mkdocs` and `--mcp` flags. - Separated CLI orchestration logic into [docforge/cli/mkdocs/logic.py](cci:7://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/docforge/cli/mkdocs/logic.py:0:0-0:0) and [docforge/cli/mcp/logic.py](cci:7://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/docforge/cli/mcp/logic.py:0:0-0:0). - Moved command definitions to [docforge/cli/commands.py](cci:7://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/docforge/cli/commands.py:0:0-0:0), making [main.py](cci:7://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/docforge/cli/main.py:0:0-0:0) a thin entry point. - Aligned [.pyi](cci:7://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/docforge/cli/main.pyi:0:0-0:0) type stubs with [.py](cci:7://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/tests/conftest.py:0:0-0:0) implementations across the package. - Added missing docstrings to internal helper functions and core classes. - Restructured tests into `tests/mkdocs/` and `tests/mcp/`. - Updated navigation specification to reflect the new project structure. --- docforge.nav.yml | 6 +- docforge/cli/commands.py | 129 +++ docforge/cli/main.py | 266 +---- docforge/cli/main.pyi | 109 --- docforge/cli/mcp/__init__.py | 0 docforge/cli/mcp/logic.py | 39 + docforge/cli/mkdocs.py | 116 --- docforge/cli/mkdocs.pyi | 45 - docforge/cli/mkdocs/__init__.py | 0 docforge/cli/mkdocs/logic.py | 69 ++ docs/docforge/cli/commands.md | 3 + docs/docforge/cli/mcp/index.md | 3 + docs/docforge/cli/mcp/logic.md | 3 + .../cli/{mkdocs.md => mkdocs/index.md} | 0 docs/docforge/cli/mkdocs/logic.md | 3 + docs/docforge/servers/index.md | 3 + docs/docforge/servers/mcp_server.md | 3 + mcp_docs/index.json | 2 +- mcp_docs/modules/docforge.cli.commands.json | 356 +++++++ mcp_docs/modules/docforge.cli.json | 756 +++++++++++---- mcp_docs/modules/docforge.cli.main.json | 159 +-- mcp_docs/modules/docforge.cli.mcp.json | 129 +++ mcp_docs/modules/docforge.cli.mcp.logic.json | 120 +++ mcp_docs/modules/docforge.cli.mkdocs.json | 226 +++-- .../modules/docforge.cli.mkdocs.logic.json | 148 +++ mcp_docs/modules/docforge.json | 911 +++++++++++------- mcp_docs/nav.json | 16 + mkdocs.yml | 10 +- tests/cli/conftest.py | 111 --- tests/cli/test_build.py | 20 - .../{test_generate.py => test_build_mcp.py} | 26 +- tests/cli/test_build_mkdocs.py | 54 ++ tests/cli/test_mkdocs.py | 123 --- .../{test_mcp_serve.py => test_serve_mcp.py} | 5 +- .../{test_serve.py => test_serve_mkdocs.py} | 4 +- tests/cli/test_tree.py | 24 - tests/conftest.py | 110 ++- 37 files changed, 2514 insertions(+), 1593 deletions(-) create mode 100644 docforge/cli/commands.py delete mode 100644 docforge/cli/main.pyi create mode 100644 docforge/cli/mcp/__init__.py create mode 100644 docforge/cli/mcp/logic.py delete mode 100644 docforge/cli/mkdocs.py delete mode 100644 docforge/cli/mkdocs.pyi create mode 100644 docforge/cli/mkdocs/__init__.py create mode 100644 docforge/cli/mkdocs/logic.py create mode 100644 docs/docforge/cli/commands.md create mode 100644 docs/docforge/cli/mcp/index.md create mode 100644 docs/docforge/cli/mcp/logic.md rename docs/docforge/cli/{mkdocs.md => mkdocs/index.md} (100%) create mode 100644 docs/docforge/cli/mkdocs/logic.md create mode 100644 docs/docforge/servers/index.md create mode 100644 docs/docforge/servers/mcp_server.md create mode 100644 mcp_docs/modules/docforge.cli.commands.json create mode 100644 mcp_docs/modules/docforge.cli.mcp.json create mode 100644 mcp_docs/modules/docforge.cli.mcp.logic.json create mode 100644 mcp_docs/modules/docforge.cli.mkdocs.logic.json delete mode 100644 tests/cli/conftest.py delete mode 100644 tests/cli/test_build.py rename tests/cli/{test_generate.py => test_build_mcp.py} (54%) create mode 100644 tests/cli/test_build_mkdocs.py delete mode 100644 tests/cli/test_mkdocs.py rename tests/cli/{test_mcp_serve.py => test_serve_mcp.py} (77%) rename tests/cli/{test_serve.py => test_serve_mkdocs.py} (87%) delete mode 100644 tests/cli/test_tree.py diff --git a/docforge.nav.yml b/docforge.nav.yml index a22b7f7..d83af04 100644 --- a/docforge.nav.yml +++ b/docforge.nav.yml @@ -21,4 +21,8 @@ groups: CLI: - docforge/cli/index.md - docforge/cli/main.md - - docforge/cli/mkdocs.md + - docforge/cli/commands.md + - docforge/cli/mcp/index.md + - docforge/cli/mcp/logic.md + - docforge/cli/mkdocs/index.md + - docforge/cli/mkdocs/logic.md diff --git a/docforge/cli/commands.py b/docforge/cli/commands.py new file mode 100644 index 0000000..34585e3 --- /dev/null +++ b/docforge/cli/commands.py @@ -0,0 +1,129 @@ +import click +from pathlib import Path +from typing import Sequence, Optional +from docforge.loaders import GriffeLoader +from docforge.cli.mkdocs import logic as mkdocs_logic +from docforge.cli.mcp import logic as mcp_logic + +@click.group() +def cli() -> None: + """ + doc-forge CLI: A tool for introspecting Python projects and generating + documentation. + """ + pass + +@cli.command() +@click.option("--mcp", is_flag=True, help="Build MCP resources") +@click.option("--mkdocs", is_flag=True, help="Build MkDocs site") +@click.option("--module", help="Python module to document") +@click.option("--project-name", help="Project name override") +# MkDocs specific +@click.option("--site-name", help="MkDocs site name") +@click.option("--docs-dir", type=click.Path(path_type=Path), default=Path("docs"), help="Directory for MD sources") +@click.option("--nav", "nav_file", type=click.Path(path_type=Path), default=Path("docforge.nav.yml"), help="Nav spec path") +@click.option("--template", type=click.Path(path_type=Path), help="MkDocs template path") +@click.option("--mkdocs-yml", type=click.Path(path_type=Path), default=Path("mkdocs.yml"), help="Output config path") +# MCP specific +@click.option("--out-dir", type=click.Path(path_type=Path), default=Path("mcp_docs"), help="MCP output directory") +def build( + mcp: bool, + mkdocs: 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, +) -> None: + """ + Build documentation (MkDocs site or MCP resources). + """ + if not mcp and not mkdocs: + raise click.UsageError("Must specify either --mcp or --mkdocs") + + if mkdocs: + if not module: + raise click.UsageError("--module is required for MkDocs build") + if not site_name: + site_name = module + + click.echo(f"Generating MkDocs sources in {docs_dir}...") + mkdocs_logic.generate_sources(module, project_name, docs_dir) + + click.echo(f"Generating MkDocs config {mkdocs_yml}...") + mkdocs_logic.generate_config(docs_dir, nav_file, template, mkdocs_yml, site_name) + + click.echo("Running MkDocs build...") + mkdocs_logic.build(mkdocs_yml) + click.echo("MkDocs build completed.") + + if mcp: + if not module: + raise click.UsageError("--module is required for MCP build") + + click.echo(f"Generating MCP resources in {out_dir}...") + mcp_logic.generate_resources(module, project_name, out_dir) + click.echo("MCP build completed.") + +@cli.command() +@click.option("--mcp", is_flag=True, help="Serve MCP documentation") +@click.option("--mkdocs", is_flag=True, help="Serve MkDocs site") +@click.option("--mkdocs-yml", type=click.Path(path_type=Path), default=Path("mkdocs.yml"), help="MkDocs config path") +@click.option("--out-dir", type=click.Path(path_type=Path), default=Path("mcp_docs"), help="MCP root directory") +def serve( + mcp: bool, + mkdocs: bool, + mkdocs_yml: Path, + out_dir: Path, +) -> None: + """ + Serve documentation. + """ + if mcp and mkdocs: + raise click.UsageError("Cannot specify both --mcp and --mkdocs") + if not mcp and not mkdocs: + raise click.UsageError("Must specify either --mcp or --mkdocs") + + if mkdocs: + mkdocs_logic.serve(mkdocs_yml) + elif mcp: + mcp_logic.serve(out_dir) + +@cli.command() +@click.option( + "--modules", + multiple=True, + required=True, + help="Python module import paths to introspect", +) +@click.option( + "--project-name", + help="Project name (defaults to first module)", +) +def tree( + modules: Sequence[str], + project_name: Optional[str], +) -> None: + """ + Visualize the project structure. + """ + loader = GriffeLoader() + project = loader.load_project(list(modules), project_name) + + click.echo(project.name) + + for module in project.get_all_modules(): + click.echo(f"├── {module.path}") + for obj in module.get_all_objects(): + _print_object(obj, indent="│ ") + +def _print_object(obj, indent: str) -> None: + """ + Recursive helper to print doc objects and their members to the console. + """ + click.echo(f"{indent}├── {obj.name}") + for member in obj.get_all_members(): + _print_object(member, indent + "│ ") diff --git a/docforge/cli/main.py b/docforge/cli/main.py index 09bf0a4..b6f7d78 100644 --- a/docforge/cli/main.py +++ b/docforge/cli/main.py @@ -1,268 +1,7 @@ """ -Main entry point for the doc-forge CLI. This module defines the core command -group and the 'tree', 'generate', 'build', and 'serve' commands. +Main entry point for the doc-forge CLI. """ - -from pathlib import Path -from typing import Sequence, Optional - -import click - -from docforge.loaders import GriffeLoader, discover_module_paths -from docforge.renderers import MkDocsRenderer, MCPRenderer -from docforge.cli.mkdocs import mkdocs_cmd - - -@click.group() -def cli() -> None: - """ - doc-forge CLI: A tool for introspecting Python projects and generating - documentation. - """ - pass - - -cli.add_command(mkdocs_cmd) - -# --------------------------------------------------------------------- -# tree -# --------------------------------------------------------------------- - -@cli.command() -@click.option( - "--modules", - multiple=True, - required=True, - help="Python module import paths to introspect", -) -@click.option( - "--project-name", - help="Project name (defaults to first module)", -) -def tree( - modules: Sequence[str], - project_name: Optional[str], -) -> None: - """ - Visualize the project structure including modules and their members. - - Args: - modules: List of module paths to introspect. - project_name: Optional project name override. - """ - loader = GriffeLoader() - project = loader.load_project(list(modules), project_name) - - click.echo(project.name) - - for module in project.get_all_modules(): - click.echo(f"├── {module.path}") - - for obj in module.get_all_objects(): - _print_object(obj, indent="│ ") - - -def _print_object(obj, indent: str) -> None: - """ - Recursive helper to print doc objects and their members to the console. - - Args: - obj: The DocObject to print. - indent: The current line indentation string. - """ - click.echo(f"{indent}├── {obj.name}") - for member in obj.get_all_members(): - _print_object(member, indent + "│ ") - - -# --------------------------------------------------------------------- -# generate -# --------------------------------------------------------------------- - -@cli.command() -@click.option( - "--module", - required=True, - help="Python module import paths to document", -) -@click.option( - "--project-name", - help="Project name (defaults to first module)", -) -@click.option( - "--docs-dir", - type=click.Path(path_type=Path), - default=Path("docs"), -) -def generate( - module: str, - project_name: Optional[str], - docs_dir: Path, -) -> None: - """ - Generate Markdown source files for the specified module. - - Args: - module: The primary module path to document. - project_name: Optional project name override. - docs_dir: Directory where documentation sources will be written. - """ - loader = GriffeLoader() - discovered_paths = discover_module_paths( - module, - ) - project = loader.load_project( - discovered_paths, - project_name - ) - - renderer = MkDocsRenderer() - renderer.generate_sources(project, docs_dir) - - click.echo(f"Documentation sources generated in {docs_dir}") - - -# --------------------------------------------------------------------- -# mcp-build -# --------------------------------------------------------------------- - -@cli.command(name="generate-mcp") -@click.option( - "--module", - required=True, - help="Python module import path to document", -) -@click.option( - "--project-name", - help="Project name (defaults to first module)", -) -@click.option( - "--out-dir", - type=click.Path(path_type=Path), - default=Path("mcp_docs"), -) -def generate_mcp( - module: str, - project_name: str | None, - out_dir: Path, -) -> None: - """ - Generate MCP-compatible documentation resources for the specified module. - - Args: - module: The primary module path to document. - project_name: Optional project name override. - out_dir: Directory where MCP resources will be written. - """ - loader = GriffeLoader() - discovered_paths = discover_module_paths(module) - - project = loader.load_project( - discovered_paths, - project_name, - ) - - renderer = MCPRenderer() - renderer.generate_sources(project, out_dir) - - click.echo(f"MCP documentation resources generated in {out_dir}") - - -# --------------------------------------------------------------------- -# build -# --------------------------------------------------------------------- - -@cli.command() -@click.option( - "--mkdocs-yml", - type=click.Path(path_type=Path), - default=Path("mkdocs.yml"), -) -def build(mkdocs_yml: Path) -> None: - """ - Build the documentation site using MkDocs. - - Args: - mkdocs_yml: Path to the mkdocs.yml configuration file. - """ - if not mkdocs_yml.exists(): - raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}") - - from mkdocs.config import load_config - from mkdocs.commands.build import build as mkdocs_build - - mkdocs_build(load_config(str(mkdocs_yml))) - - click.echo("MkDocs build completed") - - -# --------------------------------------------------------------------- -# serve-mcp -# --------------------------------------------------------------------- - -@cli.command(name="serve-mcp") -def serve_mcp() -> None: - """ - Serve MCP documentation from the local mcp_docs directory. - """ - from docforge.servers import MCPServer - - mcp_root = Path.cwd() / "mcp_docs" - - if not mcp_root.exists(): - raise click.ClickException("mcp_docs directory not found") - - required = [ - mcp_root / "index.json", - mcp_root / "nav.json", - mcp_root / "modules", - ] - - for path in required: - if not path.exists(): - raise click.ClickException(f"Invalid MCP bundle, missing: {path.name}") - - server = MCPServer( - mcp_root=mcp_root, - name="doc-forge-mcp", - ) - - server.run() - - -# --------------------------------------------------------------------- -# serve -# --------------------------------------------------------------------- - -@cli.command() -@click.option( - "--mkdocs-yml", - type=click.Path(path_type=Path), - default=Path("mkdocs.yml"), -) -def serve(mkdocs_yml: Path) -> None: - """ - Serve the documentation site with live-reload using MkDocs. - - Args: - mkdocs_yml: Path to the mkdocs.yml configuration file. - """ - if not mkdocs_yml.exists(): - raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}") - - from mkdocs.commands.serve import serve as mkdocs_serve - - host = "127.0.0.1" - port = 8000 - url = f"http://{host}:{port}/" - - click.echo(f"Serving documentation at {url}") - mkdocs_serve(config_file=str(mkdocs_yml)) - - -# --------------------------------------------------------------------- -# entry point -# --------------------------------------------------------------------- +from docforge.cli.commands import cli def main() -> None: """ @@ -270,6 +9,5 @@ def main() -> None: """ cli() - if __name__ == "__main__": main() diff --git a/docforge/cli/main.pyi b/docforge/cli/main.pyi deleted file mode 100644 index 1acfbf3..0000000 --- a/docforge/cli/main.pyi +++ /dev/null @@ -1,109 +0,0 @@ -from typing import Sequence -from pathlib import Path - -import click - - -@click.group() -def cli() -> None: - """doc-forge command-line interface.""" - - -@cli.command() -@click.option( - "--modules", - multiple=True, - help="Python module import paths to introspect", -) -@click.option( - "--project-name", - help="Project name (defaults to first module)", -) -def tree( - modules: Sequence[str], - project_name: str | None, -) -> None: - """Show introspection tree.""" - - -@cli.command() -@click.option( - "--module", - help="Python module import paths to document", -) -@click.option( - "--project-name", - help="Project name (defaults to first module)", -) -@click.option( - "--docs-dir", - type=click.Path(path_type=Path), - default=Path("docs"), -) -def generate( - module: str, - project_name: str | None, - docs_dir: Path, -) -> None: - """Generate documentation source files using MkDocs renderer.""" - -@cli.command(name="generate-mcp") -@click.option( - "--module", - required=True, - help="Python module import path to document", -) -@click.option( - "--project-name", - help="Project name (defaults to first module)", -) -@click.option( - "--out-dir", - type=click.Path(path_type=Path), - default=Path("mcp_docs"), -) -def generate_mcp( - module: str, - project_name: str | None, - out_dir: Path, -) -> None: - """ - Generate MCP-compatible documentation resources for the specified module. - - Args: - module: The primary module path to document. - project_name: Optional project name override. - out_dir: Directory where MCP resources will be written. - """ - -@cli.command() -@click.option( - "--mkdocs-yml", - type=click.Path(path_type=Path), - default=Path("mkdocs.yml"), -) -def build( - mkdocs_yml: Path, -) -> None: - """Build documentation using MkDocs.""" - - -@cli.command() -@click.option( - "--mkdocs-yml", - type=click.Path(path_type=Path), - default=Path("mkdocs.yml"), -) -def serve( - mkdocs_yml: Path, -) -> None: - """Serve documentation using MkDocs.""" - - -@cli.command(name="serve-mcp") -def serve_mcp() -> None: - """Serve MCP documentation.""" - - -def main() -> None: - """CLI entry point.""" diff --git a/docforge/cli/mcp/__init__.py b/docforge/cli/mcp/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/docforge/cli/mcp/logic.py b/docforge/cli/mcp/logic.py new file mode 100644 index 0000000..09c2477 --- /dev/null +++ b/docforge/cli/mcp/logic.py @@ -0,0 +1,39 @@ +from pathlib import Path +import click +from docforge.loaders import GriffeLoader, discover_module_paths +from docforge.renderers import MCPRenderer +from docforge.servers import MCPServer + +def generate_resources(module: str, project_name: str | None, out_dir: Path) -> None: + """ + Generate MCP-compatible documentation resources. + """ + loader = GriffeLoader() + discovered_paths = discover_module_paths(module) + project = loader.load_project(discovered_paths, project_name) + + renderer = MCPRenderer() + renderer.generate_sources(project, out_dir) + +def serve(mcp_root: Path) -> None: + """ + Serve MCP documentation. + """ + if not mcp_root.exists(): + raise click.ClickException(f"mcp_docs directory not found: {mcp_root}") + + required = [ + mcp_root / "index.json", + mcp_root / "nav.json", + mcp_root / "modules", + ] + + for path in required: + if not path.exists(): + raise click.ClickException(f"Invalid MCP bundle, missing: {path.name}") + + server = MCPServer( + mcp_root=mcp_root, + name="doc-forge-mcp", + ) + server.run() diff --git a/docforge/cli/mkdocs.py b/docforge/cli/mkdocs.py deleted file mode 100644 index df9210f..0000000 --- a/docforge/cli/mkdocs.py +++ /dev/null @@ -1,116 +0,0 @@ -""" -This module contains the 'mkdocs' CLI command, which orchestrates the generation -of the main mkdocs.yml configuration file. -""" - -from pathlib import Path -from importlib import resources - -import click -import yaml - -from docforge.nav import load_nav_spec -from docforge.nav import resolve_nav -from docforge.nav import MkDocsNavEmitter - - -def _load_template(template: Path | None) -> dict: - """ - Load a YAML template for mkdocs.yml. If no template is provided, - loads the built-in sample template. - - Args: - template: Path to the template file, or None. - - Returns: - The loaded template data as a dictionary. - """ - if template is not None: - if not template.exists(): - raise click.FileError(str(template), hint="Template not found") - return yaml.safe_load(template.read_text(encoding="utf-8")) - - # Load built-in default - text = ( - resources.files("docforge.templates") - .joinpath("mkdocs.sample.yml") - .read_text(encoding="utf-8") - ) - return yaml.safe_load(text) - - -@click.command("mkdocs") -@click.option( - "--site-name", - required=True, - help="MkDocs site_name (required)", -) -@click.option( - "--docs-dir", - type=click.Path(path_type=Path), - default=Path("docs"), -) -@click.option( - "--nav", - "nav_file", - type=click.Path(path_type=Path), - default=Path("docforge.nav.yml"), -) -@click.option( - "--template", - type=click.Path(path_type=Path), - default=None, - help="Override the built-in mkdocs template", -) -@click.option( - "--out", - type=click.Path(path_type=Path), - default=Path("mkdocs.yml"), -) -def mkdocs_cmd( - docs_dir: Path, - nav_file: Path, - template: Path | None, - out: Path, - site_name: str, -) -> None: - """ - Generate an mkdocs.yml configuration file by combining a template with - the navigation structure resolved from a docforge.nav.yml file. - - Args: - docs_dir: Path to the directory containing documentation Markdown files. - nav_file: Path to the docforge.nav.yml specification. - template: Optional path to an mkdocs.yml template. - out: Path where the final mkdocs.yml will be written. - site_name: The name of the documentation site. - """ - - if not nav_file.exists(): - raise click.FileError(str(nav_file), hint="Nav spec not found") - - # Load nav spec - spec = load_nav_spec(nav_file) - - # Resolve nav - resolved = resolve_nav(spec, docs_dir) - - # Emit mkdocs nav - nav_block = MkDocsNavEmitter().emit(resolved) - - # Load template (user or built-in) - data = _load_template(template) - - # Inject site_name - data["site_name"] = site_name - - # Inject nav - data["nav"] = nav_block - - # Write output - out.write_text( - yaml.safe_dump(data, sort_keys=False), - encoding="utf-8", - ) - - click.echo(f"mkdocs.yml written to {out}") diff --git a/docforge/cli/mkdocs.pyi b/docforge/cli/mkdocs.pyi deleted file mode 100644 index 3121f5d..0000000 --- a/docforge/cli/mkdocs.pyi +++ /dev/null @@ -1,45 +0,0 @@ -from pathlib import Path -from typing import Any, Dict, Optional - -import click - - -def _load_template(template: Optional[Path]) -> Dict[str, Any]: - ... - - -@click.command("mkdocs") -@click.option( - "--site-name", - required=True, - help="MkDocs site_name (required)", -) -@click.option( - "--docs-dir", - type=click.Path(path_type=Path), - default=Path("docs"), -) -@click.option( - "--nav", - "nav_file", - type=click.Path(path_type=Path), - default=Path("docforge.nav.yml"), -) -@click.option( - "--template", - type=click.Path(path_type=Path), - default=None, -) -@click.option( - "--out", - type=click.Path(path_type=Path), - default=Path("mkdocs.yml"), -) -def mkdocs_cmd( - docs_dir: Path, - nav_file: Path, - template: Optional[Path], - out: Path, - site_name: str, -) -> None: - ... diff --git a/docforge/cli/mkdocs/__init__.py b/docforge/cli/mkdocs/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/docforge/cli/mkdocs/logic.py b/docforge/cli/mkdocs/logic.py new file mode 100644 index 0000000..2fcc636 --- /dev/null +++ b/docforge/cli/mkdocs/logic.py @@ -0,0 +1,69 @@ +from pathlib import Path +from importlib import resources +import click +import yaml +from docforge.loaders import GriffeLoader, discover_module_paths +from docforge.renderers import MkDocsRenderer +from docforge.nav import load_nav_spec, resolve_nav, MkDocsNavEmitter + +def generate_sources(module: str, project_name: str | None, docs_dir: Path) -> None: + """ + Generate Markdown source files for the specified module. + """ + loader = GriffeLoader() + discovered_paths = discover_module_paths(module) + project = loader.load_project(discovered_paths, project_name) + + renderer = MkDocsRenderer() + renderer.generate_sources(project, docs_dir) + +def generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None: + """ + Generate an mkdocs.yml configuration file. + """ + if not nav_file.exists(): + raise click.FileError(str(nav_file), hint="Nav spec not found") + + spec = load_nav_spec(nav_file) + resolved = resolve_nav(spec, docs_dir) + nav_block = MkDocsNavEmitter().emit(resolved) + + # Load template + if template is not None: + if not template.exists(): + raise click.FileError(str(template), hint="Template not found") + data = yaml.safe_load(template.read_text(encoding="utf-8")) + else: + text = ( + resources.files("docforge.templates") + .joinpath("mkdocs.sample.yml") + .read_text(encoding="utf-8") + ) + data = yaml.safe_load(text) + + data["site_name"] = site_name + data["nav"] = nav_block + + out.write_text(yaml.safe_dump(data, sort_keys=False), encoding="utf-8") + +def build(mkdocs_yml: Path) -> None: + """ + Build the documentation site using MkDocs. + """ + if not mkdocs_yml.exists(): + raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}") + + from mkdocs.config import load_config + from mkdocs.commands.build import build as mkdocs_build + + mkdocs_build(load_config(str(mkdocs_yml))) + +def serve(mkdocs_yml: Path) -> None: + """ + Serve the documentation site with live-reload using MkDocs. + """ + if not mkdocs_yml.exists(): + raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}") + + from mkdocs.commands.serve import serve as mkdocs_serve + mkdocs_serve(config_file=str(mkdocs_yml)) diff --git a/docs/docforge/cli/commands.md b/docs/docforge/cli/commands.md new file mode 100644 index 0000000..75f0d75 --- /dev/null +++ b/docs/docforge/cli/commands.md @@ -0,0 +1,3 @@ +# Commands + +::: docforge.cli.commands diff --git a/docs/docforge/cli/mcp/index.md b/docs/docforge/cli/mcp/index.md new file mode 100644 index 0000000..52ffe01 --- /dev/null +++ b/docs/docforge/cli/mcp/index.md @@ -0,0 +1,3 @@ +# Mcp + +::: docforge.cli.mcp diff --git a/docs/docforge/cli/mcp/logic.md b/docs/docforge/cli/mcp/logic.md new file mode 100644 index 0000000..92d9364 --- /dev/null +++ b/docs/docforge/cli/mcp/logic.md @@ -0,0 +1,3 @@ +# Logic + +::: docforge.cli.mcp.logic diff --git a/docs/docforge/cli/mkdocs.md b/docs/docforge/cli/mkdocs/index.md similarity index 100% rename from docs/docforge/cli/mkdocs.md rename to docs/docforge/cli/mkdocs/index.md diff --git a/docs/docforge/cli/mkdocs/logic.md b/docs/docforge/cli/mkdocs/logic.md new file mode 100644 index 0000000..94909a7 --- /dev/null +++ b/docs/docforge/cli/mkdocs/logic.md @@ -0,0 +1,3 @@ +# Logic + +::: docforge.cli.mkdocs.logic diff --git a/docs/docforge/servers/index.md b/docs/docforge/servers/index.md new file mode 100644 index 0000000..6297158 --- /dev/null +++ b/docs/docforge/servers/index.md @@ -0,0 +1,3 @@ +# Servers + +::: docforge.servers diff --git a/docs/docforge/servers/mcp_server.md b/docs/docforge/servers/mcp_server.md new file mode 100644 index 0000000..0f20e6b --- /dev/null +++ b/docs/docforge/servers/mcp_server.md @@ -0,0 +1,3 @@ +# Mcp Server + +::: docforge.servers.mcp_server diff --git a/mcp_docs/index.json b/mcp_docs/index.json index 259744b..6ce9145 100644 --- a/mcp_docs/index.json +++ b/mcp_docs/index.json @@ -1,6 +1,6 @@ { "project": "docforge", "type": "docforge-model", - "modules_count": 20, + "modules_count": 24, "source": "docforge" } \ No newline at end of file diff --git a/mcp_docs/modules/docforge.cli.commands.json b/mcp_docs/modules/docforge.cli.commands.json new file mode 100644 index 0000000..701f8ad --- /dev/null +++ b/mcp_docs/modules/docforge.cli.commands.json @@ -0,0 +1,356 @@ +{ + "module": "docforge.cli.commands", + "content": { + "path": "docforge.cli.commands", + "docstring": null, + "objects": { + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.commands.click", + "signature": "", + "docstring": null + }, + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.commands.Path", + "signature": "", + "docstring": null + }, + "Sequence": { + "name": "Sequence", + "kind": "alias", + "path": "docforge.cli.commands.Sequence", + "signature": "", + "docstring": null + }, + "Optional": { + "name": "Optional", + "kind": "alias", + "path": "docforge.cli.commands.Optional", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.commands.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.commands.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.commands.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "mkdocs_logic": { + "name": "mkdocs_logic", + "kind": "module", + "path": "docforge.cli.commands.mkdocs_logic", + "signature": "", + "docstring": null, + "members": { + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.commands.mkdocs_logic.Path", + "signature": "", + "docstring": null + }, + "resources": { + "name": "resources", + "kind": "alias", + "path": "docforge.cli.commands.mkdocs_logic.resources", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.commands.mkdocs_logic.click", + "signature": "", + "docstring": null + }, + "yaml": { + "name": "yaml", + "kind": "alias", + "path": "docforge.cli.commands.mkdocs_logic.yaml", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MkDocsRenderer": { + "name": "MkDocsRenderer", + "kind": "class", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer", + "signature": "", + "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.generate_sources", + "signature": "", + "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." + } + } + }, + "load_nav_spec": { + "name": "load_nav_spec", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.load_nav_spec", + "signature": "", + "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." + }, + "resolve_nav": { + "name": "resolve_nav", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.resolve_nav", + "signature": "", + "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." + }, + "MkDocsNavEmitter": { + "name": "MkDocsNavEmitter", + "kind": "class", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter", + "signature": "", + "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", + "members": { + "emit": { + "name": "emit", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter.emit", + "signature": "", + "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." + } + } + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.generate_sources", + "signature": "", + "docstring": "Generate Markdown source files for the specified module." + }, + "generate_config": { + "name": "generate_config", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.generate_config", + "signature": "", + "docstring": "Generate an mkdocs.yml configuration file." + }, + "build": { + "name": "build", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.build", + "signature": "", + "docstring": "Build the documentation site using MkDocs." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.serve", + "signature": "", + "docstring": "Serve the documentation site with live-reload using MkDocs." + } + } + }, + "mcp_logic": { + "name": "mcp_logic", + "kind": "module", + "path": "docforge.cli.commands.mcp_logic", + "signature": "", + "docstring": null, + "members": { + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.commands.mcp_logic.Path", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.commands.mcp_logic.click", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.commands.mcp_logic.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MCPRenderer": { + "name": "MCPRenderer", + "kind": "class", + "path": "docforge.cli.commands.mcp_logic.MCPRenderer", + "signature": "", + "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.commands.mcp_logic.MCPRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.MCPRenderer.generate_sources", + "signature": "", + "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + } + } + }, + "MCPServer": { + "name": "MCPServer", + "kind": "class", + "path": "docforge.cli.commands.mcp_logic.MCPServer", + "signature": "", + "docstring": "MCP server for serving a pre-built MCP documentation bundle.", + "members": { + "mcp_root": { + "name": "mcp_root", + "kind": "attribute", + "path": "docforge.cli.commands.mcp_logic.MCPServer.mcp_root", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "docforge.cli.commands.mcp_logic.MCPServer.app", + "signature": "", + "docstring": null + }, + "run": { + "name": "run", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.MCPServer.run", + "signature": "", + "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" + } + } + }, + "generate_resources": { + "name": "generate_resources", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.generate_resources", + "signature": "", + "docstring": "Generate MCP-compatible documentation resources." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.serve", + "signature": "", + "docstring": "Serve MCP documentation." + } + } + }, + "cli": { + "name": "cli", + "kind": "function", + "path": "docforge.cli.commands.cli", + "signature": "", + "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." + }, + "build": { + "name": "build", + "kind": "function", + "path": "docforge.cli.commands.build", + "signature": "", + "docstring": "Build documentation (MkDocs site or MCP resources)." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.commands.serve", + "signature": "", + "docstring": "Serve documentation." + }, + "tree": { + "name": "tree", + "kind": "function", + "path": "docforge.cli.commands.tree", + "signature": "", + "docstring": "Visualize the project structure." + } + } + } +} \ No newline at end of file diff --git a/mcp_docs/modules/docforge.cli.json b/mcp_docs/modules/docforge.cli.json index bb68c75..f51e344 100644 --- a/mcp_docs/modules/docforge.cli.json +++ b/mcp_docs/modules/docforge.cli.json @@ -9,174 +9,506 @@ "kind": "module", "path": "docforge.cli.main", "signature": null, - "docstring": "Main entry point for the doc-forge CLI. This module defines the core command\ngroup and the 'tree', 'generate', 'build', and 'serve' commands.", + "docstring": "Main entry point for the doc-forge CLI.", "members": { + "cli": { + "name": "cli", + "kind": "function", + "path": "docforge.cli.main.cli", + "signature": "", + "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." + }, + "main": { + "name": "main", + "kind": "function", + "path": "docforge.cli.main.main", + "signature": "", + "docstring": "CLI Entry point. Boots the click application." + } + } + }, + "commands": { + "name": "commands", + "kind": "module", + "path": "docforge.cli.commands", + "signature": null, + "docstring": null, + "members": { + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.commands.click", + "signature": "", + "docstring": null + }, "Path": { "name": "Path", "kind": "alias", - "path": "docforge.cli.main.Path", + "path": "docforge.cli.commands.Path", "signature": "", "docstring": null }, "Sequence": { "name": "Sequence", "kind": "alias", - "path": "docforge.cli.main.Sequence", + "path": "docforge.cli.commands.Sequence", "signature": "", "docstring": null }, "Optional": { "name": "Optional", "kind": "alias", - "path": "docforge.cli.main.Optional", + "path": "docforge.cli.commands.Optional", "signature": "", "docstring": null }, - "click": { - "name": "click", - "kind": "alias", - "path": "docforge.cli.main.click", - "signature": "", - "docstring": null - }, "GriffeLoader": { "name": "GriffeLoader", "kind": "class", - "path": "docforge.cli.main.GriffeLoader", + "path": "docforge.cli.commands.GriffeLoader", "signature": "", "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", "members": { "load_project": { "name": "load_project", "kind": "function", - "path": "docforge.cli.main.GriffeLoader.load_project", + "path": "docforge.cli.commands.GriffeLoader.load_project", "signature": "", "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." }, "load_module": { "name": "load_module", "kind": "function", - "path": "docforge.cli.main.GriffeLoader.load_module", + "path": "docforge.cli.commands.GriffeLoader.load_module", "signature": "", "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." } } }, - "discover_module_paths": { - "name": "discover_module_paths", - "kind": "function", - "path": "docforge.cli.main.discover_module_paths", - "signature": "", - "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." - }, - "MkDocsRenderer": { - "name": "MkDocsRenderer", - "kind": "class", - "path": "docforge.cli.main.MkDocsRenderer", - "signature": "", - "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", + "mkdocs_logic": { + "name": "mkdocs_logic", + "kind": "module", + "path": "docforge.cli.commands.mkdocs_logic", + "signature": "", + "docstring": null, "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "docforge.cli.main.MkDocsRenderer.name", - "signature": "", + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.commands.mkdocs_logic.Path", + "signature": "", "docstring": null }, + "resources": { + "name": "resources", + "kind": "alias", + "path": "docforge.cli.commands.mkdocs_logic.resources", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.commands.mkdocs_logic.click", + "signature": "", + "docstring": null + }, + "yaml": { + "name": "yaml", + "kind": "alias", + "path": "docforge.cli.commands.mkdocs_logic.yaml", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MkDocsRenderer": { + "name": "MkDocsRenderer", + "kind": "class", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer", + "signature": "", + "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.generate_sources", + "signature": "", + "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." + } + } + }, + "load_nav_spec": { + "name": "load_nav_spec", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.load_nav_spec", + "signature": "", + "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." + }, + "resolve_nav": { + "name": "resolve_nav", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.resolve_nav", + "signature": "", + "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." + }, + "MkDocsNavEmitter": { + "name": "MkDocsNavEmitter", + "kind": "class", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter", + "signature": "", + "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", + "members": { + "emit": { + "name": "emit", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter.emit", + "signature": "", + "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." + } + } + }, "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.main.MkDocsRenderer.generate_sources", - "signature": "", - "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." + "path": "docforge.cli.commands.mkdocs_logic.generate_sources", + "signature": "", + "docstring": "Generate Markdown source files for the specified module." + }, + "generate_config": { + "name": "generate_config", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.generate_config", + "signature": "", + "docstring": "Generate an mkdocs.yml configuration file." + }, + "build": { + "name": "build", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.build", + "signature": "", + "docstring": "Build the documentation site using MkDocs." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.serve", + "signature": "", + "docstring": "Serve the documentation site with live-reload using MkDocs." } } }, - "MCPRenderer": { - "name": "MCPRenderer", - "kind": "class", - "path": "docforge.cli.main.MCPRenderer", - "signature": "", - "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", + "mcp_logic": { + "name": "mcp_logic", + "kind": "module", + "path": "docforge.cli.commands.mcp_logic", + "signature": "", + "docstring": null, "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "docforge.cli.main.MCPRenderer.name", - "signature": "", + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.commands.mcp_logic.Path", + "signature": "", "docstring": null }, - "generate_sources": { - "name": "generate_sources", + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.commands.mcp_logic.click", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.commands.mcp_logic.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", "kind": "function", - "path": "docforge.cli.main.MCPRenderer.generate_sources", - "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + "path": "docforge.cli.commands.mcp_logic.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MCPRenderer": { + "name": "MCPRenderer", + "kind": "class", + "path": "docforge.cli.commands.mcp_logic.MCPRenderer", + "signature": "", + "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.commands.mcp_logic.MCPRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.MCPRenderer.generate_sources", + "signature": "", + "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + } + } + }, + "MCPServer": { + "name": "MCPServer", + "kind": "class", + "path": "docforge.cli.commands.mcp_logic.MCPServer", + "signature": "", + "docstring": "MCP server for serving a pre-built MCP documentation bundle.", + "members": { + "mcp_root": { + "name": "mcp_root", + "kind": "attribute", + "path": "docforge.cli.commands.mcp_logic.MCPServer.mcp_root", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "docforge.cli.commands.mcp_logic.MCPServer.app", + "signature": "", + "docstring": null + }, + "run": { + "name": "run", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.MCPServer.run", + "signature": "", + "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" + } + } + }, + "generate_resources": { + "name": "generate_resources", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.generate_resources", + "signature": "", + "docstring": "Generate MCP-compatible documentation resources." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.serve", + "signature": "", + "docstring": "Serve MCP documentation." } } }, - "mkdocs_cmd": { - "name": "mkdocs_cmd", - "kind": "function", - "path": "docforge.cli.main.mkdocs_cmd", - "signature": "", - "docstring": "Generate an mkdocs.yml configuration file by combining a template with\nthe navigation structure resolved from a docforge.nav.yml file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template.\n out: Path where the final mkdocs.yml will be written.\n site_name: The name of the documentation site." - }, "cli": { "name": "cli", "kind": "function", - "path": "docforge.cli.main.cli", - "signature": "", + "path": "docforge.cli.commands.cli", + "signature": "", "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." }, - "tree": { - "name": "tree", - "kind": "function", - "path": "docforge.cli.main.tree", - "signature": "", - "docstring": "Visualize the project structure including modules and their members.\n\nArgs:\n modules: List of module paths to introspect.\n project_name: Optional project name override." - }, - "generate": { - "name": "generate", - "kind": "function", - "path": "docforge.cli.main.generate", - "signature": "", - "docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The primary module path to document.\n project_name: Optional project name override.\n docs_dir: Directory where documentation sources will be written." - }, - "generate_mcp": { - "name": "generate_mcp", - "kind": "function", - "path": "docforge.cli.main.generate_mcp", - "signature": "", - "docstring": "Generate MCP-compatible documentation resources for the specified module.\n\nArgs:\n module: The primary module path to document.\n project_name: Optional project name override.\n out_dir: Directory where MCP resources will be written." - }, "build": { "name": "build", "kind": "function", - "path": "docforge.cli.main.build", - "signature": "", - "docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." - }, - "serve_mcp": { - "name": "serve_mcp", - "kind": "function", - "path": "docforge.cli.main.serve_mcp", - "signature": "", - "docstring": "Serve MCP documentation from the local mcp_docs directory." + "path": "docforge.cli.commands.build", + "signature": "", + "docstring": "Build documentation (MkDocs site or MCP resources)." }, "serve": { "name": "serve", "kind": "function", - "path": "docforge.cli.main.serve", - "signature": "", - "docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." + "path": "docforge.cli.commands.serve", + "signature": "", + "docstring": "Serve documentation." }, - "main": { - "name": "main", + "tree": { + "name": "tree", "kind": "function", - "path": "docforge.cli.main.main", - "signature": "", - "docstring": "CLI Entry point. Boots the click application." + "path": "docforge.cli.commands.tree", + "signature": "", + "docstring": "Visualize the project structure." + } + } + }, + "mcp": { + "name": "mcp", + "kind": "module", + "path": "docforge.cli.mcp", + "signature": null, + "docstring": null, + "members": { + "logic": { + "name": "logic", + "kind": "module", + "path": "docforge.cli.mcp.logic", + "signature": null, + "docstring": null, + "members": { + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.mcp.logic.Path", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.mcp.logic.click", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.mcp.logic.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.mcp.logic.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.mcp.logic.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", + "kind": "function", + "path": "docforge.cli.mcp.logic.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MCPRenderer": { + "name": "MCPRenderer", + "kind": "class", + "path": "docforge.cli.mcp.logic.MCPRenderer", + "signature": "", + "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.mcp.logic.MCPRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mcp.logic.MCPRenderer.generate_sources", + "signature": "", + "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + } + } + }, + "MCPServer": { + "name": "MCPServer", + "kind": "class", + "path": "docforge.cli.mcp.logic.MCPServer", + "signature": "", + "docstring": "MCP server for serving a pre-built MCP documentation bundle.", + "members": { + "mcp_root": { + "name": "mcp_root", + "kind": "attribute", + "path": "docforge.cli.mcp.logic.MCPServer.mcp_root", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "docforge.cli.mcp.logic.MCPServer.app", + "signature": "", + "docstring": null + }, + "run": { + "name": "run", + "kind": "function", + "path": "docforge.cli.mcp.logic.MCPServer.run", + "signature": "", + "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" + } + } + }, + "generate_resources": { + "name": "generate_resources", + "kind": "function", + "path": "docforge.cli.mcp.logic.generate_resources", + "signature": "", + "docstring": "Generate MCP-compatible documentation resources." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.mcp.logic.serve", + "signature": "", + "docstring": "Serve MCP documentation." + } + } } } }, @@ -185,93 +517,155 @@ "kind": "module", "path": "docforge.cli.mkdocs", "signature": null, - "docstring": "This module contains the 'mkdocs' CLI command, which orchestrates the generation\nof the main mkdocs.yml configuration file.", + "docstring": null, "members": { - "Path": { - "name": "Path", - "kind": "alias", - "path": "docforge.cli.mkdocs.Path", - "signature": "", - "docstring": null - }, - "resources": { - "name": "resources", - "kind": "alias", - "path": "docforge.cli.mkdocs.resources", - "signature": "", - "docstring": null - }, - "click": { - "name": "click", - "kind": "alias", - "path": "docforge.cli.mkdocs.click", - "signature": "", - "docstring": null - }, - "yaml": { - "name": "yaml", - "kind": "alias", - "path": "docforge.cli.mkdocs.yaml", - "signature": "", - "docstring": null - }, - "load_nav_spec": { - "name": "load_nav_spec", - "kind": "function", - "path": "docforge.cli.mkdocs.load_nav_spec", - "signature": "", - "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." - }, - "resolve_nav": { - "name": "resolve_nav", - "kind": "function", - "path": "docforge.cli.mkdocs.resolve_nav", - "signature": "", - "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." - }, - "MkDocsNavEmitter": { - "name": "MkDocsNavEmitter", - "kind": "class", - "path": "docforge.cli.mkdocs.MkDocsNavEmitter", - "signature": "", - "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", + "logic": { + "name": "logic", + "kind": "module", + "path": "docforge.cli.mkdocs.logic", + "signature": null, + "docstring": null, "members": { - "emit": { - "name": "emit", + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.Path", + "signature": "", + "docstring": null + }, + "resources": { + "name": "resources", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.resources", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.click", + "signature": "", + "docstring": null + }, + "yaml": { + "name": "yaml", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.yaml", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.mkdocs.logic.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", "kind": "function", - "path": "docforge.cli.mkdocs.MkDocsNavEmitter.emit", - "signature": "", - "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." + "path": "docforge.cli.mkdocs.logic.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MkDocsRenderer": { + "name": "MkDocsRenderer", + "kind": "class", + "path": "docforge.cli.mkdocs.logic.MkDocsRenderer", + "signature": "", + "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.generate_sources", + "signature": "", + "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." + } + } + }, + "load_nav_spec": { + "name": "load_nav_spec", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.load_nav_spec", + "signature": "", + "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." + }, + "resolve_nav": { + "name": "resolve_nav", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.resolve_nav", + "signature": "", + "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." + }, + "MkDocsNavEmitter": { + "name": "MkDocsNavEmitter", + "kind": "class", + "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter", + "signature": "", + "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", + "members": { + "emit": { + "name": "emit", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter.emit", + "signature": "", + "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." + } + } + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.generate_sources", + "signature": "", + "docstring": "Generate Markdown source files for the specified module." + }, + "generate_config": { + "name": "generate_config", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.generate_config", + "signature": "", + "docstring": "Generate an mkdocs.yml configuration file." + }, + "build": { + "name": "build", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.build", + "signature": "", + "docstring": "Build the documentation site using MkDocs." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.serve", + "signature": "", + "docstring": "Serve the documentation site with live-reload using MkDocs." } } - }, - "mkdocs_cmd": { - "name": "mkdocs_cmd", - "kind": "function", - "path": "docforge.cli.mkdocs.mkdocs_cmd", - "signature": "", - "docstring": "Generate an mkdocs.yml configuration file by combining a template with\nthe navigation structure resolved from a docforge.nav.yml file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template.\n out: Path where the final mkdocs.yml will be written.\n site_name: The name of the documentation site." - }, - "Any": { - "name": "Any", - "kind": "alias", - "path": "docforge.cli.mkdocs.Any", - "signature": "", - "docstring": null - }, - "Dict": { - "name": "Dict", - "kind": "alias", - "path": "docforge.cli.mkdocs.Dict", - "signature": "", - "docstring": null - }, - "Optional": { - "name": "Optional", - "kind": "alias", - "path": "docforge.cli.mkdocs.Optional", - "signature": "", - "docstring": null } } } diff --git a/mcp_docs/modules/docforge.cli.main.json b/mcp_docs/modules/docforge.cli.main.json index 16965a2..3536e12 100644 --- a/mcp_docs/modules/docforge.cli.main.json +++ b/mcp_docs/modules/docforge.cli.main.json @@ -2,173 +2,20 @@ "module": "docforge.cli.main", "content": { "path": "docforge.cli.main", - "docstring": "Main entry point for the doc-forge CLI. This module defines the core command\ngroup and the 'tree', 'generate', 'build', and 'serve' commands.", + "docstring": "Main entry point for the doc-forge CLI.", "objects": { - "Path": { - "name": "Path", - "kind": "alias", - "path": "docforge.cli.main.Path", - "signature": "", - "docstring": null - }, - "Sequence": { - "name": "Sequence", - "kind": "alias", - "path": "docforge.cli.main.Sequence", - "signature": "", - "docstring": null - }, - "Optional": { - "name": "Optional", - "kind": "alias", - "path": "docforge.cli.main.Optional", - "signature": "", - "docstring": null - }, - "click": { - "name": "click", - "kind": "alias", - "path": "docforge.cli.main.click", - "signature": "", - "docstring": null - }, - "GriffeLoader": { - "name": "GriffeLoader", - "kind": "class", - "path": "docforge.cli.main.GriffeLoader", - "signature": "", - "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", - "members": { - "load_project": { - "name": "load_project", - "kind": "function", - "path": "docforge.cli.main.GriffeLoader.load_project", - "signature": "", - "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." - }, - "load_module": { - "name": "load_module", - "kind": "function", - "path": "docforge.cli.main.GriffeLoader.load_module", - "signature": "", - "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." - } - } - }, - "discover_module_paths": { - "name": "discover_module_paths", - "kind": "function", - "path": "docforge.cli.main.discover_module_paths", - "signature": "", - "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." - }, - "MkDocsRenderer": { - "name": "MkDocsRenderer", - "kind": "class", - "path": "docforge.cli.main.MkDocsRenderer", - "signature": "", - "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", - "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "docforge.cli.main.MkDocsRenderer.name", - "signature": "", - "docstring": null - }, - "generate_sources": { - "name": "generate_sources", - "kind": "function", - "path": "docforge.cli.main.MkDocsRenderer.generate_sources", - "signature": "", - "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." - } - } - }, - "MCPRenderer": { - "name": "MCPRenderer", - "kind": "class", - "path": "docforge.cli.main.MCPRenderer", - "signature": "", - "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", - "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "docforge.cli.main.MCPRenderer.name", - "signature": "", - "docstring": null - }, - "generate_sources": { - "name": "generate_sources", - "kind": "function", - "path": "docforge.cli.main.MCPRenderer.generate_sources", - "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." - } - } - }, - "mkdocs_cmd": { - "name": "mkdocs_cmd", - "kind": "function", - "path": "docforge.cli.main.mkdocs_cmd", - "signature": "", - "docstring": "Generate an mkdocs.yml configuration file by combining a template with\nthe navigation structure resolved from a docforge.nav.yml file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template.\n out: Path where the final mkdocs.yml will be written.\n site_name: The name of the documentation site." - }, "cli": { "name": "cli", "kind": "function", "path": "docforge.cli.main.cli", - "signature": "", + "signature": "", "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." }, - "tree": { - "name": "tree", - "kind": "function", - "path": "docforge.cli.main.tree", - "signature": "", - "docstring": "Visualize the project structure including modules and their members.\n\nArgs:\n modules: List of module paths to introspect.\n project_name: Optional project name override." - }, - "generate": { - "name": "generate", - "kind": "function", - "path": "docforge.cli.main.generate", - "signature": "", - "docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The primary module path to document.\n project_name: Optional project name override.\n docs_dir: Directory where documentation sources will be written." - }, - "generate_mcp": { - "name": "generate_mcp", - "kind": "function", - "path": "docforge.cli.main.generate_mcp", - "signature": "", - "docstring": "Generate MCP-compatible documentation resources for the specified module.\n\nArgs:\n module: The primary module path to document.\n project_name: Optional project name override.\n out_dir: Directory where MCP resources will be written." - }, - "build": { - "name": "build", - "kind": "function", - "path": "docforge.cli.main.build", - "signature": "", - "docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." - }, - "serve_mcp": { - "name": "serve_mcp", - "kind": "function", - "path": "docforge.cli.main.serve_mcp", - "signature": "", - "docstring": "Serve MCP documentation from the local mcp_docs directory." - }, - "serve": { - "name": "serve", - "kind": "function", - "path": "docforge.cli.main.serve", - "signature": "", - "docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." - }, "main": { "name": "main", "kind": "function", "path": "docforge.cli.main.main", - "signature": "", + "signature": "", "docstring": "CLI Entry point. Boots the click application." } } diff --git a/mcp_docs/modules/docforge.cli.mcp.json b/mcp_docs/modules/docforge.cli.mcp.json new file mode 100644 index 0000000..abc1b8e --- /dev/null +++ b/mcp_docs/modules/docforge.cli.mcp.json @@ -0,0 +1,129 @@ +{ + "module": "docforge.cli.mcp", + "content": { + "path": "docforge.cli.mcp", + "docstring": null, + "objects": { + "logic": { + "name": "logic", + "kind": "module", + "path": "docforge.cli.mcp.logic", + "signature": null, + "docstring": null, + "members": { + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.mcp.logic.Path", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.mcp.logic.click", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.mcp.logic.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.mcp.logic.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.mcp.logic.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", + "kind": "function", + "path": "docforge.cli.mcp.logic.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MCPRenderer": { + "name": "MCPRenderer", + "kind": "class", + "path": "docforge.cli.mcp.logic.MCPRenderer", + "signature": "", + "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.mcp.logic.MCPRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mcp.logic.MCPRenderer.generate_sources", + "signature": "", + "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + } + } + }, + "MCPServer": { + "name": "MCPServer", + "kind": "class", + "path": "docforge.cli.mcp.logic.MCPServer", + "signature": "", + "docstring": "MCP server for serving a pre-built MCP documentation bundle.", + "members": { + "mcp_root": { + "name": "mcp_root", + "kind": "attribute", + "path": "docforge.cli.mcp.logic.MCPServer.mcp_root", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "docforge.cli.mcp.logic.MCPServer.app", + "signature": "", + "docstring": null + }, + "run": { + "name": "run", + "kind": "function", + "path": "docforge.cli.mcp.logic.MCPServer.run", + "signature": "", + "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" + } + } + }, + "generate_resources": { + "name": "generate_resources", + "kind": "function", + "path": "docforge.cli.mcp.logic.generate_resources", + "signature": "", + "docstring": "Generate MCP-compatible documentation resources." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.mcp.logic.serve", + "signature": "", + "docstring": "Serve MCP documentation." + } + } + } + } + } +} \ No newline at end of file diff --git a/mcp_docs/modules/docforge.cli.mcp.logic.json b/mcp_docs/modules/docforge.cli.mcp.logic.json new file mode 100644 index 0000000..94f4006 --- /dev/null +++ b/mcp_docs/modules/docforge.cli.mcp.logic.json @@ -0,0 +1,120 @@ +{ + "module": "docforge.cli.mcp.logic", + "content": { + "path": "docforge.cli.mcp.logic", + "docstring": null, + "objects": { + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.mcp.logic.Path", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.mcp.logic.click", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.mcp.logic.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.mcp.logic.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.mcp.logic.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", + "kind": "function", + "path": "docforge.cli.mcp.logic.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MCPRenderer": { + "name": "MCPRenderer", + "kind": "class", + "path": "docforge.cli.mcp.logic.MCPRenderer", + "signature": "", + "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.mcp.logic.MCPRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mcp.logic.MCPRenderer.generate_sources", + "signature": "", + "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + } + } + }, + "MCPServer": { + "name": "MCPServer", + "kind": "class", + "path": "docforge.cli.mcp.logic.MCPServer", + "signature": "", + "docstring": "MCP server for serving a pre-built MCP documentation bundle.", + "members": { + "mcp_root": { + "name": "mcp_root", + "kind": "attribute", + "path": "docforge.cli.mcp.logic.MCPServer.mcp_root", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "docforge.cli.mcp.logic.MCPServer.app", + "signature": "", + "docstring": null + }, + "run": { + "name": "run", + "kind": "function", + "path": "docforge.cli.mcp.logic.MCPServer.run", + "signature": "", + "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" + } + } + }, + "generate_resources": { + "name": "generate_resources", + "kind": "function", + "path": "docforge.cli.mcp.logic.generate_resources", + "signature": "", + "docstring": "Generate MCP-compatible documentation resources." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.mcp.logic.serve", + "signature": "", + "docstring": "Serve MCP documentation." + } + } + } +} \ No newline at end of file diff --git a/mcp_docs/modules/docforge.cli.mkdocs.json b/mcp_docs/modules/docforge.cli.mkdocs.json index 0d1b09f..266b836 100644 --- a/mcp_docs/modules/docforge.cli.mkdocs.json +++ b/mcp_docs/modules/docforge.cli.mkdocs.json @@ -2,93 +2,155 @@ "module": "docforge.cli.mkdocs", "content": { "path": "docforge.cli.mkdocs", - "docstring": "This module contains the 'mkdocs' CLI command, which orchestrates the generation\nof the main mkdocs.yml configuration file.", + "docstring": null, "objects": { - "Path": { - "name": "Path", - "kind": "alias", - "path": "docforge.cli.mkdocs.Path", - "signature": "", - "docstring": null - }, - "resources": { - "name": "resources", - "kind": "alias", - "path": "docforge.cli.mkdocs.resources", - "signature": "", - "docstring": null - }, - "click": { - "name": "click", - "kind": "alias", - "path": "docforge.cli.mkdocs.click", - "signature": "", - "docstring": null - }, - "yaml": { - "name": "yaml", - "kind": "alias", - "path": "docforge.cli.mkdocs.yaml", - "signature": "", - "docstring": null - }, - "load_nav_spec": { - "name": "load_nav_spec", - "kind": "function", - "path": "docforge.cli.mkdocs.load_nav_spec", - "signature": "", - "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." - }, - "resolve_nav": { - "name": "resolve_nav", - "kind": "function", - "path": "docforge.cli.mkdocs.resolve_nav", - "signature": "", - "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." - }, - "MkDocsNavEmitter": { - "name": "MkDocsNavEmitter", - "kind": "class", - "path": "docforge.cli.mkdocs.MkDocsNavEmitter", - "signature": "", - "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", + "logic": { + "name": "logic", + "kind": "module", + "path": "docforge.cli.mkdocs.logic", + "signature": null, + "docstring": null, "members": { - "emit": { - "name": "emit", + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.Path", + "signature": "", + "docstring": null + }, + "resources": { + "name": "resources", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.resources", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.click", + "signature": "", + "docstring": null + }, + "yaml": { + "name": "yaml", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.yaml", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.mkdocs.logic.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", "kind": "function", - "path": "docforge.cli.mkdocs.MkDocsNavEmitter.emit", - "signature": "", - "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." + "path": "docforge.cli.mkdocs.logic.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MkDocsRenderer": { + "name": "MkDocsRenderer", + "kind": "class", + "path": "docforge.cli.mkdocs.logic.MkDocsRenderer", + "signature": "", + "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.generate_sources", + "signature": "", + "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." + } + } + }, + "load_nav_spec": { + "name": "load_nav_spec", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.load_nav_spec", + "signature": "", + "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." + }, + "resolve_nav": { + "name": "resolve_nav", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.resolve_nav", + "signature": "", + "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." + }, + "MkDocsNavEmitter": { + "name": "MkDocsNavEmitter", + "kind": "class", + "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter", + "signature": "", + "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", + "members": { + "emit": { + "name": "emit", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter.emit", + "signature": "", + "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." + } + } + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.generate_sources", + "signature": "", + "docstring": "Generate Markdown source files for the specified module." + }, + "generate_config": { + "name": "generate_config", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.generate_config", + "signature": "", + "docstring": "Generate an mkdocs.yml configuration file." + }, + "build": { + "name": "build", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.build", + "signature": "", + "docstring": "Build the documentation site using MkDocs." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.serve", + "signature": "", + "docstring": "Serve the documentation site with live-reload using MkDocs." } } - }, - "mkdocs_cmd": { - "name": "mkdocs_cmd", - "kind": "function", - "path": "docforge.cli.mkdocs.mkdocs_cmd", - "signature": "", - "docstring": "Generate an mkdocs.yml configuration file by combining a template with\nthe navigation structure resolved from a docforge.nav.yml file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template.\n out: Path where the final mkdocs.yml will be written.\n site_name: The name of the documentation site." - }, - "Any": { - "name": "Any", - "kind": "alias", - "path": "docforge.cli.mkdocs.Any", - "signature": "", - "docstring": null - }, - "Dict": { - "name": "Dict", - "kind": "alias", - "path": "docforge.cli.mkdocs.Dict", - "signature": "", - "docstring": null - }, - "Optional": { - "name": "Optional", - "kind": "alias", - "path": "docforge.cli.mkdocs.Optional", - "signature": "", - "docstring": null } } } diff --git a/mcp_docs/modules/docforge.cli.mkdocs.logic.json b/mcp_docs/modules/docforge.cli.mkdocs.logic.json new file mode 100644 index 0000000..e40f422 --- /dev/null +++ b/mcp_docs/modules/docforge.cli.mkdocs.logic.json @@ -0,0 +1,148 @@ +{ + "module": "docforge.cli.mkdocs.logic", + "content": { + "path": "docforge.cli.mkdocs.logic", + "docstring": null, + "objects": { + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.Path", + "signature": "", + "docstring": null + }, + "resources": { + "name": "resources", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.resources", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.click", + "signature": "", + "docstring": null + }, + "yaml": { + "name": "yaml", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.yaml", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.mkdocs.logic.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MkDocsRenderer": { + "name": "MkDocsRenderer", + "kind": "class", + "path": "docforge.cli.mkdocs.logic.MkDocsRenderer", + "signature": "", + "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.generate_sources", + "signature": "", + "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." + } + } + }, + "load_nav_spec": { + "name": "load_nav_spec", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.load_nav_spec", + "signature": "", + "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." + }, + "resolve_nav": { + "name": "resolve_nav", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.resolve_nav", + "signature": "", + "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." + }, + "MkDocsNavEmitter": { + "name": "MkDocsNavEmitter", + "kind": "class", + "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter", + "signature": "", + "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", + "members": { + "emit": { + "name": "emit", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter.emit", + "signature": "", + "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." + } + } + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.generate_sources", + "signature": "", + "docstring": "Generate Markdown source files for the specified module." + }, + "generate_config": { + "name": "generate_config", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.generate_config", + "signature": "", + "docstring": "Generate an mkdocs.yml configuration file." + }, + "build": { + "name": "build", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.build", + "signature": "", + "docstring": "Build the documentation site using MkDocs." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.serve", + "signature": "", + "docstring": "Serve the documentation site with live-reload using MkDocs." + } + } + } +} \ No newline at end of file diff --git a/mcp_docs/modules/docforge.json b/mcp_docs/modules/docforge.json index df5969d..f166173 100644 --- a/mcp_docs/modules/docforge.json +++ b/mcp_docs/modules/docforge.json @@ -85,119 +85,8 @@ "kind": "module", "path": "docforge.main", "signature": "", - "docstring": "Main entry point for the doc-forge CLI. This module defines the core command\ngroup and the 'tree', 'generate', 'build', and 'serve' commands.", + "docstring": "Main entry point for the doc-forge CLI.", "members": { - "Path": { - "name": "Path", - "kind": "alias", - "path": "docforge.main.Path", - "signature": "", - "docstring": null - }, - "Sequence": { - "name": "Sequence", - "kind": "alias", - "path": "docforge.main.Sequence", - "signature": "", - "docstring": null - }, - "Optional": { - "name": "Optional", - "kind": "alias", - "path": "docforge.main.Optional", - "signature": "", - "docstring": null - }, - "click": { - "name": "click", - "kind": "alias", - "path": "docforge.main.click", - "signature": "", - "docstring": null - }, - "GriffeLoader": { - "name": "GriffeLoader", - "kind": "class", - "path": "docforge.main.GriffeLoader", - "signature": "", - "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", - "members": { - "load_project": { - "name": "load_project", - "kind": "function", - "path": "docforge.main.GriffeLoader.load_project", - "signature": "", - "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." - }, - "load_module": { - "name": "load_module", - "kind": "function", - "path": "docforge.main.GriffeLoader.load_module", - "signature": "", - "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." - } - } - }, - "discover_module_paths": { - "name": "discover_module_paths", - "kind": "function", - "path": "docforge.main.discover_module_paths", - "signature": "", - "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." - }, - "MkDocsRenderer": { - "name": "MkDocsRenderer", - "kind": "class", - "path": "docforge.main.MkDocsRenderer", - "signature": "", - "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", - "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "docforge.main.MkDocsRenderer.name", - "signature": "", - "docstring": null - }, - "generate_sources": { - "name": "generate_sources", - "kind": "function", - "path": "docforge.main.MkDocsRenderer.generate_sources", - "signature": "", - "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." - } - } - }, - "MCPRenderer": { - "name": "MCPRenderer", - "kind": "class", - "path": "docforge.main.MCPRenderer", - "signature": "", - "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", - "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "docforge.main.MCPRenderer.name", - "signature": "", - "docstring": null - }, - "generate_sources": { - "name": "generate_sources", - "kind": "function", - "path": "docforge.main.MCPRenderer.generate_sources", - "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." - } - } - }, - "mkdocs_cmd": { - "name": "mkdocs_cmd", - "kind": "function", - "path": "docforge.main.mkdocs_cmd", - "signature": "", - "docstring": "Generate an mkdocs.yml configuration file by combining a template with\nthe navigation structure resolved from a docforge.nav.yml file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template.\n out: Path where the final mkdocs.yml will be written.\n site_name: The name of the documentation site." - }, "cli": { "name": "cli", "kind": "function", @@ -205,48 +94,6 @@ "signature": "", "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." }, - "tree": { - "name": "tree", - "kind": "function", - "path": "docforge.main.tree", - "signature": "", - "docstring": "Visualize the project structure including modules and their members.\n\nArgs:\n modules: List of module paths to introspect.\n project_name: Optional project name override." - }, - "generate": { - "name": "generate", - "kind": "function", - "path": "docforge.main.generate", - "signature": "", - "docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The primary module path to document.\n project_name: Optional project name override.\n docs_dir: Directory where documentation sources will be written." - }, - "generate_mcp": { - "name": "generate_mcp", - "kind": "function", - "path": "docforge.main.generate_mcp", - "signature": "", - "docstring": "Generate MCP-compatible documentation resources for the specified module.\n\nArgs:\n module: The primary module path to document.\n project_name: Optional project name override.\n out_dir: Directory where MCP resources will be written." - }, - "build": { - "name": "build", - "kind": "function", - "path": "docforge.main.build", - "signature": "", - "docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." - }, - "serve_mcp": { - "name": "serve_mcp", - "kind": "function", - "path": "docforge.main.serve_mcp", - "signature": "", - "docstring": "Serve MCP documentation from the local mcp_docs directory." - }, - "serve": { - "name": "serve", - "kind": "function", - "path": "docforge.main.serve", - "signature": "", - "docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." - }, "main": { "name": "main", "kind": "function", @@ -268,174 +115,506 @@ "kind": "module", "path": "docforge.cli.main", "signature": null, - "docstring": "Main entry point for the doc-forge CLI. This module defines the core command\ngroup and the 'tree', 'generate', 'build', and 'serve' commands.", + "docstring": "Main entry point for the doc-forge CLI.", "members": { + "cli": { + "name": "cli", + "kind": "function", + "path": "docforge.cli.main.cli", + "signature": "", + "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." + }, + "main": { + "name": "main", + "kind": "function", + "path": "docforge.cli.main.main", + "signature": "", + "docstring": "CLI Entry point. Boots the click application." + } + } + }, + "commands": { + "name": "commands", + "kind": "module", + "path": "docforge.cli.commands", + "signature": null, + "docstring": null, + "members": { + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.commands.click", + "signature": "", + "docstring": null + }, "Path": { "name": "Path", "kind": "alias", - "path": "docforge.cli.main.Path", + "path": "docforge.cli.commands.Path", "signature": "", "docstring": null }, "Sequence": { "name": "Sequence", "kind": "alias", - "path": "docforge.cli.main.Sequence", + "path": "docforge.cli.commands.Sequence", "signature": "", "docstring": null }, "Optional": { "name": "Optional", "kind": "alias", - "path": "docforge.cli.main.Optional", + "path": "docforge.cli.commands.Optional", "signature": "", "docstring": null }, - "click": { - "name": "click", - "kind": "alias", - "path": "docforge.cli.main.click", - "signature": "", - "docstring": null - }, "GriffeLoader": { "name": "GriffeLoader", "kind": "class", - "path": "docforge.cli.main.GriffeLoader", + "path": "docforge.cli.commands.GriffeLoader", "signature": "", "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", "members": { "load_project": { "name": "load_project", "kind": "function", - "path": "docforge.cli.main.GriffeLoader.load_project", + "path": "docforge.cli.commands.GriffeLoader.load_project", "signature": "", "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." }, "load_module": { "name": "load_module", "kind": "function", - "path": "docforge.cli.main.GriffeLoader.load_module", + "path": "docforge.cli.commands.GriffeLoader.load_module", "signature": "", "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." } } }, - "discover_module_paths": { - "name": "discover_module_paths", - "kind": "function", - "path": "docforge.cli.main.discover_module_paths", - "signature": "", - "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." - }, - "MkDocsRenderer": { - "name": "MkDocsRenderer", - "kind": "class", - "path": "docforge.cli.main.MkDocsRenderer", - "signature": "", - "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", + "mkdocs_logic": { + "name": "mkdocs_logic", + "kind": "module", + "path": "docforge.cli.commands.mkdocs_logic", + "signature": "", + "docstring": null, "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "docforge.cli.main.MkDocsRenderer.name", - "signature": "", + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.commands.mkdocs_logic.Path", + "signature": "", "docstring": null }, + "resources": { + "name": "resources", + "kind": "alias", + "path": "docforge.cli.commands.mkdocs_logic.resources", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.commands.mkdocs_logic.click", + "signature": "", + "docstring": null + }, + "yaml": { + "name": "yaml", + "kind": "alias", + "path": "docforge.cli.commands.mkdocs_logic.yaml", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MkDocsRenderer": { + "name": "MkDocsRenderer", + "kind": "class", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer", + "signature": "", + "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.generate_sources", + "signature": "", + "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." + } + } + }, + "load_nav_spec": { + "name": "load_nav_spec", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.load_nav_spec", + "signature": "", + "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." + }, + "resolve_nav": { + "name": "resolve_nav", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.resolve_nav", + "signature": "", + "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." + }, + "MkDocsNavEmitter": { + "name": "MkDocsNavEmitter", + "kind": "class", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter", + "signature": "", + "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", + "members": { + "emit": { + "name": "emit", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter.emit", + "signature": "", + "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." + } + } + }, "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.main.MkDocsRenderer.generate_sources", - "signature": "", - "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." + "path": "docforge.cli.commands.mkdocs_logic.generate_sources", + "signature": "", + "docstring": "Generate Markdown source files for the specified module." + }, + "generate_config": { + "name": "generate_config", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.generate_config", + "signature": "", + "docstring": "Generate an mkdocs.yml configuration file." + }, + "build": { + "name": "build", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.build", + "signature": "", + "docstring": "Build the documentation site using MkDocs." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.commands.mkdocs_logic.serve", + "signature": "", + "docstring": "Serve the documentation site with live-reload using MkDocs." } } }, - "MCPRenderer": { - "name": "MCPRenderer", - "kind": "class", - "path": "docforge.cli.main.MCPRenderer", - "signature": "", - "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", + "mcp_logic": { + "name": "mcp_logic", + "kind": "module", + "path": "docforge.cli.commands.mcp_logic", + "signature": "", + "docstring": null, "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "docforge.cli.main.MCPRenderer.name", - "signature": "", + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.commands.mcp_logic.Path", + "signature": "", "docstring": null }, - "generate_sources": { - "name": "generate_sources", + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.commands.mcp_logic.click", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.commands.mcp_logic.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", "kind": "function", - "path": "docforge.cli.main.MCPRenderer.generate_sources", - "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + "path": "docforge.cli.commands.mcp_logic.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MCPRenderer": { + "name": "MCPRenderer", + "kind": "class", + "path": "docforge.cli.commands.mcp_logic.MCPRenderer", + "signature": "", + "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.commands.mcp_logic.MCPRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.MCPRenderer.generate_sources", + "signature": "", + "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + } + } + }, + "MCPServer": { + "name": "MCPServer", + "kind": "class", + "path": "docforge.cli.commands.mcp_logic.MCPServer", + "signature": "", + "docstring": "MCP server for serving a pre-built MCP documentation bundle.", + "members": { + "mcp_root": { + "name": "mcp_root", + "kind": "attribute", + "path": "docforge.cli.commands.mcp_logic.MCPServer.mcp_root", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "docforge.cli.commands.mcp_logic.MCPServer.app", + "signature": "", + "docstring": null + }, + "run": { + "name": "run", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.MCPServer.run", + "signature": "", + "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" + } + } + }, + "generate_resources": { + "name": "generate_resources", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.generate_resources", + "signature": "", + "docstring": "Generate MCP-compatible documentation resources." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.commands.mcp_logic.serve", + "signature": "", + "docstring": "Serve MCP documentation." } } }, - "mkdocs_cmd": { - "name": "mkdocs_cmd", - "kind": "function", - "path": "docforge.cli.main.mkdocs_cmd", - "signature": "", - "docstring": "Generate an mkdocs.yml configuration file by combining a template with\nthe navigation structure resolved from a docforge.nav.yml file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template.\n out: Path where the final mkdocs.yml will be written.\n site_name: The name of the documentation site." - }, "cli": { "name": "cli", "kind": "function", - "path": "docforge.cli.main.cli", - "signature": "", + "path": "docforge.cli.commands.cli", + "signature": "", "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." }, - "tree": { - "name": "tree", - "kind": "function", - "path": "docforge.cli.main.tree", - "signature": "", - "docstring": "Visualize the project structure including modules and their members.\n\nArgs:\n modules: List of module paths to introspect.\n project_name: Optional project name override." - }, - "generate": { - "name": "generate", - "kind": "function", - "path": "docforge.cli.main.generate", - "signature": "", - "docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The primary module path to document.\n project_name: Optional project name override.\n docs_dir: Directory where documentation sources will be written." - }, - "generate_mcp": { - "name": "generate_mcp", - "kind": "function", - "path": "docforge.cli.main.generate_mcp", - "signature": "", - "docstring": "Generate MCP-compatible documentation resources for the specified module.\n\nArgs:\n module: The primary module path to document.\n project_name: Optional project name override.\n out_dir: Directory where MCP resources will be written." - }, "build": { "name": "build", "kind": "function", - "path": "docforge.cli.main.build", - "signature": "", - "docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." - }, - "serve_mcp": { - "name": "serve_mcp", - "kind": "function", - "path": "docforge.cli.main.serve_mcp", - "signature": "", - "docstring": "Serve MCP documentation from the local mcp_docs directory." + "path": "docforge.cli.commands.build", + "signature": "", + "docstring": "Build documentation (MkDocs site or MCP resources)." }, "serve": { "name": "serve", "kind": "function", - "path": "docforge.cli.main.serve", - "signature": "", - "docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." + "path": "docforge.cli.commands.serve", + "signature": "", + "docstring": "Serve documentation." }, - "main": { - "name": "main", + "tree": { + "name": "tree", "kind": "function", - "path": "docforge.cli.main.main", - "signature": "", - "docstring": "CLI Entry point. Boots the click application." + "path": "docforge.cli.commands.tree", + "signature": "", + "docstring": "Visualize the project structure." + } + } + }, + "mcp": { + "name": "mcp", + "kind": "module", + "path": "docforge.cli.mcp", + "signature": null, + "docstring": null, + "members": { + "logic": { + "name": "logic", + "kind": "module", + "path": "docforge.cli.mcp.logic", + "signature": null, + "docstring": null, + "members": { + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.mcp.logic.Path", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.mcp.logic.click", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.mcp.logic.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.mcp.logic.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.mcp.logic.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", + "kind": "function", + "path": "docforge.cli.mcp.logic.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MCPRenderer": { + "name": "MCPRenderer", + "kind": "class", + "path": "docforge.cli.mcp.logic.MCPRenderer", + "signature": "", + "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.mcp.logic.MCPRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mcp.logic.MCPRenderer.generate_sources", + "signature": "", + "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + } + } + }, + "MCPServer": { + "name": "MCPServer", + "kind": "class", + "path": "docforge.cli.mcp.logic.MCPServer", + "signature": "", + "docstring": "MCP server for serving a pre-built MCP documentation bundle.", + "members": { + "mcp_root": { + "name": "mcp_root", + "kind": "attribute", + "path": "docforge.cli.mcp.logic.MCPServer.mcp_root", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "docforge.cli.mcp.logic.MCPServer.app", + "signature": "", + "docstring": null + }, + "run": { + "name": "run", + "kind": "function", + "path": "docforge.cli.mcp.logic.MCPServer.run", + "signature": "", + "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" + } + } + }, + "generate_resources": { + "name": "generate_resources", + "kind": "function", + "path": "docforge.cli.mcp.logic.generate_resources", + "signature": "", + "docstring": "Generate MCP-compatible documentation resources." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.mcp.logic.serve", + "signature": "", + "docstring": "Serve MCP documentation." + } + } } } }, @@ -444,93 +623,155 @@ "kind": "module", "path": "docforge.cli.mkdocs", "signature": null, - "docstring": "This module contains the 'mkdocs' CLI command, which orchestrates the generation\nof the main mkdocs.yml configuration file.", + "docstring": null, "members": { - "Path": { - "name": "Path", - "kind": "alias", - "path": "docforge.cli.mkdocs.Path", - "signature": "", - "docstring": null - }, - "resources": { - "name": "resources", - "kind": "alias", - "path": "docforge.cli.mkdocs.resources", - "signature": "", - "docstring": null - }, - "click": { - "name": "click", - "kind": "alias", - "path": "docforge.cli.mkdocs.click", - "signature": "", - "docstring": null - }, - "yaml": { - "name": "yaml", - "kind": "alias", - "path": "docforge.cli.mkdocs.yaml", - "signature": "", - "docstring": null - }, - "load_nav_spec": { - "name": "load_nav_spec", - "kind": "function", - "path": "docforge.cli.mkdocs.load_nav_spec", - "signature": "", - "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." - }, - "resolve_nav": { - "name": "resolve_nav", - "kind": "function", - "path": "docforge.cli.mkdocs.resolve_nav", - "signature": "", - "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." - }, - "MkDocsNavEmitter": { - "name": "MkDocsNavEmitter", - "kind": "class", - "path": "docforge.cli.mkdocs.MkDocsNavEmitter", - "signature": "", - "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", + "logic": { + "name": "logic", + "kind": "module", + "path": "docforge.cli.mkdocs.logic", + "signature": null, + "docstring": null, "members": { - "emit": { - "name": "emit", + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.Path", + "signature": "", + "docstring": null + }, + "resources": { + "name": "resources", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.resources", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.click", + "signature": "", + "docstring": null + }, + "yaml": { + "name": "yaml", + "kind": "alias", + "path": "docforge.cli.mkdocs.logic.yaml", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.mkdocs.logic.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", "kind": "function", - "path": "docforge.cli.mkdocs.MkDocsNavEmitter.emit", - "signature": "", - "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." + "path": "docforge.cli.mkdocs.logic.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MkDocsRenderer": { + "name": "MkDocsRenderer", + "kind": "class", + "path": "docforge.cli.mkdocs.logic.MkDocsRenderer", + "signature": "", + "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.generate_sources", + "signature": "", + "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." + } + } + }, + "load_nav_spec": { + "name": "load_nav_spec", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.load_nav_spec", + "signature": "", + "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." + }, + "resolve_nav": { + "name": "resolve_nav", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.resolve_nav", + "signature": "", + "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." + }, + "MkDocsNavEmitter": { + "name": "MkDocsNavEmitter", + "kind": "class", + "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter", + "signature": "", + "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", + "members": { + "emit": { + "name": "emit", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter.emit", + "signature": "", + "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." + } + } + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.generate_sources", + "signature": "", + "docstring": "Generate Markdown source files for the specified module." + }, + "generate_config": { + "name": "generate_config", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.generate_config", + "signature": "", + "docstring": "Generate an mkdocs.yml configuration file." + }, + "build": { + "name": "build", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.build", + "signature": "", + "docstring": "Build the documentation site using MkDocs." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.mkdocs.logic.serve", + "signature": "", + "docstring": "Serve the documentation site with live-reload using MkDocs." } } - }, - "mkdocs_cmd": { - "name": "mkdocs_cmd", - "kind": "function", - "path": "docforge.cli.mkdocs.mkdocs_cmd", - "signature": "", - "docstring": "Generate an mkdocs.yml configuration file by combining a template with\nthe navigation structure resolved from a docforge.nav.yml file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template.\n out: Path where the final mkdocs.yml will be written.\n site_name: The name of the documentation site." - }, - "Any": { - "name": "Any", - "kind": "alias", - "path": "docforge.cli.mkdocs.Any", - "signature": "", - "docstring": null - }, - "Dict": { - "name": "Dict", - "kind": "alias", - "path": "docforge.cli.mkdocs.Dict", - "signature": "", - "docstring": null - }, - "Optional": { - "name": "Optional", - "kind": "alias", - "path": "docforge.cli.mkdocs.Optional", - "signature": "", - "docstring": null } } } diff --git a/mcp_docs/nav.json b/mcp_docs/nav.json index c64d959..597961a 100644 --- a/mcp_docs/nav.json +++ b/mcp_docs/nav.json @@ -7,14 +7,30 @@ "module": "docforge.cli", "resource": "doc://modules/docforge.cli" }, + { + "module": "docforge.cli.commands", + "resource": "doc://modules/docforge.cli.commands" + }, { "module": "docforge.cli.main", "resource": "doc://modules/docforge.cli.main" }, + { + "module": "docforge.cli.mcp", + "resource": "doc://modules/docforge.cli.mcp" + }, + { + "module": "docforge.cli.mcp.logic", + "resource": "doc://modules/docforge.cli.mcp.logic" + }, { "module": "docforge.cli.mkdocs", "resource": "doc://modules/docforge.cli.mkdocs" }, + { + "module": "docforge.cli.mkdocs.logic", + "resource": "doc://modules/docforge.cli.mkdocs.logic" + }, { "module": "docforge.loaders", "resource": "doc://modules/docforge.loaders" diff --git a/mkdocs.yml b/mkdocs.yml index 36df731..46de294 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,5 +1,3 @@ -site_name: DocForge - theme: name: material palette: @@ -33,7 +31,7 @@ plugins: annotations_path: brief show_root_heading: true group_by_category: true - +site_name: docforge nav: - Home: docforge/index.md - Loaders: @@ -57,4 +55,8 @@ nav: - CLI: - docforge/cli/index.md - docforge/cli/main.md - - docforge/cli/mkdocs.md + - docforge/cli/commands.md + - docforge/cli/mcp/index.md + - docforge/cli/mcp/logic.md + - docforge/cli/mkdocs/index.md + - docforge/cli/mkdocs/logic.md diff --git a/tests/cli/conftest.py b/tests/cli/conftest.py deleted file mode 100644 index bcfc154..0000000 --- a/tests/cli/conftest.py +++ /dev/null @@ -1,111 +0,0 @@ -import json -import pytest -from pathlib import Path - -from click.testing import CliRunner - - -@pytest.fixture -def cli_runner() -> CliRunner: - """Click CLI runner.""" - return CliRunner() - - -@pytest.fixture -def fake_mkdocs_yml(tmp_path: Path) -> Path: - """Create a minimal mkdocs.yml file.""" - yml = tmp_path / "mkdocs.yml" - yml.write_text( - """ -site_name: Test Docs -nav: [] -plugins: - - mkdocstrings -""", - encoding="utf-8", - ) - return yml - - -@pytest.fixture -def mock_mkdocs_load_config(monkeypatch): - """Mock mkdocs.config.load_config.""" - def fake_load_config(path): - return object() # dummy config object - - monkeypatch.setattr( - "mkdocs.config.load_config", - fake_load_config, - ) - - -@pytest.fixture -def mock_mkdocs_build(monkeypatch): - called = {"value": False} - - def fake_build(config): - called["value"] = True - - monkeypatch.setattr( - "mkdocs.commands.build.build", - fake_build, - ) - return lambda: called["value"] - - -@pytest.fixture -def mock_mkdocs_serve(monkeypatch): - called = {"value": False} - - def fake_serve(*args, **kwargs): - called["value"] = True - - monkeypatch.setattr( - "mkdocs.commands.serve.serve", - fake_serve, - ) - return lambda: called["value"] - -@pytest.fixture -def fake_mcp_docs(tmp_path: Path) -> Path: - """ - Create a minimal valid MCP bundle in mcp_docs/. - """ - mcp_root = tmp_path / "mcp_docs" - modules_dir = mcp_root / "modules" - modules_dir.mkdir(parents=True) - - (mcp_root / "index.json").write_text( - json.dumps({"project": "test", "type": "docforge-model"}), - encoding="utf-8", - ) - - (mcp_root / "nav.json").write_text( - json.dumps([]), - encoding="utf-8", - ) - - (modules_dir / "test.mod.json").write_text( - json.dumps({"module": "test.mod", "content": {}}), - encoding="utf-8", - ) - - return mcp_root - - -@pytest.fixture -def mock_mcp_server_run(monkeypatch): - """ - Mock MCPServer.run so no real server is started. - """ - called = {"value": False} - - def fake_run(self, transport="streamable-http"): - called["value"] = True - - monkeypatch.setattr( - "docforge.servers.MCPServer.run", - fake_run, - ) - - return lambda: called["value"] diff --git a/tests/cli/test_build.py b/tests/cli/test_build.py deleted file mode 100644 index 2494141..0000000 --- a/tests/cli/test_build.py +++ /dev/null @@ -1,20 +0,0 @@ -from docforge.cli.main import cli - - -def test_build_command( - cli_runner, - fake_mkdocs_yml, - mock_mkdocs_load_config, - mock_mkdocs_build, -): - result = cli_runner.invoke( - cli, - [ - "build", - "--mkdocs-yml", - str(fake_mkdocs_yml), - ], - ) - - assert result.exit_code == 0 - assert mock_mkdocs_build() is True diff --git a/tests/cli/test_generate.py b/tests/cli/test_build_mcp.py similarity index 54% rename from tests/cli/test_generate.py rename to tests/cli/test_build_mcp.py index c00b5ba..61e820a 100644 --- a/tests/cli/test_generate.py +++ b/tests/cli/test_build_mcp.py @@ -1,35 +1,31 @@ +import json from pathlib import Path - +from click.testing import CliRunner from docforge.cli.main import cli - -def test_generate_command(cli_runner): +def test_mcp_build(cli_runner): with cli_runner.isolated_filesystem(): cwd = Path.cwd() - - # Create package structure pkg = cwd / "testpkg" pkg.mkdir() (pkg / "__init__.py").write_text("") (pkg / "mod.py").write_text("def f(): ...\n") - docs_dir = cwd / "docs" + out_dir = cwd / "mcp_docs" result = cli_runner.invoke( cli, [ - "generate", + "build", + "--mcp", "--module", "testpkg", - "--docs-dir", - str(docs_dir), + "--out-dir", + str(out_dir), ], ) assert result.exit_code == 0 - - md = docs_dir / "testpkg" / "mod.md" - assert md.exists() - - content = md.read_text() - assert "::: testpkg.mod" in content + assert (out_dir / "index.json").exists() + assert (out_dir / "nav.json").exists() + assert (out_dir / "modules" / "testpkg.mod.json").exists() diff --git a/tests/cli/test_build_mkdocs.py b/tests/cli/test_build_mkdocs.py new file mode 100644 index 0000000..c0f6bdf --- /dev/null +++ b/tests/cli/test_build_mkdocs.py @@ -0,0 +1,54 @@ +from pathlib import Path +from docforge.cli.main import cli + +def test_mkdocs_build_full_flow( + cli_runner, + mock_mkdocs_build, + mock_mkdocs_load_config, + tmp_path, +): + # This test covers what used to be generate + mkdocs + build + with cli_runner.isolated_filesystem(): + cwd = Path.cwd() + pkg = cwd / "testpkg" + pkg.mkdir() + (pkg / "__init__.py").write_text("") + (pkg / "mod.py").write_text("def f(): ...\n") + + nav_file = cwd / "docforge.nav.yml" + nav_file.write_text("home: testpkg/index.md\ngroups: {}\n") + + # We need to create a dummy testpkg/index.md for nav resolution if it's there + # But generate_sources will create it. + # Wait, the current logic runs generate_sources first, THEN generate_config. + + result = cli_runner.invoke( + cli, + [ + "build", + "--mkdocs", + "--module", + "testpkg", + "--site-name", + "Test Site", + "--docs-dir", + "docs", + "--mkdocs-yml", + "mkdocs.yml", + ], + ) + + assert result.exit_code == 0 + assert mock_mkdocs_build() is True + assert (cwd / "mkdocs.yml").exists() + assert (cwd / "docs" / "testpkg" / "mod.md").exists() + +def test_mkdocs_build_missing_module_fails(cli_runner): + result = cli_runner.invoke(cli, ["build", "--mkdocs", "--site-name", "Test"]) + assert result.exit_code != 0 + assert "--module is required" in result.output + +def test_mkdocs_build_missing_site_name_fails(cli_runner): + result = cli_runner.invoke(cli, ["build", "--mkdocs", "--module", "testpkg"]) + assert result.exit_code != 0 + assert "--site-name is required" in result.output diff --git a/tests/cli/test_mkdocs.py b/tests/cli/test_mkdocs.py deleted file mode 100644 index 733eae7..0000000 --- a/tests/cli/test_mkdocs.py +++ /dev/null @@ -1,123 +0,0 @@ -from pathlib import Path - -import yaml -from click.testing import CliRunner - -from docforge.cli.main import cli - - -def _write_nav_spec(path: Path) -> None: - path.write_text( - """ -home: openapi_first/index.md -groups: - Core: - - openapi_first/app.md - - openapi_first/client.md -""".strip(), - encoding="utf-8", - ) - - -def _write_docs(docs: Path) -> None: - files = [ - "openapi_first/index.md", - "openapi_first/app.md", - "openapi_first/client.md", - ] - for rel in files: - p = docs / rel - p.parent.mkdir(parents=True, exist_ok=True) - p.write_text(f"# {rel}", encoding="utf-8") - - -def test_mkdocs_uses_builtin_template(tmp_path: Path) -> None: - docs = tmp_path / "docs" - docs.mkdir() - - nav_file = tmp_path / "docforge.nav.yml" - out_file = tmp_path / "mkdocs.yml" - - _write_docs(docs) - _write_nav_spec(nav_file) - - runner = CliRunner() - result = runner.invoke( - cli, - [ - "mkdocs", - "--site-name", - "DocForge", - "--docs-dir", - str(docs), - "--nav", - str(nav_file), - "--out", - str(out_file), - ], - ) - - assert result.exit_code == 0 - assert out_file.exists() - - -def test_mkdocs_overrides_template(tmp_path: Path) -> None: - docs = tmp_path / "docs" - docs.mkdir() - - nav_file = tmp_path / "docforge.nav.yml" - template = tmp_path / "custom.yml" - out_file = tmp_path / "mkdocs.yml" - - _write_docs(docs) - _write_nav_spec(nav_file) - - template.write_text( - """ -site_name: Custom Site -theme: - name: readthedocs -""".strip(), - encoding="utf-8", - ) - - runner = CliRunner() - result = runner.invoke( - cli, - [ - "mkdocs", - "--site-name", - "Override Site", - "--docs-dir", - str(docs), - "--nav", - str(nav_file), - "--template", - str(template), - "--out", - str(out_file), - ], - ) - - assert result.exit_code == 0 - assert out_file.exists() - - -def test_mkdocs_missing_nav_fails(tmp_path: Path) -> None: - docs = tmp_path / "docs" - docs.mkdir() - - runner = CliRunner() - result = runner.invoke( - cli, - [ - "mkdocs", - "--site-name", - "DocForge", - "--docs-dir", - str(docs), - ], - ) - - assert result.exit_code != 0 - assert "Nav spec not found" in result.output diff --git a/tests/cli/test_mcp_serve.py b/tests/cli/test_serve_mcp.py similarity index 77% rename from tests/cli/test_mcp_serve.py rename to tests/cli/test_serve_mcp.py index 1f9b4d4..27e6f6f 100644 --- a/tests/cli/test_mcp_serve.py +++ b/tests/cli/test_serve_mcp.py @@ -1,7 +1,6 @@ from docforge.cli.main import cli - -def test_serve_mcp( +def test_mcp_serve( cli_runner, fake_mcp_docs, mock_mcp_server_run, @@ -11,7 +10,7 @@ def test_serve_mcp( result = cli_runner.invoke( cli, - ["serve-mcp"], + ["serve", "--mcp", "--out-dir", str(fake_mcp_docs)], ) assert result.exit_code == 0 diff --git a/tests/cli/test_serve.py b/tests/cli/test_serve_mkdocs.py similarity index 87% rename from tests/cli/test_serve.py rename to tests/cli/test_serve_mkdocs.py index 5c30edd..7ac9261 100644 --- a/tests/cli/test_serve.py +++ b/tests/cli/test_serve_mkdocs.py @@ -1,7 +1,6 @@ from docforge.cli.main import cli - -def test_serve_command( +def test_mkdocs_serve( cli_runner, fake_mkdocs_yml, mock_mkdocs_serve, @@ -10,6 +9,7 @@ def test_serve_command( cli, [ "serve", + "--mkdocs", "--mkdocs-yml", str(fake_mkdocs_yml), ], diff --git a/tests/cli/test_tree.py b/tests/cli/test_tree.py deleted file mode 100644 index c26205c..0000000 --- a/tests/cli/test_tree.py +++ /dev/null @@ -1,24 +0,0 @@ -from docforge.cli.main import cli - - -def test_tree_command(cli_runner, temp_package): - (temp_package / "mod.py").write_text( - ''' -class A: - def f(self): ... -''' - ) - - result = cli_runner.invoke( - cli, - [ - "tree", - "--modules", - "testpkg.mod", - ], - ) - - assert result.exit_code == 0 - assert "testpkg" in result.output - assert "mod" in result.output - assert "A" in result.output diff --git a/tests/conftest.py b/tests/conftest.py index ab2c7fb..e3973b7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,7 +1,9 @@ import sys +import json +import pytest from pathlib import Path -import pytest +from click.testing import CliRunner @pytest.fixture @@ -16,3 +18,109 @@ def temp_package(tmp_path: Path): sys.path.insert(0, str(tmp_path)) yield pkg sys.path.remove(str(tmp_path)) + + +@pytest.fixture +def cli_runner() -> CliRunner: + """Click CLI runner.""" + return CliRunner() + + +@pytest.fixture +def fake_mkdocs_yml(tmp_path: Path) -> Path: + """Create a minimal mkdocs.yml file.""" + yml = tmp_path / "mkdocs.yml" + yml.write_text( + """ +site_name: Test Docs +nav: [] +plugins: + - mkdocstrings +""", + encoding="utf-8", + ) + return yml + + +@pytest.fixture +def mock_mkdocs_load_config(monkeypatch): + """Mock mkdocs.config.load_config.""" + def fake_load_config(path): + return object() # dummy config object + + monkeypatch.setattr( + "mkdocs.config.load_config", + fake_load_config, + ) + + +@pytest.fixture +def mock_mkdocs_build(monkeypatch): + called = {"value": False} + + def fake_build(config): + called["value"] = True + + monkeypatch.setattr( + "mkdocs.commands.build.build", + fake_build, + ) + return lambda: called["value"] + + +@pytest.fixture +def mock_mkdocs_serve(monkeypatch): + called = {"value": False} + + def fake_serve(*args, **kwargs): + called["value"] = True + + monkeypatch.setattr( + "mkdocs.commands.serve.serve", + fake_serve, + ) + return lambda: called["value"] + +@pytest.fixture +def fake_mcp_docs(tmp_path: Path) -> Path: + """ + Create a minimal valid MCP bundle in mcp_docs/. + """ + mcp_root = tmp_path / "mcp_docs" + modules_dir = mcp_root / "modules" + modules_dir.mkdir(parents=True) + + (mcp_root / "index.json").write_text( + json.dumps({"project": "test", "type": "docforge-model"}), + encoding="utf-8", + ) + + (mcp_root / "nav.json").write_text( + json.dumps([]), + encoding="utf-8", + ) + + (modules_dir / "test.mod.json").write_text( + json.dumps({"module": "test.mod", "content": {}}), + encoding="utf-8", + ) + + return mcp_root + + +@pytest.fixture +def mock_mcp_server_run(monkeypatch): + """ + Mock MCPServer.run so no real server is started. + """ + called = {"value": False} + + def fake_run(self, transport="streamable-http"): + called["value"] = True + + monkeypatch.setattr( + "docforge.servers.MCPServer.run", + fake_run, + ) + + return lambda: called["value"] -- 2.49.1 From 8e97e571b74a9e73ca331bb7045a4f755b50b918 Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Wed, 21 Jan 2026 18:00:34 +0530 Subject: [PATCH 2/7] site name correct position --- mkdocs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 46de294..a6c1dcb 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,3 +1,5 @@ +site_name: docforge + theme: name: material palette: @@ -31,7 +33,7 @@ plugins: annotations_path: brief show_root_heading: true group_by_category: true -site_name: docforge + nav: - Home: docforge/index.md - Loaders: -- 2.49.1 From 711bef1dce3326a763aec363c074e77e35970245 Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Wed, 21 Jan 2026 18:27:40 +0530 Subject: [PATCH 3/7] refactored _logic to _utils and test cases fixes. site name is not mandatory now --- docforge/cli/commands.py | 32 ++++++----- docforge/cli/mcp/__init__.py | 0 docforge/cli/{mcp/logic.py => mcp_utils.py} | 0 docforge/cli/mkdocs/__init__.py | 0 .../cli/{mkdocs/logic.py => mkdocs_utils.py} | 0 tests/cli/test_build_mcp.py | 2 - tests/cli/test_build_mkdocs.py | 53 +++++++++++++++++-- 7 files changed, 68 insertions(+), 19 deletions(-) delete mode 100644 docforge/cli/mcp/__init__.py rename docforge/cli/{mcp/logic.py => mcp_utils.py} (100%) delete mode 100644 docforge/cli/mkdocs/__init__.py rename docforge/cli/{mkdocs/logic.py => mkdocs_utils.py} (100%) diff --git a/docforge/cli/commands.py b/docforge/cli/commands.py index 34585e3..6cb7975 100644 --- a/docforge/cli/commands.py +++ b/docforge/cli/commands.py @@ -2,8 +2,9 @@ import click from pathlib import Path from typing import Sequence, Optional from docforge.loaders import GriffeLoader -from docforge.cli.mkdocs import logic as mkdocs_logic -from docforge.cli.mcp import logic as mcp_logic +from docforge.cli import mkdocs_utils +from docforge.cli import mcp_utils + @click.group() def cli() -> None: @@ -13,6 +14,7 @@ def cli() -> None: """ pass + @cli.command() @click.option("--mcp", is_flag=True, help="Build MCP resources") @click.option("--mkdocs", is_flag=True, help="Build MkDocs site") @@ -21,7 +23,8 @@ def cli() -> None: # MkDocs specific @click.option("--site-name", help="MkDocs site name") @click.option("--docs-dir", type=click.Path(path_type=Path), default=Path("docs"), help="Directory for MD sources") -@click.option("--nav", "nav_file", type=click.Path(path_type=Path), default=Path("docforge.nav.yml"), help="Nav spec path") +@click.option("--nav", "nav_file", type=click.Path(path_type=Path), default=Path("docforge.nav.yml"), + help="Nav spec path") @click.option("--template", type=click.Path(path_type=Path), help="MkDocs template path") @click.option("--mkdocs-yml", type=click.Path(path_type=Path), default=Path("mkdocs.yml"), help="Output config path") # MCP specific @@ -49,25 +52,26 @@ def build( raise click.UsageError("--module is required for MkDocs build") if not site_name: site_name = module - + click.echo(f"Generating MkDocs sources in {docs_dir}...") - mkdocs_logic.generate_sources(module, project_name, docs_dir) - + mkdocs_utils.generate_sources(module, project_name, docs_dir) + click.echo(f"Generating MkDocs config {mkdocs_yml}...") - mkdocs_logic.generate_config(docs_dir, nav_file, template, mkdocs_yml, site_name) - + mkdocs_utils.generate_config(docs_dir, nav_file, template, mkdocs_yml, site_name) + click.echo("Running MkDocs build...") - mkdocs_logic.build(mkdocs_yml) + mkdocs_utils.build(mkdocs_yml) click.echo("MkDocs build completed.") if mcp: if not module: raise click.UsageError("--module is required for MCP build") - + click.echo(f"Generating MCP resources in {out_dir}...") - mcp_logic.generate_resources(module, project_name, out_dir) + mcp_utils.generate_resources(module, project_name, out_dir) click.echo("MCP build completed.") + @cli.command() @click.option("--mcp", is_flag=True, help="Serve MCP documentation") @click.option("--mkdocs", is_flag=True, help="Serve MkDocs site") @@ -88,9 +92,10 @@ def serve( raise click.UsageError("Must specify either --mcp or --mkdocs") if mkdocs: - mkdocs_logic.serve(mkdocs_yml) + mkdocs_utils.serve(mkdocs_yml) elif mcp: - mcp_logic.serve(out_dir) + mcp_utils.serve(out_dir) + @cli.command() @click.option( @@ -120,6 +125,7 @@ def tree( for obj in module.get_all_objects(): _print_object(obj, indent="│ ") + def _print_object(obj, indent: str) -> None: """ Recursive helper to print doc objects and their members to the console. diff --git a/docforge/cli/mcp/__init__.py b/docforge/cli/mcp/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/docforge/cli/mcp/logic.py b/docforge/cli/mcp_utils.py similarity index 100% rename from docforge/cli/mcp/logic.py rename to docforge/cli/mcp_utils.py diff --git a/docforge/cli/mkdocs/__init__.py b/docforge/cli/mkdocs/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/docforge/cli/mkdocs/logic.py b/docforge/cli/mkdocs_utils.py similarity index 100% rename from docforge/cli/mkdocs/logic.py rename to docforge/cli/mkdocs_utils.py diff --git a/tests/cli/test_build_mcp.py b/tests/cli/test_build_mcp.py index 61e820a..f783945 100644 --- a/tests/cli/test_build_mcp.py +++ b/tests/cli/test_build_mcp.py @@ -1,6 +1,4 @@ -import json from pathlib import Path -from click.testing import CliRunner from docforge.cli.main import cli def test_mcp_build(cli_runner): diff --git a/tests/cli/test_build_mkdocs.py b/tests/cli/test_build_mkdocs.py index c0f6bdf..a84722f 100644 --- a/tests/cli/test_build_mkdocs.py +++ b/tests/cli/test_build_mkdocs.py @@ -48,7 +48,52 @@ def test_mkdocs_build_missing_module_fails(cli_runner): assert result.exit_code != 0 assert "--module is required" in result.output -def test_mkdocs_build_missing_site_name_fails(cli_runner): - result = cli_runner.invoke(cli, ["build", "--mkdocs", "--module", "testpkg"]) - assert result.exit_code != 0 - assert "--site-name is required" in result.output +def test_mkdocs_build_without_site_name_uses_module_as_default_full_flow( + cli_runner, + mock_mkdocs_build, + mock_mkdocs_load_config, +): + # Full integration test: real generation, real config, mocked mkdocs build + with cli_runner.isolated_filesystem(): + cwd = Path.cwd() + + # Create a minimal Python package + pkg = cwd / "testpkg" + pkg.mkdir() + (pkg / "__init__.py").write_text("") + (pkg / "mod.py").write_text("def f(): ...\n") + + # Create nav spec expected by generate_config + nav_file = cwd / "docforge.nav.yml" + nav_file.write_text( + "home: testpkg/index.md\ngroups: {}\n", + encoding="utf-8", + ) + + result = cli_runner.invoke( + cli, + [ + "build", + "--mkdocs", + "--module", + "testpkg", + "--docs-dir", + "docs", + "--mkdocs-yml", + "mkdocs.yml", + ], + ) + + assert result.exit_code == 0 + assert mock_mkdocs_build() is True + + # MkDocs config must exist + mkdocs_yml = cwd / "mkdocs.yml" + assert mkdocs_yml.exists() + + # Site name must default to module name + content = mkdocs_yml.read_text() + assert "site_name: testpkg" in content + + # Docs must be generated + assert (cwd / "docs" / "testpkg" / "mod.md").exists() -- 2.49.1 From 9a066eb0afeaae4429650ce54adf8e9a282935fc Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Wed, 21 Jan 2026 18:30:25 +0530 Subject: [PATCH 4/7] doc changes --- docforge.nav.yml | 6 +- docs/docforge/cli/mcp/index.md | 3 - docs/docforge/cli/mcp/logic.md | 3 - docs/docforge/cli/mcp_utils.md | 3 + docs/docforge/cli/mkdocs/index.md | 3 - docs/docforge/cli/mkdocs/logic.md | 3 - docs/docforge/cli/mkdocs_utils.md | 3 + mcp_docs/index.json | 2 +- mcp_docs/modules/docforge.cli.commands.json | 136 ++-- mcp_docs/modules/docforge.cli.json | 648 +++++++++--------- mcp_docs/modules/docforge.cli.mcp.json | 129 ---- ...logic.json => docforge.cli.mcp_utils.json} | 34 +- mcp_docs/modules/docforge.cli.mkdocs.json | 157 ----- ...ic.json => docforge.cli.mkdocs_utils.json} | 42 +- mcp_docs/modules/docforge.json | 648 +++++++++--------- mcp_docs/nav.json | 16 +- mkdocs.yml | 6 +- 17 files changed, 751 insertions(+), 1091 deletions(-) delete mode 100644 docs/docforge/cli/mcp/index.md delete mode 100644 docs/docforge/cli/mcp/logic.md create mode 100644 docs/docforge/cli/mcp_utils.md delete mode 100644 docs/docforge/cli/mkdocs/index.md delete mode 100644 docs/docforge/cli/mkdocs/logic.md create mode 100644 docs/docforge/cli/mkdocs_utils.md delete mode 100644 mcp_docs/modules/docforge.cli.mcp.json rename mcp_docs/modules/{docforge.cli.mcp.logic.json => docforge.cli.mcp_utils.json} (84%) delete mode 100644 mcp_docs/modules/docforge.cli.mkdocs.json rename mcp_docs/modules/{docforge.cli.mkdocs.logic.json => docforge.cli.mkdocs_utils.json} (85%) diff --git a/docforge.nav.yml b/docforge.nav.yml index d83af04..9d484b5 100644 --- a/docforge.nav.yml +++ b/docforge.nav.yml @@ -22,7 +22,5 @@ groups: - docforge/cli/index.md - docforge/cli/main.md - docforge/cli/commands.md - - docforge/cli/mcp/index.md - - docforge/cli/mcp/logic.md - - docforge/cli/mkdocs/index.md - - docforge/cli/mkdocs/logic.md + - docforge/cli/mcp_utils.md + - docforge/cli/mkdocs_utils.md diff --git a/docs/docforge/cli/mcp/index.md b/docs/docforge/cli/mcp/index.md deleted file mode 100644 index 52ffe01..0000000 --- a/docs/docforge/cli/mcp/index.md +++ /dev/null @@ -1,3 +0,0 @@ -# Mcp - -::: docforge.cli.mcp diff --git a/docs/docforge/cli/mcp/logic.md b/docs/docforge/cli/mcp/logic.md deleted file mode 100644 index 92d9364..0000000 --- a/docs/docforge/cli/mcp/logic.md +++ /dev/null @@ -1,3 +0,0 @@ -# Logic - -::: docforge.cli.mcp.logic diff --git a/docs/docforge/cli/mcp_utils.md b/docs/docforge/cli/mcp_utils.md new file mode 100644 index 0000000..7987ffd --- /dev/null +++ b/docs/docforge/cli/mcp_utils.md @@ -0,0 +1,3 @@ +# Mcp Utils + +::: docforge.cli.mcp_utils diff --git a/docs/docforge/cli/mkdocs/index.md b/docs/docforge/cli/mkdocs/index.md deleted file mode 100644 index 217e141..0000000 --- a/docs/docforge/cli/mkdocs/index.md +++ /dev/null @@ -1,3 +0,0 @@ -# Mkdocs - -::: docforge.cli.mkdocs diff --git a/docs/docforge/cli/mkdocs/logic.md b/docs/docforge/cli/mkdocs/logic.md deleted file mode 100644 index 94909a7..0000000 --- a/docs/docforge/cli/mkdocs/logic.md +++ /dev/null @@ -1,3 +0,0 @@ -# Logic - -::: docforge.cli.mkdocs.logic diff --git a/docs/docforge/cli/mkdocs_utils.md b/docs/docforge/cli/mkdocs_utils.md new file mode 100644 index 0000000..2f2d3d9 --- /dev/null +++ b/docs/docforge/cli/mkdocs_utils.md @@ -0,0 +1,3 @@ +# Mkdocs Utils + +::: docforge.cli.mkdocs_utils diff --git a/mcp_docs/index.json b/mcp_docs/index.json index 6ce9145..22bf131 100644 --- a/mcp_docs/index.json +++ b/mcp_docs/index.json @@ -1,6 +1,6 @@ { "project": "docforge", "type": "docforge-model", - "modules_count": 24, + "modules_count": 22, "source": "docforge" } \ No newline at end of file diff --git a/mcp_docs/modules/docforge.cli.commands.json b/mcp_docs/modules/docforge.cli.commands.json index 701f8ad..3df039b 100644 --- a/mcp_docs/modules/docforge.cli.commands.json +++ b/mcp_docs/modules/docforge.cli.commands.json @@ -55,59 +55,59 @@ } } }, - "mkdocs_logic": { - "name": "mkdocs_logic", + "mkdocs_utils": { + "name": "mkdocs_utils", "kind": "module", - "path": "docforge.cli.commands.mkdocs_logic", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils", + "signature": "", "docstring": null, "members": { "Path": { "name": "Path", "kind": "alias", - "path": "docforge.cli.commands.mkdocs_logic.Path", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.Path", + "signature": "", "docstring": null }, "resources": { "name": "resources", "kind": "alias", - "path": "docforge.cli.commands.mkdocs_logic.resources", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.resources", + "signature": "", "docstring": null }, "click": { "name": "click", "kind": "alias", - "path": "docforge.cli.commands.mkdocs_logic.click", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.click", + "signature": "", "docstring": null }, "yaml": { "name": "yaml", "kind": "alias", - "path": "docforge.cli.commands.mkdocs_logic.yaml", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.yaml", + "signature": "", "docstring": null }, "GriffeLoader": { "name": "GriffeLoader", "kind": "class", - "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader", + "signature": "", "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", "members": { "load_project": { "name": "load_project", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader.load_project", + "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_project", "signature": "", "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." }, "load_module": { "name": "load_module", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader.load_module", + "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_module", "signature": "", "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." } @@ -116,28 +116,28 @@ "discover_module_paths": { "name": "discover_module_paths", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.discover_module_paths", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.discover_module_paths", + "signature": "", "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." }, "MkDocsRenderer": { "name": "MkDocsRenderer", "kind": "class", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer", + "signature": "", "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", "members": { "name": { "name": "name", "kind": "attribute", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.name", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.name", "signature": "", "docstring": null }, "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.generate_sources", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.generate_sources", "signature": "", "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." } @@ -146,28 +146,28 @@ "load_nav_spec": { "name": "load_nav_spec", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.load_nav_spec", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.load_nav_spec", + "signature": "", "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." }, "resolve_nav": { "name": "resolve_nav", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.resolve_nav", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.resolve_nav", + "signature": "", "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." }, "MkDocsNavEmitter": { "name": "MkDocsNavEmitter", "kind": "class", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsNavEmitter", + "signature": "", "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", "members": { "emit": { "name": "emit", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter.emit", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsNavEmitter.emit", "signature": "", "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." } @@ -176,72 +176,72 @@ "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.generate_sources", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.generate_sources", + "signature": "", "docstring": "Generate Markdown source files for the specified module." }, "generate_config": { "name": "generate_config", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.generate_config", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.generate_config", + "signature": "", "docstring": "Generate an mkdocs.yml configuration file." }, "build": { "name": "build", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.build", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.build", + "signature": "", "docstring": "Build the documentation site using MkDocs." }, "serve": { "name": "serve", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.serve", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.serve", + "signature": "", "docstring": "Serve the documentation site with live-reload using MkDocs." } } }, - "mcp_logic": { - "name": "mcp_logic", + "mcp_utils": { + "name": "mcp_utils", "kind": "module", - "path": "docforge.cli.commands.mcp_logic", - "signature": "", + "path": "docforge.cli.commands.mcp_utils", + "signature": "", "docstring": null, "members": { "Path": { "name": "Path", "kind": "alias", - "path": "docforge.cli.commands.mcp_logic.Path", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.Path", + "signature": "", "docstring": null }, "click": { "name": "click", "kind": "alias", - "path": "docforge.cli.commands.mcp_logic.click", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.click", + "signature": "", "docstring": null }, "GriffeLoader": { "name": "GriffeLoader", "kind": "class", - "path": "docforge.cli.commands.mcp_logic.GriffeLoader", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.GriffeLoader", + "signature": "", "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", "members": { "load_project": { "name": "load_project", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.GriffeLoader.load_project", + "path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_project", "signature": "", "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." }, "load_module": { "name": "load_module", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.GriffeLoader.load_module", + "path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_module", "signature": "", "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." } @@ -250,28 +250,28 @@ "discover_module_paths": { "name": "discover_module_paths", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.discover_module_paths", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.discover_module_paths", + "signature": "", "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." }, "MCPRenderer": { "name": "MCPRenderer", "kind": "class", - "path": "docforge.cli.commands.mcp_logic.MCPRenderer", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.MCPRenderer", + "signature": "", "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", "members": { "name": { "name": "name", "kind": "attribute", - "path": "docforge.cli.commands.mcp_logic.MCPRenderer.name", + "path": "docforge.cli.commands.mcp_utils.MCPRenderer.name", "signature": "", "docstring": null }, "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.MCPRenderer.generate_sources", + "path": "docforge.cli.commands.mcp_utils.MCPRenderer.generate_sources", "signature": "", "docstring": "Generate MCP-compatible JSON resources and navigation for the project." } @@ -280,28 +280,28 @@ "MCPServer": { "name": "MCPServer", "kind": "class", - "path": "docforge.cli.commands.mcp_logic.MCPServer", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.MCPServer", + "signature": "", "docstring": "MCP server for serving a pre-built MCP documentation bundle.", "members": { "mcp_root": { "name": "mcp_root", "kind": "attribute", - "path": "docforge.cli.commands.mcp_logic.MCPServer.mcp_root", + "path": "docforge.cli.commands.mcp_utils.MCPServer.mcp_root", "signature": "", "docstring": null }, "app": { "name": "app", "kind": "attribute", - "path": "docforge.cli.commands.mcp_logic.MCPServer.app", + "path": "docforge.cli.commands.mcp_utils.MCPServer.app", "signature": "", "docstring": null }, "run": { "name": "run", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.MCPServer.run", + "path": "docforge.cli.commands.mcp_utils.MCPServer.run", "signature": "", "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" } @@ -310,15 +310,15 @@ "generate_resources": { "name": "generate_resources", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.generate_resources", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.generate_resources", + "signature": "", "docstring": "Generate MCP-compatible documentation resources." }, "serve": { "name": "serve", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.serve", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.serve", + "signature": "", "docstring": "Serve MCP documentation." } } @@ -327,28 +327,28 @@ "name": "cli", "kind": "function", "path": "docforge.cli.commands.cli", - "signature": "", + "signature": "", "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." }, "build": { "name": "build", "kind": "function", "path": "docforge.cli.commands.build", - "signature": "", + "signature": "", "docstring": "Build documentation (MkDocs site or MCP resources)." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.commands.serve", - "signature": "", + "signature": "", "docstring": "Serve documentation." }, "tree": { "name": "tree", "kind": "function", "path": "docforge.cli.commands.tree", - "signature": "", + "signature": "", "docstring": "Visualize the project structure." } } diff --git a/mcp_docs/modules/docforge.cli.json b/mcp_docs/modules/docforge.cli.json index f51e344..4d22e94 100644 --- a/mcp_docs/modules/docforge.cli.json +++ b/mcp_docs/modules/docforge.cli.json @@ -85,59 +85,59 @@ } } }, - "mkdocs_logic": { - "name": "mkdocs_logic", + "mkdocs_utils": { + "name": "mkdocs_utils", "kind": "module", - "path": "docforge.cli.commands.mkdocs_logic", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils", + "signature": "", "docstring": null, "members": { "Path": { "name": "Path", "kind": "alias", - "path": "docforge.cli.commands.mkdocs_logic.Path", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.Path", + "signature": "", "docstring": null }, "resources": { "name": "resources", "kind": "alias", - "path": "docforge.cli.commands.mkdocs_logic.resources", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.resources", + "signature": "", "docstring": null }, "click": { "name": "click", "kind": "alias", - "path": "docforge.cli.commands.mkdocs_logic.click", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.click", + "signature": "", "docstring": null }, "yaml": { "name": "yaml", "kind": "alias", - "path": "docforge.cli.commands.mkdocs_logic.yaml", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.yaml", + "signature": "", "docstring": null }, "GriffeLoader": { "name": "GriffeLoader", "kind": "class", - "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader", + "signature": "", "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", "members": { "load_project": { "name": "load_project", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader.load_project", + "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_project", "signature": "", "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." }, "load_module": { "name": "load_module", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader.load_module", + "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_module", "signature": "", "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." } @@ -146,28 +146,28 @@ "discover_module_paths": { "name": "discover_module_paths", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.discover_module_paths", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.discover_module_paths", + "signature": "", "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." }, "MkDocsRenderer": { "name": "MkDocsRenderer", "kind": "class", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer", + "signature": "", "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", "members": { "name": { "name": "name", "kind": "attribute", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.name", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.name", "signature": "", "docstring": null }, "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.generate_sources", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.generate_sources", "signature": "", "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." } @@ -176,28 +176,28 @@ "load_nav_spec": { "name": "load_nav_spec", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.load_nav_spec", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.load_nav_spec", + "signature": "", "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." }, "resolve_nav": { "name": "resolve_nav", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.resolve_nav", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.resolve_nav", + "signature": "", "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." }, "MkDocsNavEmitter": { "name": "MkDocsNavEmitter", "kind": "class", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsNavEmitter", + "signature": "", "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", "members": { "emit": { "name": "emit", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter.emit", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsNavEmitter.emit", "signature": "", "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." } @@ -206,72 +206,72 @@ "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.generate_sources", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.generate_sources", + "signature": "", "docstring": "Generate Markdown source files for the specified module." }, "generate_config": { "name": "generate_config", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.generate_config", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.generate_config", + "signature": "", "docstring": "Generate an mkdocs.yml configuration file." }, "build": { "name": "build", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.build", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.build", + "signature": "", "docstring": "Build the documentation site using MkDocs." }, "serve": { "name": "serve", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.serve", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.serve", + "signature": "", "docstring": "Serve the documentation site with live-reload using MkDocs." } } }, - "mcp_logic": { - "name": "mcp_logic", + "mcp_utils": { + "name": "mcp_utils", "kind": "module", - "path": "docforge.cli.commands.mcp_logic", - "signature": "", + "path": "docforge.cli.commands.mcp_utils", + "signature": "", "docstring": null, "members": { "Path": { "name": "Path", "kind": "alias", - "path": "docforge.cli.commands.mcp_logic.Path", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.Path", + "signature": "", "docstring": null }, "click": { "name": "click", "kind": "alias", - "path": "docforge.cli.commands.mcp_logic.click", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.click", + "signature": "", "docstring": null }, "GriffeLoader": { "name": "GriffeLoader", "kind": "class", - "path": "docforge.cli.commands.mcp_logic.GriffeLoader", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.GriffeLoader", + "signature": "", "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", "members": { "load_project": { "name": "load_project", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.GriffeLoader.load_project", + "path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_project", "signature": "", "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." }, "load_module": { "name": "load_module", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.GriffeLoader.load_module", + "path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_module", "signature": "", "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." } @@ -280,28 +280,28 @@ "discover_module_paths": { "name": "discover_module_paths", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.discover_module_paths", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.discover_module_paths", + "signature": "", "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." }, "MCPRenderer": { "name": "MCPRenderer", "kind": "class", - "path": "docforge.cli.commands.mcp_logic.MCPRenderer", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.MCPRenderer", + "signature": "", "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", "members": { "name": { "name": "name", "kind": "attribute", - "path": "docforge.cli.commands.mcp_logic.MCPRenderer.name", + "path": "docforge.cli.commands.mcp_utils.MCPRenderer.name", "signature": "", "docstring": null }, "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.MCPRenderer.generate_sources", + "path": "docforge.cli.commands.mcp_utils.MCPRenderer.generate_sources", "signature": "", "docstring": "Generate MCP-compatible JSON resources and navigation for the project." } @@ -310,28 +310,28 @@ "MCPServer": { "name": "MCPServer", "kind": "class", - "path": "docforge.cli.commands.mcp_logic.MCPServer", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.MCPServer", + "signature": "", "docstring": "MCP server for serving a pre-built MCP documentation bundle.", "members": { "mcp_root": { "name": "mcp_root", "kind": "attribute", - "path": "docforge.cli.commands.mcp_logic.MCPServer.mcp_root", + "path": "docforge.cli.commands.mcp_utils.MCPServer.mcp_root", "signature": "", "docstring": null }, "app": { "name": "app", "kind": "attribute", - "path": "docforge.cli.commands.mcp_logic.MCPServer.app", + "path": "docforge.cli.commands.mcp_utils.MCPServer.app", "signature": "", "docstring": null }, "run": { "name": "run", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.MCPServer.run", + "path": "docforge.cli.commands.mcp_utils.MCPServer.run", "signature": "", "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" } @@ -340,15 +340,15 @@ "generate_resources": { "name": "generate_resources", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.generate_resources", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.generate_resources", + "signature": "", "docstring": "Generate MCP-compatible documentation resources." }, "serve": { "name": "serve", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.serve", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.serve", + "signature": "", "docstring": "Serve MCP documentation." } } @@ -357,315 +357,297 @@ "name": "cli", "kind": "function", "path": "docforge.cli.commands.cli", - "signature": "", + "signature": "", "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." }, "build": { "name": "build", "kind": "function", "path": "docforge.cli.commands.build", - "signature": "", + "signature": "", "docstring": "Build documentation (MkDocs site or MCP resources)." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.commands.serve", - "signature": "", + "signature": "", "docstring": "Serve documentation." }, "tree": { "name": "tree", "kind": "function", "path": "docforge.cli.commands.tree", - "signature": "", + "signature": "", "docstring": "Visualize the project structure." } } }, - "mcp": { - "name": "mcp", + "mcp_utils": { + "name": "mcp_utils", "kind": "module", - "path": "docforge.cli.mcp", + "path": "docforge.cli.mcp_utils", "signature": null, "docstring": null, "members": { - "logic": { - "name": "logic", - "kind": "module", - "path": "docforge.cli.mcp.logic", - "signature": null, - "docstring": null, + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.mcp_utils.Path", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.mcp_utils.click", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.mcp_utils.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", "members": { - "Path": { - "name": "Path", - "kind": "alias", - "path": "docforge.cli.mcp.logic.Path", - "signature": "", - "docstring": null - }, - "click": { - "name": "click", - "kind": "alias", - "path": "docforge.cli.mcp.logic.click", - "signature": "", - "docstring": null - }, - "GriffeLoader": { - "name": "GriffeLoader", - "kind": "class", - "path": "docforge.cli.mcp.logic.GriffeLoader", - "signature": "", - "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", - "members": { - "load_project": { - "name": "load_project", - "kind": "function", - "path": "docforge.cli.mcp.logic.GriffeLoader.load_project", - "signature": "", - "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." - }, - "load_module": { - "name": "load_module", - "kind": "function", - "path": "docforge.cli.mcp.logic.GriffeLoader.load_module", - "signature": "", - "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." - } - } - }, - "discover_module_paths": { - "name": "discover_module_paths", + "load_project": { + "name": "load_project", "kind": "function", - "path": "docforge.cli.mcp.logic.discover_module_paths", - "signature": "", - "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + "path": "docforge.cli.mcp_utils.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." }, - "MCPRenderer": { - "name": "MCPRenderer", - "kind": "class", - "path": "docforge.cli.mcp.logic.MCPRenderer", - "signature": "", - "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", - "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "docforge.cli.mcp.logic.MCPRenderer.name", - "signature": "", - "docstring": null - }, - "generate_sources": { - "name": "generate_sources", - "kind": "function", - "path": "docforge.cli.mcp.logic.MCPRenderer.generate_sources", - "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." - } - } - }, - "MCPServer": { - "name": "MCPServer", - "kind": "class", - "path": "docforge.cli.mcp.logic.MCPServer", - "signature": "", - "docstring": "MCP server for serving a pre-built MCP documentation bundle.", - "members": { - "mcp_root": { - "name": "mcp_root", - "kind": "attribute", - "path": "docforge.cli.mcp.logic.MCPServer.mcp_root", - "signature": "", - "docstring": null - }, - "app": { - "name": "app", - "kind": "attribute", - "path": "docforge.cli.mcp.logic.MCPServer.app", - "signature": "", - "docstring": null - }, - "run": { - "name": "run", - "kind": "function", - "path": "docforge.cli.mcp.logic.MCPServer.run", - "signature": "", - "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" - } - } - }, - "generate_resources": { - "name": "generate_resources", + "load_module": { + "name": "load_module", "kind": "function", - "path": "docforge.cli.mcp.logic.generate_resources", - "signature": "", - "docstring": "Generate MCP-compatible documentation resources." - }, - "serve": { - "name": "serve", - "kind": "function", - "path": "docforge.cli.mcp.logic.serve", - "signature": "", - "docstring": "Serve MCP documentation." + "path": "docforge.cli.mcp_utils.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." } } - } - } - }, - "mkdocs": { - "name": "mkdocs", - "kind": "module", - "path": "docforge.cli.mkdocs", - "signature": null, - "docstring": null, - "members": { - "logic": { - "name": "logic", - "kind": "module", - "path": "docforge.cli.mkdocs.logic", - "signature": null, - "docstring": null, + }, + "discover_module_paths": { + "name": "discover_module_paths", + "kind": "function", + "path": "docforge.cli.mcp_utils.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MCPRenderer": { + "name": "MCPRenderer", + "kind": "class", + "path": "docforge.cli.mcp_utils.MCPRenderer", + "signature": "", + "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", "members": { - "Path": { - "name": "Path", - "kind": "alias", - "path": "docforge.cli.mkdocs.logic.Path", - "signature": "", + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.mcp_utils.MCPRenderer.name", + "signature": "", "docstring": null }, - "resources": { - "name": "resources", - "kind": "alias", - "path": "docforge.cli.mkdocs.logic.resources", - "signature": "", - "docstring": null - }, - "click": { - "name": "click", - "kind": "alias", - "path": "docforge.cli.mkdocs.logic.click", - "signature": "", - "docstring": null - }, - "yaml": { - "name": "yaml", - "kind": "alias", - "path": "docforge.cli.mkdocs.logic.yaml", - "signature": "", - "docstring": null - }, - "GriffeLoader": { - "name": "GriffeLoader", - "kind": "class", - "path": "docforge.cli.mkdocs.logic.GriffeLoader", - "signature": "", - "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", - "members": { - "load_project": { - "name": "load_project", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_project", - "signature": "", - "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." - }, - "load_module": { - "name": "load_module", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_module", - "signature": "", - "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." - } - } - }, - "discover_module_paths": { - "name": "discover_module_paths", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.discover_module_paths", - "signature": "", - "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." - }, - "MkDocsRenderer": { - "name": "MkDocsRenderer", - "kind": "class", - "path": "docforge.cli.mkdocs.logic.MkDocsRenderer", - "signature": "", - "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", - "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.name", - "signature": "", - "docstring": null - }, - "generate_sources": { - "name": "generate_sources", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.generate_sources", - "signature": "", - "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." - } - } - }, - "load_nav_spec": { - "name": "load_nav_spec", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.load_nav_spec", - "signature": "", - "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." - }, - "resolve_nav": { - "name": "resolve_nav", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.resolve_nav", - "signature": "", - "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." - }, - "MkDocsNavEmitter": { - "name": "MkDocsNavEmitter", - "kind": "class", - "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter", - "signature": "", - "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", - "members": { - "emit": { - "name": "emit", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter.emit", - "signature": "", - "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." - } - } - }, "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.mkdocs.logic.generate_sources", - "signature": "", - "docstring": "Generate Markdown source files for the specified module." - }, - "generate_config": { - "name": "generate_config", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.generate_config", - "signature": "", - "docstring": "Generate an mkdocs.yml configuration file." - }, - "build": { - "name": "build", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.build", - "signature": "", - "docstring": "Build the documentation site using MkDocs." - }, - "serve": { - "name": "serve", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.serve", - "signature": "", - "docstring": "Serve the documentation site with live-reload using MkDocs." + "path": "docforge.cli.mcp_utils.MCPRenderer.generate_sources", + "signature": "", + "docstring": "Generate MCP-compatible JSON resources and navigation for the project." } } + }, + "MCPServer": { + "name": "MCPServer", + "kind": "class", + "path": "docforge.cli.mcp_utils.MCPServer", + "signature": "", + "docstring": "MCP server for serving a pre-built MCP documentation bundle.", + "members": { + "mcp_root": { + "name": "mcp_root", + "kind": "attribute", + "path": "docforge.cli.mcp_utils.MCPServer.mcp_root", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "docforge.cli.mcp_utils.MCPServer.app", + "signature": "", + "docstring": null + }, + "run": { + "name": "run", + "kind": "function", + "path": "docforge.cli.mcp_utils.MCPServer.run", + "signature": "", + "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" + } + } + }, + "generate_resources": { + "name": "generate_resources", + "kind": "function", + "path": "docforge.cli.mcp_utils.generate_resources", + "signature": "", + "docstring": "Generate MCP-compatible documentation resources." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.mcp_utils.serve", + "signature": "", + "docstring": "Serve MCP documentation." + } + } + }, + "mkdocs_utils": { + "name": "mkdocs_utils", + "kind": "module", + "path": "docforge.cli.mkdocs_utils", + "signature": null, + "docstring": null, + "members": { + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.mkdocs_utils.Path", + "signature": "", + "docstring": null + }, + "resources": { + "name": "resources", + "kind": "alias", + "path": "docforge.cli.mkdocs_utils.resources", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.mkdocs_utils.click", + "signature": "", + "docstring": null + }, + "yaml": { + "name": "yaml", + "kind": "alias", + "path": "docforge.cli.mkdocs_utils.yaml", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.mkdocs_utils.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MkDocsRenderer": { + "name": "MkDocsRenderer", + "kind": "class", + "path": "docforge.cli.mkdocs_utils.MkDocsRenderer", + "signature": "", + "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.mkdocs_utils.MkDocsRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_sources", + "signature": "", + "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." + } + } + }, + "load_nav_spec": { + "name": "load_nav_spec", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.load_nav_spec", + "signature": "", + "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." + }, + "resolve_nav": { + "name": "resolve_nav", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.resolve_nav", + "signature": "", + "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." + }, + "MkDocsNavEmitter": { + "name": "MkDocsNavEmitter", + "kind": "class", + "path": "docforge.cli.mkdocs_utils.MkDocsNavEmitter", + "signature": "", + "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", + "members": { + "emit": { + "name": "emit", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.MkDocsNavEmitter.emit", + "signature": "", + "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." + } + } + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.generate_sources", + "signature": "", + "docstring": "Generate Markdown source files for the specified module." + }, + "generate_config": { + "name": "generate_config", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.generate_config", + "signature": "", + "docstring": "Generate an mkdocs.yml configuration file." + }, + "build": { + "name": "build", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.build", + "signature": "", + "docstring": "Build the documentation site using MkDocs." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.serve", + "signature": "", + "docstring": "Serve the documentation site with live-reload using MkDocs." } } } diff --git a/mcp_docs/modules/docforge.cli.mcp.json b/mcp_docs/modules/docforge.cli.mcp.json deleted file mode 100644 index abc1b8e..0000000 --- a/mcp_docs/modules/docforge.cli.mcp.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "module": "docforge.cli.mcp", - "content": { - "path": "docforge.cli.mcp", - "docstring": null, - "objects": { - "logic": { - "name": "logic", - "kind": "module", - "path": "docforge.cli.mcp.logic", - "signature": null, - "docstring": null, - "members": { - "Path": { - "name": "Path", - "kind": "alias", - "path": "docforge.cli.mcp.logic.Path", - "signature": "", - "docstring": null - }, - "click": { - "name": "click", - "kind": "alias", - "path": "docforge.cli.mcp.logic.click", - "signature": "", - "docstring": null - }, - "GriffeLoader": { - "name": "GriffeLoader", - "kind": "class", - "path": "docforge.cli.mcp.logic.GriffeLoader", - "signature": "", - "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", - "members": { - "load_project": { - "name": "load_project", - "kind": "function", - "path": "docforge.cli.mcp.logic.GriffeLoader.load_project", - "signature": "", - "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." - }, - "load_module": { - "name": "load_module", - "kind": "function", - "path": "docforge.cli.mcp.logic.GriffeLoader.load_module", - "signature": "", - "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." - } - } - }, - "discover_module_paths": { - "name": "discover_module_paths", - "kind": "function", - "path": "docforge.cli.mcp.logic.discover_module_paths", - "signature": "", - "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." - }, - "MCPRenderer": { - "name": "MCPRenderer", - "kind": "class", - "path": "docforge.cli.mcp.logic.MCPRenderer", - "signature": "", - "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", - "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "docforge.cli.mcp.logic.MCPRenderer.name", - "signature": "", - "docstring": null - }, - "generate_sources": { - "name": "generate_sources", - "kind": "function", - "path": "docforge.cli.mcp.logic.MCPRenderer.generate_sources", - "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." - } - } - }, - "MCPServer": { - "name": "MCPServer", - "kind": "class", - "path": "docforge.cli.mcp.logic.MCPServer", - "signature": "", - "docstring": "MCP server for serving a pre-built MCP documentation bundle.", - "members": { - "mcp_root": { - "name": "mcp_root", - "kind": "attribute", - "path": "docforge.cli.mcp.logic.MCPServer.mcp_root", - "signature": "", - "docstring": null - }, - "app": { - "name": "app", - "kind": "attribute", - "path": "docforge.cli.mcp.logic.MCPServer.app", - "signature": "", - "docstring": null - }, - "run": { - "name": "run", - "kind": "function", - "path": "docforge.cli.mcp.logic.MCPServer.run", - "signature": "", - "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" - } - } - }, - "generate_resources": { - "name": "generate_resources", - "kind": "function", - "path": "docforge.cli.mcp.logic.generate_resources", - "signature": "", - "docstring": "Generate MCP-compatible documentation resources." - }, - "serve": { - "name": "serve", - "kind": "function", - "path": "docforge.cli.mcp.logic.serve", - "signature": "", - "docstring": "Serve MCP documentation." - } - } - } - } - } -} \ No newline at end of file diff --git a/mcp_docs/modules/docforge.cli.mcp.logic.json b/mcp_docs/modules/docforge.cli.mcp_utils.json similarity index 84% rename from mcp_docs/modules/docforge.cli.mcp.logic.json rename to mcp_docs/modules/docforge.cli.mcp_utils.json index 94f4006..b1cd895 100644 --- a/mcp_docs/modules/docforge.cli.mcp.logic.json +++ b/mcp_docs/modules/docforge.cli.mcp_utils.json @@ -1,41 +1,41 @@ { - "module": "docforge.cli.mcp.logic", + "module": "docforge.cli.mcp_utils", "content": { - "path": "docforge.cli.mcp.logic", + "path": "docforge.cli.mcp_utils", "docstring": null, "objects": { "Path": { "name": "Path", "kind": "alias", - "path": "docforge.cli.mcp.logic.Path", + "path": "docforge.cli.mcp_utils.Path", "signature": "", "docstring": null }, "click": { "name": "click", "kind": "alias", - "path": "docforge.cli.mcp.logic.click", + "path": "docforge.cli.mcp_utils.click", "signature": "", "docstring": null }, "GriffeLoader": { "name": "GriffeLoader", "kind": "class", - "path": "docforge.cli.mcp.logic.GriffeLoader", + "path": "docforge.cli.mcp_utils.GriffeLoader", "signature": "", "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", "members": { "load_project": { "name": "load_project", "kind": "function", - "path": "docforge.cli.mcp.logic.GriffeLoader.load_project", + "path": "docforge.cli.mcp_utils.GriffeLoader.load_project", "signature": "", "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." }, "load_module": { "name": "load_module", "kind": "function", - "path": "docforge.cli.mcp.logic.GriffeLoader.load_module", + "path": "docforge.cli.mcp_utils.GriffeLoader.load_module", "signature": "", "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." } @@ -44,28 +44,28 @@ "discover_module_paths": { "name": "discover_module_paths", "kind": "function", - "path": "docforge.cli.mcp.logic.discover_module_paths", + "path": "docforge.cli.mcp_utils.discover_module_paths", "signature": "", "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." }, "MCPRenderer": { "name": "MCPRenderer", "kind": "class", - "path": "docforge.cli.mcp.logic.MCPRenderer", + "path": "docforge.cli.mcp_utils.MCPRenderer", "signature": "", "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", "members": { "name": { "name": "name", "kind": "attribute", - "path": "docforge.cli.mcp.logic.MCPRenderer.name", + "path": "docforge.cli.mcp_utils.MCPRenderer.name", "signature": "", "docstring": null }, "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.mcp.logic.MCPRenderer.generate_sources", + "path": "docforge.cli.mcp_utils.MCPRenderer.generate_sources", "signature": "", "docstring": "Generate MCP-compatible JSON resources and navigation for the project." } @@ -74,28 +74,28 @@ "MCPServer": { "name": "MCPServer", "kind": "class", - "path": "docforge.cli.mcp.logic.MCPServer", + "path": "docforge.cli.mcp_utils.MCPServer", "signature": "", "docstring": "MCP server for serving a pre-built MCP documentation bundle.", "members": { "mcp_root": { "name": "mcp_root", "kind": "attribute", - "path": "docforge.cli.mcp.logic.MCPServer.mcp_root", + "path": "docforge.cli.mcp_utils.MCPServer.mcp_root", "signature": "", "docstring": null }, "app": { "name": "app", "kind": "attribute", - "path": "docforge.cli.mcp.logic.MCPServer.app", + "path": "docforge.cli.mcp_utils.MCPServer.app", "signature": "", "docstring": null }, "run": { "name": "run", "kind": "function", - "path": "docforge.cli.mcp.logic.MCPServer.run", + "path": "docforge.cli.mcp_utils.MCPServer.run", "signature": "", "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" } @@ -104,14 +104,14 @@ "generate_resources": { "name": "generate_resources", "kind": "function", - "path": "docforge.cli.mcp.logic.generate_resources", + "path": "docforge.cli.mcp_utils.generate_resources", "signature": "", "docstring": "Generate MCP-compatible documentation resources." }, "serve": { "name": "serve", "kind": "function", - "path": "docforge.cli.mcp.logic.serve", + "path": "docforge.cli.mcp_utils.serve", "signature": "", "docstring": "Serve MCP documentation." } diff --git a/mcp_docs/modules/docforge.cli.mkdocs.json b/mcp_docs/modules/docforge.cli.mkdocs.json deleted file mode 100644 index 266b836..0000000 --- a/mcp_docs/modules/docforge.cli.mkdocs.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "module": "docforge.cli.mkdocs", - "content": { - "path": "docforge.cli.mkdocs", - "docstring": null, - "objects": { - "logic": { - "name": "logic", - "kind": "module", - "path": "docforge.cli.mkdocs.logic", - "signature": null, - "docstring": null, - "members": { - "Path": { - "name": "Path", - "kind": "alias", - "path": "docforge.cli.mkdocs.logic.Path", - "signature": "", - "docstring": null - }, - "resources": { - "name": "resources", - "kind": "alias", - "path": "docforge.cli.mkdocs.logic.resources", - "signature": "", - "docstring": null - }, - "click": { - "name": "click", - "kind": "alias", - "path": "docforge.cli.mkdocs.logic.click", - "signature": "", - "docstring": null - }, - "yaml": { - "name": "yaml", - "kind": "alias", - "path": "docforge.cli.mkdocs.logic.yaml", - "signature": "", - "docstring": null - }, - "GriffeLoader": { - "name": "GriffeLoader", - "kind": "class", - "path": "docforge.cli.mkdocs.logic.GriffeLoader", - "signature": "", - "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", - "members": { - "load_project": { - "name": "load_project", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_project", - "signature": "", - "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." - }, - "load_module": { - "name": "load_module", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_module", - "signature": "", - "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." - } - } - }, - "discover_module_paths": { - "name": "discover_module_paths", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.discover_module_paths", - "signature": "", - "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." - }, - "MkDocsRenderer": { - "name": "MkDocsRenderer", - "kind": "class", - "path": "docforge.cli.mkdocs.logic.MkDocsRenderer", - "signature": "", - "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", - "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.name", - "signature": "", - "docstring": null - }, - "generate_sources": { - "name": "generate_sources", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.generate_sources", - "signature": "", - "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." - } - } - }, - "load_nav_spec": { - "name": "load_nav_spec", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.load_nav_spec", - "signature": "", - "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." - }, - "resolve_nav": { - "name": "resolve_nav", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.resolve_nav", - "signature": "", - "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." - }, - "MkDocsNavEmitter": { - "name": "MkDocsNavEmitter", - "kind": "class", - "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter", - "signature": "", - "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", - "members": { - "emit": { - "name": "emit", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter.emit", - "signature": "", - "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." - } - } - }, - "generate_sources": { - "name": "generate_sources", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.generate_sources", - "signature": "", - "docstring": "Generate Markdown source files for the specified module." - }, - "generate_config": { - "name": "generate_config", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.generate_config", - "signature": "", - "docstring": "Generate an mkdocs.yml configuration file." - }, - "build": { - "name": "build", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.build", - "signature": "", - "docstring": "Build the documentation site using MkDocs." - }, - "serve": { - "name": "serve", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.serve", - "signature": "", - "docstring": "Serve the documentation site with live-reload using MkDocs." - } - } - } - } - } -} \ No newline at end of file diff --git a/mcp_docs/modules/docforge.cli.mkdocs.logic.json b/mcp_docs/modules/docforge.cli.mkdocs_utils.json similarity index 85% rename from mcp_docs/modules/docforge.cli.mkdocs.logic.json rename to mcp_docs/modules/docforge.cli.mkdocs_utils.json index e40f422..88d3888 100644 --- a/mcp_docs/modules/docforge.cli.mkdocs.logic.json +++ b/mcp_docs/modules/docforge.cli.mkdocs_utils.json @@ -1,55 +1,55 @@ { - "module": "docforge.cli.mkdocs.logic", + "module": "docforge.cli.mkdocs_utils", "content": { - "path": "docforge.cli.mkdocs.logic", + "path": "docforge.cli.mkdocs_utils", "docstring": null, "objects": { "Path": { "name": "Path", "kind": "alias", - "path": "docforge.cli.mkdocs.logic.Path", + "path": "docforge.cli.mkdocs_utils.Path", "signature": "", "docstring": null }, "resources": { "name": "resources", "kind": "alias", - "path": "docforge.cli.mkdocs.logic.resources", + "path": "docforge.cli.mkdocs_utils.resources", "signature": "", "docstring": null }, "click": { "name": "click", "kind": "alias", - "path": "docforge.cli.mkdocs.logic.click", + "path": "docforge.cli.mkdocs_utils.click", "signature": "", "docstring": null }, "yaml": { "name": "yaml", "kind": "alias", - "path": "docforge.cli.mkdocs.logic.yaml", + "path": "docforge.cli.mkdocs_utils.yaml", "signature": "", "docstring": null }, "GriffeLoader": { "name": "GriffeLoader", "kind": "class", - "path": "docforge.cli.mkdocs.logic.GriffeLoader", + "path": "docforge.cli.mkdocs_utils.GriffeLoader", "signature": "", "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", "members": { "load_project": { "name": "load_project", "kind": "function", - "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_project", + "path": "docforge.cli.mkdocs_utils.GriffeLoader.load_project", "signature": "", "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." }, "load_module": { "name": "load_module", "kind": "function", - "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_module", + "path": "docforge.cli.mkdocs_utils.GriffeLoader.load_module", "signature": "", "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." } @@ -58,28 +58,28 @@ "discover_module_paths": { "name": "discover_module_paths", "kind": "function", - "path": "docforge.cli.mkdocs.logic.discover_module_paths", + "path": "docforge.cli.mkdocs_utils.discover_module_paths", "signature": "", "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." }, "MkDocsRenderer": { "name": "MkDocsRenderer", "kind": "class", - "path": "docforge.cli.mkdocs.logic.MkDocsRenderer", + "path": "docforge.cli.mkdocs_utils.MkDocsRenderer", "signature": "", "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", "members": { "name": { "name": "name", "kind": "attribute", - "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.name", + "path": "docforge.cli.mkdocs_utils.MkDocsRenderer.name", "signature": "", "docstring": null }, "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.generate_sources", + "path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_sources", "signature": "", "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." } @@ -88,28 +88,28 @@ "load_nav_spec": { "name": "load_nav_spec", "kind": "function", - "path": "docforge.cli.mkdocs.logic.load_nav_spec", + "path": "docforge.cli.mkdocs_utils.load_nav_spec", "signature": "", "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." }, "resolve_nav": { "name": "resolve_nav", "kind": "function", - "path": "docforge.cli.mkdocs.logic.resolve_nav", + "path": "docforge.cli.mkdocs_utils.resolve_nav", "signature": "", "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." }, "MkDocsNavEmitter": { "name": "MkDocsNavEmitter", "kind": "class", - "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter", + "path": "docforge.cli.mkdocs_utils.MkDocsNavEmitter", "signature": "", "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", "members": { "emit": { "name": "emit", "kind": "function", - "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter.emit", + "path": "docforge.cli.mkdocs_utils.MkDocsNavEmitter.emit", "signature": "", "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." } @@ -118,28 +118,28 @@ "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.mkdocs.logic.generate_sources", + "path": "docforge.cli.mkdocs_utils.generate_sources", "signature": "", "docstring": "Generate Markdown source files for the specified module." }, "generate_config": { "name": "generate_config", "kind": "function", - "path": "docforge.cli.mkdocs.logic.generate_config", + "path": "docforge.cli.mkdocs_utils.generate_config", "signature": "", "docstring": "Generate an mkdocs.yml configuration file." }, "build": { "name": "build", "kind": "function", - "path": "docforge.cli.mkdocs.logic.build", + "path": "docforge.cli.mkdocs_utils.build", "signature": "", "docstring": "Build the documentation site using MkDocs." }, "serve": { "name": "serve", "kind": "function", - "path": "docforge.cli.mkdocs.logic.serve", + "path": "docforge.cli.mkdocs_utils.serve", "signature": "", "docstring": "Serve the documentation site with live-reload using MkDocs." } diff --git a/mcp_docs/modules/docforge.json b/mcp_docs/modules/docforge.json index f166173..6d9ff5d 100644 --- a/mcp_docs/modules/docforge.json +++ b/mcp_docs/modules/docforge.json @@ -191,59 +191,59 @@ } } }, - "mkdocs_logic": { - "name": "mkdocs_logic", + "mkdocs_utils": { + "name": "mkdocs_utils", "kind": "module", - "path": "docforge.cli.commands.mkdocs_logic", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils", + "signature": "", "docstring": null, "members": { "Path": { "name": "Path", "kind": "alias", - "path": "docforge.cli.commands.mkdocs_logic.Path", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.Path", + "signature": "", "docstring": null }, "resources": { "name": "resources", "kind": "alias", - "path": "docforge.cli.commands.mkdocs_logic.resources", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.resources", + "signature": "", "docstring": null }, "click": { "name": "click", "kind": "alias", - "path": "docforge.cli.commands.mkdocs_logic.click", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.click", + "signature": "", "docstring": null }, "yaml": { "name": "yaml", "kind": "alias", - "path": "docforge.cli.commands.mkdocs_logic.yaml", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.yaml", + "signature": "", "docstring": null }, "GriffeLoader": { "name": "GriffeLoader", "kind": "class", - "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader", + "signature": "", "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", "members": { "load_project": { "name": "load_project", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader.load_project", + "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_project", "signature": "", "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." }, "load_module": { "name": "load_module", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader.load_module", + "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_module", "signature": "", "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." } @@ -252,28 +252,28 @@ "discover_module_paths": { "name": "discover_module_paths", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.discover_module_paths", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.discover_module_paths", + "signature": "", "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." }, "MkDocsRenderer": { "name": "MkDocsRenderer", "kind": "class", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer", + "signature": "", "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", "members": { "name": { "name": "name", "kind": "attribute", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.name", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.name", "signature": "", "docstring": null }, "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.generate_sources", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.generate_sources", "signature": "", "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." } @@ -282,28 +282,28 @@ "load_nav_spec": { "name": "load_nav_spec", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.load_nav_spec", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.load_nav_spec", + "signature": "", "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." }, "resolve_nav": { "name": "resolve_nav", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.resolve_nav", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.resolve_nav", + "signature": "", "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." }, "MkDocsNavEmitter": { "name": "MkDocsNavEmitter", "kind": "class", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsNavEmitter", + "signature": "", "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", "members": { "emit": { "name": "emit", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter.emit", + "path": "docforge.cli.commands.mkdocs_utils.MkDocsNavEmitter.emit", "signature": "", "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." } @@ -312,72 +312,72 @@ "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.generate_sources", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.generate_sources", + "signature": "", "docstring": "Generate Markdown source files for the specified module." }, "generate_config": { "name": "generate_config", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.generate_config", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.generate_config", + "signature": "", "docstring": "Generate an mkdocs.yml configuration file." }, "build": { "name": "build", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.build", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.build", + "signature": "", "docstring": "Build the documentation site using MkDocs." }, "serve": { "name": "serve", "kind": "function", - "path": "docforge.cli.commands.mkdocs_logic.serve", - "signature": "", + "path": "docforge.cli.commands.mkdocs_utils.serve", + "signature": "", "docstring": "Serve the documentation site with live-reload using MkDocs." } } }, - "mcp_logic": { - "name": "mcp_logic", + "mcp_utils": { + "name": "mcp_utils", "kind": "module", - "path": "docforge.cli.commands.mcp_logic", - "signature": "", + "path": "docforge.cli.commands.mcp_utils", + "signature": "", "docstring": null, "members": { "Path": { "name": "Path", "kind": "alias", - "path": "docforge.cli.commands.mcp_logic.Path", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.Path", + "signature": "", "docstring": null }, "click": { "name": "click", "kind": "alias", - "path": "docforge.cli.commands.mcp_logic.click", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.click", + "signature": "", "docstring": null }, "GriffeLoader": { "name": "GriffeLoader", "kind": "class", - "path": "docforge.cli.commands.mcp_logic.GriffeLoader", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.GriffeLoader", + "signature": "", "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", "members": { "load_project": { "name": "load_project", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.GriffeLoader.load_project", + "path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_project", "signature": "", "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." }, "load_module": { "name": "load_module", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.GriffeLoader.load_module", + "path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_module", "signature": "", "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." } @@ -386,28 +386,28 @@ "discover_module_paths": { "name": "discover_module_paths", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.discover_module_paths", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.discover_module_paths", + "signature": "", "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." }, "MCPRenderer": { "name": "MCPRenderer", "kind": "class", - "path": "docforge.cli.commands.mcp_logic.MCPRenderer", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.MCPRenderer", + "signature": "", "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", "members": { "name": { "name": "name", "kind": "attribute", - "path": "docforge.cli.commands.mcp_logic.MCPRenderer.name", + "path": "docforge.cli.commands.mcp_utils.MCPRenderer.name", "signature": "", "docstring": null }, "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.MCPRenderer.generate_sources", + "path": "docforge.cli.commands.mcp_utils.MCPRenderer.generate_sources", "signature": "", "docstring": "Generate MCP-compatible JSON resources and navigation for the project." } @@ -416,28 +416,28 @@ "MCPServer": { "name": "MCPServer", "kind": "class", - "path": "docforge.cli.commands.mcp_logic.MCPServer", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.MCPServer", + "signature": "", "docstring": "MCP server for serving a pre-built MCP documentation bundle.", "members": { "mcp_root": { "name": "mcp_root", "kind": "attribute", - "path": "docforge.cli.commands.mcp_logic.MCPServer.mcp_root", + "path": "docforge.cli.commands.mcp_utils.MCPServer.mcp_root", "signature": "", "docstring": null }, "app": { "name": "app", "kind": "attribute", - "path": "docforge.cli.commands.mcp_logic.MCPServer.app", + "path": "docforge.cli.commands.mcp_utils.MCPServer.app", "signature": "", "docstring": null }, "run": { "name": "run", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.MCPServer.run", + "path": "docforge.cli.commands.mcp_utils.MCPServer.run", "signature": "", "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" } @@ -446,15 +446,15 @@ "generate_resources": { "name": "generate_resources", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.generate_resources", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.generate_resources", + "signature": "", "docstring": "Generate MCP-compatible documentation resources." }, "serve": { "name": "serve", "kind": "function", - "path": "docforge.cli.commands.mcp_logic.serve", - "signature": "", + "path": "docforge.cli.commands.mcp_utils.serve", + "signature": "", "docstring": "Serve MCP documentation." } } @@ -463,315 +463,297 @@ "name": "cli", "kind": "function", "path": "docforge.cli.commands.cli", - "signature": "", + "signature": "", "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." }, "build": { "name": "build", "kind": "function", "path": "docforge.cli.commands.build", - "signature": "", + "signature": "", "docstring": "Build documentation (MkDocs site or MCP resources)." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.commands.serve", - "signature": "", + "signature": "", "docstring": "Serve documentation." }, "tree": { "name": "tree", "kind": "function", "path": "docforge.cli.commands.tree", - "signature": "", + "signature": "", "docstring": "Visualize the project structure." } } }, - "mcp": { - "name": "mcp", + "mcp_utils": { + "name": "mcp_utils", "kind": "module", - "path": "docforge.cli.mcp", + "path": "docforge.cli.mcp_utils", "signature": null, "docstring": null, "members": { - "logic": { - "name": "logic", - "kind": "module", - "path": "docforge.cli.mcp.logic", - "signature": null, - "docstring": null, + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.mcp_utils.Path", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.mcp_utils.click", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.mcp_utils.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", "members": { - "Path": { - "name": "Path", - "kind": "alias", - "path": "docforge.cli.mcp.logic.Path", - "signature": "", - "docstring": null - }, - "click": { - "name": "click", - "kind": "alias", - "path": "docforge.cli.mcp.logic.click", - "signature": "", - "docstring": null - }, - "GriffeLoader": { - "name": "GriffeLoader", - "kind": "class", - "path": "docforge.cli.mcp.logic.GriffeLoader", - "signature": "", - "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", - "members": { - "load_project": { - "name": "load_project", - "kind": "function", - "path": "docforge.cli.mcp.logic.GriffeLoader.load_project", - "signature": "", - "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." - }, - "load_module": { - "name": "load_module", - "kind": "function", - "path": "docforge.cli.mcp.logic.GriffeLoader.load_module", - "signature": "", - "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." - } - } - }, - "discover_module_paths": { - "name": "discover_module_paths", + "load_project": { + "name": "load_project", "kind": "function", - "path": "docforge.cli.mcp.logic.discover_module_paths", - "signature": "", - "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + "path": "docforge.cli.mcp_utils.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." }, - "MCPRenderer": { - "name": "MCPRenderer", - "kind": "class", - "path": "docforge.cli.mcp.logic.MCPRenderer", - "signature": "", - "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", - "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "docforge.cli.mcp.logic.MCPRenderer.name", - "signature": "", - "docstring": null - }, - "generate_sources": { - "name": "generate_sources", - "kind": "function", - "path": "docforge.cli.mcp.logic.MCPRenderer.generate_sources", - "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." - } - } - }, - "MCPServer": { - "name": "MCPServer", - "kind": "class", - "path": "docforge.cli.mcp.logic.MCPServer", - "signature": "", - "docstring": "MCP server for serving a pre-built MCP documentation bundle.", - "members": { - "mcp_root": { - "name": "mcp_root", - "kind": "attribute", - "path": "docforge.cli.mcp.logic.MCPServer.mcp_root", - "signature": "", - "docstring": null - }, - "app": { - "name": "app", - "kind": "attribute", - "path": "docforge.cli.mcp.logic.MCPServer.app", - "signature": "", - "docstring": null - }, - "run": { - "name": "run", - "kind": "function", - "path": "docforge.cli.mcp.logic.MCPServer.run", - "signature": "", - "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" - } - } - }, - "generate_resources": { - "name": "generate_resources", + "load_module": { + "name": "load_module", "kind": "function", - "path": "docforge.cli.mcp.logic.generate_resources", - "signature": "", - "docstring": "Generate MCP-compatible documentation resources." - }, - "serve": { - "name": "serve", - "kind": "function", - "path": "docforge.cli.mcp.logic.serve", - "signature": "", - "docstring": "Serve MCP documentation." + "path": "docforge.cli.mcp_utils.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." } } - } - } - }, - "mkdocs": { - "name": "mkdocs", - "kind": "module", - "path": "docforge.cli.mkdocs", - "signature": null, - "docstring": null, - "members": { - "logic": { - "name": "logic", - "kind": "module", - "path": "docforge.cli.mkdocs.logic", - "signature": null, - "docstring": null, + }, + "discover_module_paths": { + "name": "discover_module_paths", + "kind": "function", + "path": "docforge.cli.mcp_utils.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MCPRenderer": { + "name": "MCPRenderer", + "kind": "class", + "path": "docforge.cli.mcp_utils.MCPRenderer", + "signature": "", + "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", "members": { - "Path": { - "name": "Path", - "kind": "alias", - "path": "docforge.cli.mkdocs.logic.Path", - "signature": "", + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.mcp_utils.MCPRenderer.name", + "signature": "", "docstring": null }, - "resources": { - "name": "resources", - "kind": "alias", - "path": "docforge.cli.mkdocs.logic.resources", - "signature": "", - "docstring": null - }, - "click": { - "name": "click", - "kind": "alias", - "path": "docforge.cli.mkdocs.logic.click", - "signature": "", - "docstring": null - }, - "yaml": { - "name": "yaml", - "kind": "alias", - "path": "docforge.cli.mkdocs.logic.yaml", - "signature": "", - "docstring": null - }, - "GriffeLoader": { - "name": "GriffeLoader", - "kind": "class", - "path": "docforge.cli.mkdocs.logic.GriffeLoader", - "signature": "", - "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", - "members": { - "load_project": { - "name": "load_project", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_project", - "signature": "", - "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." - }, - "load_module": { - "name": "load_module", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.GriffeLoader.load_module", - "signature": "", - "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." - } - } - }, - "discover_module_paths": { - "name": "discover_module_paths", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.discover_module_paths", - "signature": "", - "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." - }, - "MkDocsRenderer": { - "name": "MkDocsRenderer", - "kind": "class", - "path": "docforge.cli.mkdocs.logic.MkDocsRenderer", - "signature": "", - "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", - "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.name", - "signature": "", - "docstring": null - }, - "generate_sources": { - "name": "generate_sources", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.generate_sources", - "signature": "", - "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." - } - } - }, - "load_nav_spec": { - "name": "load_nav_spec", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.load_nav_spec", - "signature": "", - "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." - }, - "resolve_nav": { - "name": "resolve_nav", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.resolve_nav", - "signature": "", - "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." - }, - "MkDocsNavEmitter": { - "name": "MkDocsNavEmitter", - "kind": "class", - "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter", - "signature": "", - "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", - "members": { - "emit": { - "name": "emit", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter.emit", - "signature": "", - "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." - } - } - }, "generate_sources": { "name": "generate_sources", "kind": "function", - "path": "docforge.cli.mkdocs.logic.generate_sources", - "signature": "", - "docstring": "Generate Markdown source files for the specified module." - }, - "generate_config": { - "name": "generate_config", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.generate_config", - "signature": "", - "docstring": "Generate an mkdocs.yml configuration file." - }, - "build": { - "name": "build", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.build", - "signature": "", - "docstring": "Build the documentation site using MkDocs." - }, - "serve": { - "name": "serve", - "kind": "function", - "path": "docforge.cli.mkdocs.logic.serve", - "signature": "", - "docstring": "Serve the documentation site with live-reload using MkDocs." + "path": "docforge.cli.mcp_utils.MCPRenderer.generate_sources", + "signature": "", + "docstring": "Generate MCP-compatible JSON resources and navigation for the project." } } + }, + "MCPServer": { + "name": "MCPServer", + "kind": "class", + "path": "docforge.cli.mcp_utils.MCPServer", + "signature": "", + "docstring": "MCP server for serving a pre-built MCP documentation bundle.", + "members": { + "mcp_root": { + "name": "mcp_root", + "kind": "attribute", + "path": "docforge.cli.mcp_utils.MCPServer.mcp_root", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "docforge.cli.mcp_utils.MCPServer.app", + "signature": "", + "docstring": null + }, + "run": { + "name": "run", + "kind": "function", + "path": "docforge.cli.mcp_utils.MCPServer.run", + "signature": "", + "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" + } + } + }, + "generate_resources": { + "name": "generate_resources", + "kind": "function", + "path": "docforge.cli.mcp_utils.generate_resources", + "signature": "", + "docstring": "Generate MCP-compatible documentation resources." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.mcp_utils.serve", + "signature": "", + "docstring": "Serve MCP documentation." + } + } + }, + "mkdocs_utils": { + "name": "mkdocs_utils", + "kind": "module", + "path": "docforge.cli.mkdocs_utils", + "signature": null, + "docstring": null, + "members": { + "Path": { + "name": "Path", + "kind": "alias", + "path": "docforge.cli.mkdocs_utils.Path", + "signature": "", + "docstring": null + }, + "resources": { + "name": "resources", + "kind": "alias", + "path": "docforge.cli.mkdocs_utils.resources", + "signature": "", + "docstring": null + }, + "click": { + "name": "click", + "kind": "alias", + "path": "docforge.cli.mkdocs_utils.click", + "signature": "", + "docstring": null + }, + "yaml": { + "name": "yaml", + "kind": "alias", + "path": "docforge.cli.mkdocs_utils.yaml", + "signature": "", + "docstring": null + }, + "GriffeLoader": { + "name": "GriffeLoader", + "kind": "class", + "path": "docforge.cli.mkdocs_utils.GriffeLoader", + "signature": "", + "docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.", + "members": { + "load_project": { + "name": "load_project", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.GriffeLoader.load_project", + "signature": "", + "docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules." + }, + "load_module": { + "name": "load_module", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.GriffeLoader.load_module", + "signature": "", + "docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance." + } + } + }, + "discover_module_paths": { + "name": "discover_module_paths", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.discover_module_paths", + "signature": "", + "docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." + }, + "MkDocsRenderer": { + "name": "MkDocsRenderer", + "kind": "class", + "path": "docforge.cli.mkdocs_utils.MkDocsRenderer", + "signature": "", + "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "docforge.cli.mkdocs_utils.MkDocsRenderer.name", + "signature": "", + "docstring": null + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_sources", + "signature": "", + "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files." + } + } + }, + "load_nav_spec": { + "name": "load_nav_spec", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.load_nav_spec", + "signature": "", + "docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance." + }, + "resolve_nav": { + "name": "resolve_nav", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.resolve_nav", + "signature": "", + "docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist." + }, + "MkDocsNavEmitter": { + "name": "MkDocsNavEmitter", + "kind": "class", + "path": "docforge.cli.mkdocs_utils.MkDocsNavEmitter", + "signature": "", + "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.", + "members": { + "emit": { + "name": "emit", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.MkDocsNavEmitter.emit", + "signature": "", + "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation." + } + } + }, + "generate_sources": { + "name": "generate_sources", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.generate_sources", + "signature": "", + "docstring": "Generate Markdown source files for the specified module." + }, + "generate_config": { + "name": "generate_config", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.generate_config", + "signature": "", + "docstring": "Generate an mkdocs.yml configuration file." + }, + "build": { + "name": "build", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.build", + "signature": "", + "docstring": "Build the documentation site using MkDocs." + }, + "serve": { + "name": "serve", + "kind": "function", + "path": "docforge.cli.mkdocs_utils.serve", + "signature": "", + "docstring": "Serve the documentation site with live-reload using MkDocs." } } } diff --git a/mcp_docs/nav.json b/mcp_docs/nav.json index 597961a..c3c9367 100644 --- a/mcp_docs/nav.json +++ b/mcp_docs/nav.json @@ -16,20 +16,12 @@ "resource": "doc://modules/docforge.cli.main" }, { - "module": "docforge.cli.mcp", - "resource": "doc://modules/docforge.cli.mcp" + "module": "docforge.cli.mcp_utils", + "resource": "doc://modules/docforge.cli.mcp_utils" }, { - "module": "docforge.cli.mcp.logic", - "resource": "doc://modules/docforge.cli.mcp.logic" - }, - { - "module": "docforge.cli.mkdocs", - "resource": "doc://modules/docforge.cli.mkdocs" - }, - { - "module": "docforge.cli.mkdocs.logic", - "resource": "doc://modules/docforge.cli.mkdocs.logic" + "module": "docforge.cli.mkdocs_utils", + "resource": "doc://modules/docforge.cli.mkdocs_utils" }, { "module": "docforge.loaders", diff --git a/mkdocs.yml b/mkdocs.yml index a6c1dcb..5b9e7da 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -58,7 +58,5 @@ nav: - docforge/cli/index.md - docforge/cli/main.md - docforge/cli/commands.md - - docforge/cli/mcp/index.md - - docforge/cli/mcp/logic.md - - docforge/cli/mkdocs/index.md - - docforge/cli/mkdocs/logic.md + - docforge/cli/mcp_utils.md + - docforge/cli/mkdocs_utils.md -- 2.49.1 From c82868d5a79a4f86725de4c8ca7607272f1803d1 Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Wed, 21 Jan 2026 18:39:50 +0530 Subject: [PATCH 5/7] added missing pyi files --- docforge/cli/commands.pyi | 32 ++++++++++++++++++++++++++++++++ docforge/cli/main.pyi | 1 + docforge/cli/mcp_utils.pyi | 4 ++++ docforge/cli/mkdocs_utils.pyi | 6 ++++++ 4 files changed, 43 insertions(+) create mode 100644 docforge/cli/commands.pyi create mode 100644 docforge/cli/main.pyi create mode 100644 docforge/cli/mcp_utils.pyi create mode 100644 docforge/cli/mkdocs_utils.pyi diff --git a/docforge/cli/commands.pyi b/docforge/cli/commands.pyi new file mode 100644 index 0000000..16b1c62 --- /dev/null +++ b/docforge/cli/commands.pyi @@ -0,0 +1,32 @@ +from click.core import Group +from pathlib import Path +from typing import Sequence, Optional, Any + +cli: Group + +def build( + mcp: bool, + mkdocs: 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, +) -> None: ... + +def serve( + mcp: bool, + mkdocs: bool, + mkdocs_yml: Path, + out_dir: Path, +) -> None: ... + +def tree( + modules: Sequence[str], + project_name: Optional[str], +) -> None: ... + +def _print_object(obj: Any, indent: str) -> None: ... diff --git a/docforge/cli/main.pyi b/docforge/cli/main.pyi new file mode 100644 index 0000000..7e7363e --- /dev/null +++ b/docforge/cli/main.pyi @@ -0,0 +1 @@ +def main() -> None: ... diff --git a/docforge/cli/mcp_utils.pyi b/docforge/cli/mcp_utils.pyi new file mode 100644 index 0000000..47b9eab --- /dev/null +++ b/docforge/cli/mcp_utils.pyi @@ -0,0 +1,4 @@ +from pathlib import Path + +def generate_resources(module: str, project_name: str | None, out_dir: Path) -> None: ... +def serve(mcp_root: Path) -> None: ... diff --git a/docforge/cli/mkdocs_utils.pyi b/docforge/cli/mkdocs_utils.pyi new file mode 100644 index 0000000..fc23e03 --- /dev/null +++ b/docforge/cli/mkdocs_utils.pyi @@ -0,0 +1,6 @@ +from pathlib import Path + +def generate_sources(module: str, project_name: str | None, docs_dir: Path) -> None: ... +def generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None: ... +def build(mkdocs_yml: Path) -> None: ... +def serve(mkdocs_yml: Path) -> None: ... -- 2.49.1 From bd294bea307b21883e22ab86ef30e857fc5b44d9 Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Wed, 21 Jan 2026 18:39:58 +0530 Subject: [PATCH 6/7] cli example changes --- docforge/__init__.py | 27 ++++++++++++++++++--------- docforge/cli/__init__.py | 6 ++---- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/docforge/__init__.py b/docforge/__init__.py index 87ba0a8..05b3ede 100644 --- a/docforge/__init__.py +++ b/docforge/__init__.py @@ -6,6 +6,12 @@ speed, flexibility, and beautiful output. It decouples the introspection of your code from the rendering process, allowing you to generate documentation for various platforms (starting with MkDocs) from a single internal models. +## Available Commands + +- **build**: Build documentation (MkDocs site or MCP resources). +- **serve**: Serve documentation (MkDocs or MCP). +- **tree**: Visualize the introspected project structure. + ## Installation Install using `pip` with the optional `mkdocs` dependencies for a complete setup: @@ -16,10 +22,14 @@ pip install doc-forge ## Quick Start -1. **Generate Markdown Sources**: - Introspect your package and create ready-to-use Markdown files: +1. **Build Documentation**: + Introspect your package and generate documentation in one step: ```bash - doc-forge generate --module my_package --docs-dir docs + # Build MkDocs site + doc-forge build --mkdocs --module my_package --site-name "My Docs" + + # Build MCP resources + doc-forge build --mcp --module my_package ``` 2. **Define Navigation**: @@ -33,14 +43,13 @@ pip install doc-forge - my_package/utils.md ``` -3. **Generate MkDocs Configuration**: +3. **Preview**: ```bash - doc-forge mkdocs --site-name "My Awesome Docs" - ``` + # Serve MkDocs site + doc-forge serve --mkdocs -4. **Preview**: - ```bash - doc-forge serve + # Serve MCP documentation + doc-forge serve --mcp ``` ## Project Structure diff --git a/docforge/cli/__init__.py b/docforge/cli/__init__.py index 7ced811..094887b 100644 --- a/docforge/cli/__init__.py +++ b/docforge/cli/__init__.py @@ -6,11 +6,9 @@ with doc-forge. ## Available Commands +- **build**: Build documentation (MkDocs site or MCP resources). +- **serve**: Serve documentation (MkDocs or MCP). - **tree**: Visualize the introspected project structure. -- **generate**: Create Markdown source files from Python code. -- **mkdocs**: Generate the primary `mkdocs.yml` configuration. -- **build**: Build the final documentation site. -- **serve**: Launch a local development server with live-reloading. """ from .main import main -- 2.49.1 From 05dbd67f36978abb333332a012166c3a6b97a970 Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Wed, 21 Jan 2026 18:53:57 +0530 Subject: [PATCH 7/7] doc changes --- docforge/cli/commands.py | 35 +++++- docforge/cli/main.py | 3 +- docforge/cli/mcp_utils.py | 10 +- docforge/cli/mkdocs_utils.py | 18 ++++ docforge/renderers/mcp_renderer.py | 22 +++- mcp_docs/modules/docforge.cli.commands.json | 46 +++++--- mcp_docs/modules/docforge.cli.json | 82 ++++++++------ mcp_docs/modules/docforge.cli.main.json | 8 +- mcp_docs/modules/docforge.cli.mcp_utils.json | 10 +- .../modules/docforge.cli.mkdocs_utils.json | 16 +-- mcp_docs/modules/docforge.json | 100 ++++++++++-------- mcp_docs/modules/docforge.renderers.json | 8 +- .../docforge.renderers.mcp_renderer.json | 6 +- 13 files changed, 242 insertions(+), 122 deletions(-) diff --git a/docforge/cli/commands.py b/docforge/cli/commands.py index 6cb7975..9937cfd 100644 --- a/docforge/cli/commands.py +++ b/docforge/cli/commands.py @@ -43,6 +43,23 @@ def build( ) -> None: """ Build documentation (MkDocs site or MCP resources). + + This command orchestrates the full build process: + 1. Introspects the code (Griffe) + 2. Renders sources (MkDocs Markdown or MCP JSON) + 3. (MkDocs only) Generates config and runs the final site build. + + Args: + mcp: Use the MCP documentation builder. + mkdocs: Use the MkDocs documentation builder. + module: The dotted path of the module to document. + project_name: Optional override for the project name. + site_name: (MkDocs) The site display name. Defaults to module name. + docs_dir: (MkDocs) Target directory for Markdown sources. + nav_file: (MkDocs) Path to the docforge.nav.yml specification. + template: (MkDocs) Optional custom mkdocs.yml template. + mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml. + out_dir: (MCP) Target directory for MCP JSON resources. """ if not mcp and not mkdocs: raise click.UsageError("Must specify either --mcp or --mkdocs") @@ -84,7 +101,13 @@ def serve( out_dir: Path, ) -> None: """ - Serve documentation. + Serve documentation (MkDocs or MCP). + + Args: + mcp: Serve MCP resources via an MCP server. + mkdocs: Serve the MkDocs site using the built-in development server. + mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration. + out_dir: (MCP) Path to the mcp_docs/ directory. """ if mcp and mkdocs: raise click.UsageError("Cannot specify both --mcp and --mkdocs") @@ -113,7 +136,11 @@ def tree( project_name: Optional[str], ) -> None: """ - Visualize the project structure. + Visualize the project structure in the terminal. + + Args: + modules: List of module import paths to recursively introspect. + project_name: Optional override for the project name shown at the root. """ loader = GriffeLoader() project = loader.load_project(list(modules), project_name) @@ -129,6 +156,10 @@ def tree( def _print_object(obj, indent: str) -> None: """ Recursive helper to print doc objects and their members to the console. + + Args: + obj: The DocObject instance to print. + indent: Current line indentation (e.g., '│ '). """ click.echo(f"{indent}├── {obj.name}") for member in obj.get_all_members(): diff --git a/docforge/cli/main.py b/docforge/cli/main.py index b6f7d78..70c7051 100644 --- a/docforge/cli/main.py +++ b/docforge/cli/main.py @@ -1,5 +1,6 @@ """ -Main entry point for the doc-forge CLI. +Main entry point for the doc-forge CLI. This module delegates all command +execution to docforge.cli.commands. """ from docforge.cli.commands import cli diff --git a/docforge/cli/mcp_utils.py b/docforge/cli/mcp_utils.py index 09c2477..1838adc 100644 --- a/docforge/cli/mcp_utils.py +++ b/docforge/cli/mcp_utils.py @@ -7,6 +7,11 @@ from docforge.servers import MCPServer def generate_resources(module: str, project_name: str | None, out_dir: Path) -> None: """ Generate MCP-compatible documentation resources. + + Args: + module: The dotted path of the primary module to document. + project_name: Optional override for the project name. + out_dir: Directory where the MCP JSON resources and nav will be written. """ loader = GriffeLoader() discovered_paths = discover_module_paths(module) @@ -17,7 +22,10 @@ def generate_resources(module: str, project_name: str | None, out_dir: Path) -> def serve(mcp_root: Path) -> None: """ - Serve MCP documentation. + Serve MCP documentation from a pre-built bundle. + + Args: + mcp_root: Path to the directory containing index.json, nav.json, and modules/. """ if not mcp_root.exists(): raise click.ClickException(f"mcp_docs directory not found: {mcp_root}") diff --git a/docforge/cli/mkdocs_utils.py b/docforge/cli/mkdocs_utils.py index 2fcc636..5f9f68e 100644 --- a/docforge/cli/mkdocs_utils.py +++ b/docforge/cli/mkdocs_utils.py @@ -9,6 +9,11 @@ from docforge.nav import load_nav_spec, resolve_nav, MkDocsNavEmitter def generate_sources(module: str, project_name: str | None, docs_dir: Path) -> None: """ Generate Markdown source files for the specified module. + + Args: + module: The dotted path of the primary module to document. + project_name: Optional override for the project name. + docs_dir: Directory where the generated Markdown files will be written. """ loader = GriffeLoader() discovered_paths = discover_module_paths(module) @@ -20,6 +25,13 @@ def generate_sources(module: str, project_name: str | None, docs_dir: Path) -> N def generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None: """ Generate an mkdocs.yml configuration file. + + Args: + docs_dir: Path to the directory containing documentation Markdown files. + nav_file: Path to the docforge.nav.yml specification. + template: Optional path to an mkdocs.yml template (overrides built-in). + out: Path where the final mkdocs.yml will be written. + site_name: The display name for the documentation site. """ if not nav_file.exists(): raise click.FileError(str(nav_file), hint="Nav spec not found") @@ -49,6 +61,9 @@ def generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: def build(mkdocs_yml: Path) -> None: """ Build the documentation site using MkDocs. + + Args: + mkdocs_yml: Path to the mkdocs.yml configuration file. """ if not mkdocs_yml.exists(): raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}") @@ -61,6 +76,9 @@ def build(mkdocs_yml: Path) -> None: def serve(mkdocs_yml: Path) -> None: """ Serve the documentation site with live-reload using MkDocs. + + Args: + mkdocs_yml: Path to the mkdocs.yml configuration file. """ if not mkdocs_yml.exists(): raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}") diff --git a/docforge/renderers/mcp_renderer.py b/docforge/renderers/mcp_renderer.py index 197ddba..58ca317 100644 --- a/docforge/renderers/mcp_renderer.py +++ b/docforge/renderers/mcp_renderer.py @@ -15,6 +15,10 @@ class MCPRenderer: def generate_sources(self, project: Project, out_dir: Path) -> None: """ Generate MCP-compatible JSON resources and navigation for the project. + + Args: + project: The project model to render. + out_dir: Target directory for the generated JSON files. """ modules_dir = out_dir / "modules" modules_dir.mkdir(parents=True, exist_ok=True) @@ -50,7 +54,11 @@ class MCPRenderer: def _write_module(self, module: Module, modules_dir: Path) -> None: """ - Serialize a module into an MCP JSON resource. + Serialize a module into an MCP JSON resource on disk. + + Args: + module: The module instance to serialize. + modules_dir: The directory where the module JSON file should be written. """ payload = { "module": module.path, @@ -64,6 +72,12 @@ class MCPRenderer: def _render_module(self, module: Module) -> Dict: """ Render a Module into MCP-friendly structured data. + + Args: + module: The module instance to render. + + Returns: + A dictionary following the MCP documentation resource schema. """ data: Dict = { "path": module.path, @@ -79,6 +93,12 @@ class MCPRenderer: def _render_object(self, obj: DocObject) -> Dict: """ Recursively render a DocObject into structured MCP data. + + Args: + obj: The documented object (class, func, etc.) to render. + + Returns: + A dictionary representing the object and its members. """ data: Dict = { "name": obj.name, diff --git a/mcp_docs/modules/docforge.cli.commands.json b/mcp_docs/modules/docforge.cli.commands.json index 3df039b..3bf3e1e 100644 --- a/mcp_docs/modules/docforge.cli.commands.json +++ b/mcp_docs/modules/docforge.cli.commands.json @@ -178,28 +178,28 @@ "kind": "function", "path": "docforge.cli.commands.mkdocs_utils.generate_sources", "signature": "", - "docstring": "Generate Markdown source files for the specified module." + "docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written." }, "generate_config": { "name": "generate_config", "kind": "function", "path": "docforge.cli.commands.mkdocs_utils.generate_config", "signature": "", - "docstring": "Generate an mkdocs.yml configuration file." + "docstring": "Generate an mkdocs.yml configuration file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template (overrides built-in).\n out: Path where the final mkdocs.yml will be written.\n site_name: The display name for the documentation site." }, "build": { "name": "build", "kind": "function", "path": "docforge.cli.commands.mkdocs_utils.build", "signature": "", - "docstring": "Build the documentation site using MkDocs." + "docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.commands.mkdocs_utils.serve", "signature": "", - "docstring": "Serve the documentation site with live-reload using MkDocs." + "docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." } } }, @@ -273,7 +273,7 @@ "kind": "function", "path": "docforge.cli.commands.mcp_utils.MCPRenderer.generate_sources", "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + "docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." } } }, @@ -312,44 +312,58 @@ "kind": "function", "path": "docforge.cli.commands.mcp_utils.generate_resources", "signature": "", - "docstring": "Generate MCP-compatible documentation resources." + "docstring": "Generate MCP-compatible documentation resources.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n out_dir: Directory where the MCP JSON resources and nav will be written." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.commands.mcp_utils.serve", "signature": "", - "docstring": "Serve MCP documentation." + "docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/." } } }, "cli": { "name": "cli", - "kind": "function", + "kind": "attribute", "path": "docforge.cli.commands.cli", - "signature": "", - "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." + "signature": null, + "docstring": null }, "build": { "name": "build", "kind": "function", "path": "docforge.cli.commands.build", - "signature": "", - "docstring": "Build documentation (MkDocs site or MCP resources)." + "signature": "", + "docstring": "Build documentation (MkDocs site or MCP resources).\n\nThis command orchestrates the full build process:\n1. Introspects the code (Griffe)\n2. Renders sources (MkDocs Markdown or MCP JSON)\n3. (MkDocs only) Generates config and runs the final site build.\n\nArgs:\n mcp: Use the MCP documentation builder.\n mkdocs: Use the MkDocs documentation builder.\n module: The dotted path of the module to document.\n project_name: Optional override for the project name.\n site_name: (MkDocs) The site display name. Defaults to module name.\n docs_dir: (MkDocs) Target directory for Markdown sources.\n nav_file: (MkDocs) Path to the docforge.nav.yml specification.\n template: (MkDocs) Optional custom mkdocs.yml template.\n mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.\n out_dir: (MCP) Target directory for MCP JSON resources." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.commands.serve", - "signature": "", - "docstring": "Serve documentation." + "signature": "", + "docstring": "Serve documentation (MkDocs or MCP).\n\nArgs:\n mcp: Serve MCP resources via an MCP server.\n mkdocs: Serve the MkDocs site using the built-in development server.\n mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.\n out_dir: (MCP) Path to the mcp_docs/ directory." }, "tree": { "name": "tree", "kind": "function", "path": "docforge.cli.commands.tree", - "signature": "", - "docstring": "Visualize the project structure." + "signature": "", + "docstring": "Visualize the project structure in the terminal.\n\nArgs:\n modules: List of module import paths to recursively introspect.\n project_name: Optional override for the project name shown at the root." + }, + "Group": { + "name": "Group", + "kind": "alias", + "path": "docforge.cli.commands.Group", + "signature": "", + "docstring": null + }, + "Any": { + "name": "Any", + "kind": "alias", + "path": "docforge.cli.commands.Any", + "signature": "", + "docstring": null } } } diff --git a/mcp_docs/modules/docforge.cli.json b/mcp_docs/modules/docforge.cli.json index 4d22e94..0b3ab64 100644 --- a/mcp_docs/modules/docforge.cli.json +++ b/mcp_docs/modules/docforge.cli.json @@ -2,27 +2,27 @@ "module": "docforge.cli", "content": { "path": "docforge.cli", - "docstring": "# CLI Layer\n\nThe `docforge.cli` package provides the command-line interface for interacting\nwith doc-forge.\n\n## Available Commands\n\n- **tree**: Visualize the introspected project structure.\n- **generate**: Create Markdown source files from Python code.\n- **mkdocs**: Generate the primary `mkdocs.yml` configuration.\n- **build**: Build the final documentation site.\n- **serve**: Launch a local development server with live-reloading.", + "docstring": "# CLI Layer\n\nThe `docforge.cli` package provides the command-line interface for interacting\nwith doc-forge.\n\n## Available Commands\n\n- **build**: Build documentation (MkDocs site or MCP resources).\n- **serve**: Serve documentation (MkDocs or MCP).\n- **tree**: Visualize the introspected project structure.", "objects": { "main": { "name": "main", "kind": "module", "path": "docforge.cli.main", "signature": null, - "docstring": "Main entry point for the doc-forge CLI.", + "docstring": "Main entry point for the doc-forge CLI. This module delegates all command\nexecution to docforge.cli.commands.", "members": { "cli": { "name": "cli", - "kind": "function", + "kind": "attribute", "path": "docforge.cli.main.cli", "signature": "", - "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." + "docstring": null }, "main": { "name": "main", "kind": "function", "path": "docforge.cli.main.main", - "signature": "", + "signature": "", "docstring": "CLI Entry point. Boots the click application." } } @@ -208,28 +208,28 @@ "kind": "function", "path": "docforge.cli.commands.mkdocs_utils.generate_sources", "signature": "", - "docstring": "Generate Markdown source files for the specified module." + "docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written." }, "generate_config": { "name": "generate_config", "kind": "function", "path": "docforge.cli.commands.mkdocs_utils.generate_config", "signature": "", - "docstring": "Generate an mkdocs.yml configuration file." + "docstring": "Generate an mkdocs.yml configuration file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template (overrides built-in).\n out: Path where the final mkdocs.yml will be written.\n site_name: The display name for the documentation site." }, "build": { "name": "build", "kind": "function", "path": "docforge.cli.commands.mkdocs_utils.build", "signature": "", - "docstring": "Build the documentation site using MkDocs." + "docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.commands.mkdocs_utils.serve", "signature": "", - "docstring": "Serve the documentation site with live-reload using MkDocs." + "docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." } } }, @@ -303,7 +303,7 @@ "kind": "function", "path": "docforge.cli.commands.mcp_utils.MCPRenderer.generate_sources", "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + "docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." } } }, @@ -342,44 +342,58 @@ "kind": "function", "path": "docforge.cli.commands.mcp_utils.generate_resources", "signature": "", - "docstring": "Generate MCP-compatible documentation resources." + "docstring": "Generate MCP-compatible documentation resources.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n out_dir: Directory where the MCP JSON resources and nav will be written." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.commands.mcp_utils.serve", "signature": "", - "docstring": "Serve MCP documentation." + "docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/." } } }, "cli": { "name": "cli", - "kind": "function", + "kind": "attribute", "path": "docforge.cli.commands.cli", - "signature": "", - "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." + "signature": null, + "docstring": null }, "build": { "name": "build", "kind": "function", "path": "docforge.cli.commands.build", - "signature": "", - "docstring": "Build documentation (MkDocs site or MCP resources)." + "signature": "", + "docstring": "Build documentation (MkDocs site or MCP resources).\n\nThis command orchestrates the full build process:\n1. Introspects the code (Griffe)\n2. Renders sources (MkDocs Markdown or MCP JSON)\n3. (MkDocs only) Generates config and runs the final site build.\n\nArgs:\n mcp: Use the MCP documentation builder.\n mkdocs: Use the MkDocs documentation builder.\n module: The dotted path of the module to document.\n project_name: Optional override for the project name.\n site_name: (MkDocs) The site display name. Defaults to module name.\n docs_dir: (MkDocs) Target directory for Markdown sources.\n nav_file: (MkDocs) Path to the docforge.nav.yml specification.\n template: (MkDocs) Optional custom mkdocs.yml template.\n mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.\n out_dir: (MCP) Target directory for MCP JSON resources." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.commands.serve", - "signature": "", - "docstring": "Serve documentation." + "signature": "", + "docstring": "Serve documentation (MkDocs or MCP).\n\nArgs:\n mcp: Serve MCP resources via an MCP server.\n mkdocs: Serve the MkDocs site using the built-in development server.\n mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.\n out_dir: (MCP) Path to the mcp_docs/ directory." }, "tree": { "name": "tree", "kind": "function", "path": "docforge.cli.commands.tree", - "signature": "", - "docstring": "Visualize the project structure." + "signature": "", + "docstring": "Visualize the project structure in the terminal.\n\nArgs:\n modules: List of module import paths to recursively introspect.\n project_name: Optional override for the project name shown at the root." + }, + "Group": { + "name": "Group", + "kind": "alias", + "path": "docforge.cli.commands.Group", + "signature": "", + "docstring": null + }, + "Any": { + "name": "Any", + "kind": "alias", + "path": "docforge.cli.commands.Any", + "signature": "", + "docstring": null } } }, @@ -453,7 +467,7 @@ "kind": "function", "path": "docforge.cli.mcp_utils.MCPRenderer.generate_sources", "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + "docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." } } }, @@ -491,15 +505,15 @@ "name": "generate_resources", "kind": "function", "path": "docforge.cli.mcp_utils.generate_resources", - "signature": "", - "docstring": "Generate MCP-compatible documentation resources." + "signature": "", + "docstring": "Generate MCP-compatible documentation resources.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n out_dir: Directory where the MCP JSON resources and nav will be written." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.mcp_utils.serve", - "signature": "", - "docstring": "Serve MCP documentation." + "signature": "", + "docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/." } } }, @@ -625,29 +639,29 @@ "name": "generate_sources", "kind": "function", "path": "docforge.cli.mkdocs_utils.generate_sources", - "signature": "", - "docstring": "Generate Markdown source files for the specified module." + "signature": "", + "docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written." }, "generate_config": { "name": "generate_config", "kind": "function", "path": "docforge.cli.mkdocs_utils.generate_config", - "signature": "", - "docstring": "Generate an mkdocs.yml configuration file." + "signature": "", + "docstring": "Generate an mkdocs.yml configuration file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template (overrides built-in).\n out: Path where the final mkdocs.yml will be written.\n site_name: The display name for the documentation site." }, "build": { "name": "build", "kind": "function", "path": "docforge.cli.mkdocs_utils.build", - "signature": "", - "docstring": "Build the documentation site using MkDocs." + "signature": "", + "docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.mkdocs_utils.serve", - "signature": "", - "docstring": "Serve the documentation site with live-reload using MkDocs." + "signature": "", + "docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." } } } diff --git a/mcp_docs/modules/docforge.cli.main.json b/mcp_docs/modules/docforge.cli.main.json index 3536e12..c11662a 100644 --- a/mcp_docs/modules/docforge.cli.main.json +++ b/mcp_docs/modules/docforge.cli.main.json @@ -2,20 +2,20 @@ "module": "docforge.cli.main", "content": { "path": "docforge.cli.main", - "docstring": "Main entry point for the doc-forge CLI.", + "docstring": "Main entry point for the doc-forge CLI. This module delegates all command\nexecution to docforge.cli.commands.", "objects": { "cli": { "name": "cli", - "kind": "function", + "kind": "attribute", "path": "docforge.cli.main.cli", "signature": "", - "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." + "docstring": null }, "main": { "name": "main", "kind": "function", "path": "docforge.cli.main.main", - "signature": "", + "signature": "", "docstring": "CLI Entry point. Boots the click application." } } diff --git a/mcp_docs/modules/docforge.cli.mcp_utils.json b/mcp_docs/modules/docforge.cli.mcp_utils.json index b1cd895..607ec05 100644 --- a/mcp_docs/modules/docforge.cli.mcp_utils.json +++ b/mcp_docs/modules/docforge.cli.mcp_utils.json @@ -67,7 +67,7 @@ "kind": "function", "path": "docforge.cli.mcp_utils.MCPRenderer.generate_sources", "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + "docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." } } }, @@ -105,15 +105,15 @@ "name": "generate_resources", "kind": "function", "path": "docforge.cli.mcp_utils.generate_resources", - "signature": "", - "docstring": "Generate MCP-compatible documentation resources." + "signature": "", + "docstring": "Generate MCP-compatible documentation resources.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n out_dir: Directory where the MCP JSON resources and nav will be written." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.mcp_utils.serve", - "signature": "", - "docstring": "Serve MCP documentation." + "signature": "", + "docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/." } } } diff --git a/mcp_docs/modules/docforge.cli.mkdocs_utils.json b/mcp_docs/modules/docforge.cli.mkdocs_utils.json index 88d3888..ccb2494 100644 --- a/mcp_docs/modules/docforge.cli.mkdocs_utils.json +++ b/mcp_docs/modules/docforge.cli.mkdocs_utils.json @@ -119,29 +119,29 @@ "name": "generate_sources", "kind": "function", "path": "docforge.cli.mkdocs_utils.generate_sources", - "signature": "", - "docstring": "Generate Markdown source files for the specified module." + "signature": "", + "docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written." }, "generate_config": { "name": "generate_config", "kind": "function", "path": "docforge.cli.mkdocs_utils.generate_config", - "signature": "", - "docstring": "Generate an mkdocs.yml configuration file." + "signature": "", + "docstring": "Generate an mkdocs.yml configuration file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template (overrides built-in).\n out: Path where the final mkdocs.yml will be written.\n site_name: The display name for the documentation site." }, "build": { "name": "build", "kind": "function", "path": "docforge.cli.mkdocs_utils.build", - "signature": "", - "docstring": "Build the documentation site using MkDocs." + "signature": "", + "docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.mkdocs_utils.serve", - "signature": "", - "docstring": "Serve the documentation site with live-reload using MkDocs." + "signature": "", + "docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." } } } diff --git a/mcp_docs/modules/docforge.json b/mcp_docs/modules/docforge.json index 6d9ff5d..0f2176e 100644 --- a/mcp_docs/modules/docforge.json +++ b/mcp_docs/modules/docforge.json @@ -2,7 +2,7 @@ "module": "docforge", "content": { "path": "docforge", - "docstring": "# doc-forge\n\n`doc-forge` is a renderer-agnostic Python documentation compiler designed for\nspeed, flexibility, and beautiful output. It decouples the introspection of\nyour code from the rendering process, allowing you to generate documentation\nfor various platforms (starting with MkDocs) from a single internal models.\n\n## Installation\n\nInstall using `pip` with the optional `mkdocs` dependencies for a complete setup:\n\n```bash\npip install doc-forge\n```\n\n## Quick Start\n\n1. **Generate Markdown Sources**:\n Introspect your package and create ready-to-use Markdown files:\n ```bash\n doc-forge generate --module my_package --docs-dir docs\n ```\n\n2. **Define Navigation**:\n Create a `docforge.nav.yml` to organize your documentation:\n ```yaml\n home: my_package/index.md\n groups:\n Core API:\n - my_package/core/*.md\n Utilities:\n - my_package/utils.md\n ```\n\n3. **Generate MkDocs Configuration**:\n ```bash\n doc-forge mkdocs --site-name \"My Awesome Docs\"\n ```\n\n4. **Preview**:\n ```bash\n doc-forge serve\n ```\n\n## Project Structure\n\n- `docforge.loaders`: Introspects source code using static analysis (`griffe`).\n- `docforge.models`: The internal representation of your project, modules, and objects.\n- `docforge.renderers`: Converters that turn the models into physical files.\n- `docforge.nav`: Managers for logical-to-physical path mapping and navigation.", + "docstring": "# doc-forge\n\n`doc-forge` is a renderer-agnostic Python documentation compiler designed for\nspeed, flexibility, and beautiful output. It decouples the introspection of\nyour code from the rendering process, allowing you to generate documentation\nfor various platforms (starting with MkDocs) from a single internal models.\n\n## Available Commands\n\n- **build**: Build documentation (MkDocs site or MCP resources).\n- **serve**: Serve documentation (MkDocs or MCP).\n- **tree**: Visualize the introspected project structure.\n\n## Installation\n\nInstall using `pip` with the optional `mkdocs` dependencies for a complete setup:\n\n```bash\npip install doc-forge\n```\n\n## Quick Start\n\n1. **Build Documentation**:\n Introspect your package and generate documentation in one step:\n ```bash\n # Build MkDocs site\n doc-forge build --mkdocs --module my_package --site-name \"My Docs\"\n\n # Build MCP resources\n doc-forge build --mcp --module my_package\n ```\n\n2. **Define Navigation**:\n Create a `docforge.nav.yml` to organize your documentation:\n ```yaml\n home: my_package/index.md\n groups:\n Core API:\n - my_package/core/*.md\n Utilities:\n - my_package/utils.md\n ```\n\n3. **Preview**:\n ```bash\n # Serve MkDocs site\n doc-forge serve --mkdocs\n\n # Serve MCP documentation\n doc-forge serve --mcp\n ```\n\n## Project Structure\n\n- `docforge.loaders`: Introspects source code using static analysis (`griffe`).\n- `docforge.models`: The internal representation of your project, modules, and objects.\n- `docforge.renderers`: Converters that turn the models into physical files.\n- `docforge.nav`: Managers for logical-to-physical path mapping and navigation.", "objects": { "GriffeLoader": { "name": "GriffeLoader", @@ -76,7 +76,7 @@ "kind": "function", "path": "docforge.MCPRenderer.generate_sources", "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + "docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." } } }, @@ -85,14 +85,14 @@ "kind": "module", "path": "docforge.main", "signature": "", - "docstring": "Main entry point for the doc-forge CLI.", + "docstring": "Main entry point for the doc-forge CLI. This module delegates all command\nexecution to docforge.cli.commands.", "members": { "cli": { "name": "cli", - "kind": "function", + "kind": "attribute", "path": "docforge.main.cli", "signature": "", - "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." + "docstring": null }, "main": { "name": "main", @@ -108,27 +108,27 @@ "kind": "module", "path": "docforge.cli", "signature": null, - "docstring": "# CLI Layer\n\nThe `docforge.cli` package provides the command-line interface for interacting\nwith doc-forge.\n\n## Available Commands\n\n- **tree**: Visualize the introspected project structure.\n- **generate**: Create Markdown source files from Python code.\n- **mkdocs**: Generate the primary `mkdocs.yml` configuration.\n- **build**: Build the final documentation site.\n- **serve**: Launch a local development server with live-reloading.", + "docstring": "# CLI Layer\n\nThe `docforge.cli` package provides the command-line interface for interacting\nwith doc-forge.\n\n## Available Commands\n\n- **build**: Build documentation (MkDocs site or MCP resources).\n- **serve**: Serve documentation (MkDocs or MCP).\n- **tree**: Visualize the introspected project structure.", "members": { "main": { "name": "main", "kind": "module", "path": "docforge.cli.main", "signature": null, - "docstring": "Main entry point for the doc-forge CLI.", + "docstring": "Main entry point for the doc-forge CLI. This module delegates all command\nexecution to docforge.cli.commands.", "members": { "cli": { "name": "cli", - "kind": "function", + "kind": "attribute", "path": "docforge.cli.main.cli", "signature": "", - "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." + "docstring": null }, "main": { "name": "main", "kind": "function", "path": "docforge.cli.main.main", - "signature": "", + "signature": "", "docstring": "CLI Entry point. Boots the click application." } } @@ -314,28 +314,28 @@ "kind": "function", "path": "docforge.cli.commands.mkdocs_utils.generate_sources", "signature": "", - "docstring": "Generate Markdown source files for the specified module." + "docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written." }, "generate_config": { "name": "generate_config", "kind": "function", "path": "docforge.cli.commands.mkdocs_utils.generate_config", "signature": "", - "docstring": "Generate an mkdocs.yml configuration file." + "docstring": "Generate an mkdocs.yml configuration file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template (overrides built-in).\n out: Path where the final mkdocs.yml will be written.\n site_name: The display name for the documentation site." }, "build": { "name": "build", "kind": "function", "path": "docforge.cli.commands.mkdocs_utils.build", "signature": "", - "docstring": "Build the documentation site using MkDocs." + "docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.commands.mkdocs_utils.serve", "signature": "", - "docstring": "Serve the documentation site with live-reload using MkDocs." + "docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." } } }, @@ -409,7 +409,7 @@ "kind": "function", "path": "docforge.cli.commands.mcp_utils.MCPRenderer.generate_sources", "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + "docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." } } }, @@ -448,44 +448,58 @@ "kind": "function", "path": "docforge.cli.commands.mcp_utils.generate_resources", "signature": "", - "docstring": "Generate MCP-compatible documentation resources." + "docstring": "Generate MCP-compatible documentation resources.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n out_dir: Directory where the MCP JSON resources and nav will be written." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.commands.mcp_utils.serve", "signature": "", - "docstring": "Serve MCP documentation." + "docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/." } } }, "cli": { "name": "cli", - "kind": "function", + "kind": "attribute", "path": "docforge.cli.commands.cli", - "signature": "", - "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation." + "signature": null, + "docstring": null }, "build": { "name": "build", "kind": "function", "path": "docforge.cli.commands.build", - "signature": "", - "docstring": "Build documentation (MkDocs site or MCP resources)." + "signature": "", + "docstring": "Build documentation (MkDocs site or MCP resources).\n\nThis command orchestrates the full build process:\n1. Introspects the code (Griffe)\n2. Renders sources (MkDocs Markdown or MCP JSON)\n3. (MkDocs only) Generates config and runs the final site build.\n\nArgs:\n mcp: Use the MCP documentation builder.\n mkdocs: Use the MkDocs documentation builder.\n module: The dotted path of the module to document.\n project_name: Optional override for the project name.\n site_name: (MkDocs) The site display name. Defaults to module name.\n docs_dir: (MkDocs) Target directory for Markdown sources.\n nav_file: (MkDocs) Path to the docforge.nav.yml specification.\n template: (MkDocs) Optional custom mkdocs.yml template.\n mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.\n out_dir: (MCP) Target directory for MCP JSON resources." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.commands.serve", - "signature": "", - "docstring": "Serve documentation." + "signature": "", + "docstring": "Serve documentation (MkDocs or MCP).\n\nArgs:\n mcp: Serve MCP resources via an MCP server.\n mkdocs: Serve the MkDocs site using the built-in development server.\n mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.\n out_dir: (MCP) Path to the mcp_docs/ directory." }, "tree": { "name": "tree", "kind": "function", "path": "docforge.cli.commands.tree", - "signature": "", - "docstring": "Visualize the project structure." + "signature": "", + "docstring": "Visualize the project structure in the terminal.\n\nArgs:\n modules: List of module import paths to recursively introspect.\n project_name: Optional override for the project name shown at the root." + }, + "Group": { + "name": "Group", + "kind": "alias", + "path": "docforge.cli.commands.Group", + "signature": "", + "docstring": null + }, + "Any": { + "name": "Any", + "kind": "alias", + "path": "docforge.cli.commands.Any", + "signature": "", + "docstring": null } } }, @@ -559,7 +573,7 @@ "kind": "function", "path": "docforge.cli.mcp_utils.MCPRenderer.generate_sources", "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + "docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." } } }, @@ -597,15 +611,15 @@ "name": "generate_resources", "kind": "function", "path": "docforge.cli.mcp_utils.generate_resources", - "signature": "", - "docstring": "Generate MCP-compatible documentation resources." + "signature": "", + "docstring": "Generate MCP-compatible documentation resources.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n out_dir: Directory where the MCP JSON resources and nav will be written." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.mcp_utils.serve", - "signature": "", - "docstring": "Serve MCP documentation." + "signature": "", + "docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/." } } }, @@ -731,29 +745,29 @@ "name": "generate_sources", "kind": "function", "path": "docforge.cli.mkdocs_utils.generate_sources", - "signature": "", - "docstring": "Generate Markdown source files for the specified module." + "signature": "", + "docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written." }, "generate_config": { "name": "generate_config", "kind": "function", "path": "docforge.cli.mkdocs_utils.generate_config", - "signature": "", - "docstring": "Generate an mkdocs.yml configuration file." + "signature": "", + "docstring": "Generate an mkdocs.yml configuration file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template (overrides built-in).\n out: Path where the final mkdocs.yml will be written.\n site_name: The display name for the documentation site." }, "build": { "name": "build", "kind": "function", "path": "docforge.cli.mkdocs_utils.build", - "signature": "", - "docstring": "Build the documentation site using MkDocs." + "signature": "", + "docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." }, "serve": { "name": "serve", "kind": "function", "path": "docforge.cli.mkdocs_utils.serve", - "signature": "", - "docstring": "Serve the documentation site with live-reload using MkDocs." + "signature": "", + "docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." } } } @@ -2088,7 +2102,7 @@ "kind": "function", "path": "docforge.renderers.MCPRenderer.generate_sources", "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + "docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." } } }, @@ -2425,7 +2439,7 @@ "name": "MCPRenderer", "kind": "class", "path": "docforge.renderers.mcp_renderer.MCPRenderer", - "signature": "", + "signature": "", "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", "members": { "name": { @@ -2439,8 +2453,8 @@ "name": "generate_sources", "kind": "function", "path": "docforge.renderers.mcp_renderer.MCPRenderer.generate_sources", - "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + "signature": "", + "docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." } } } diff --git a/mcp_docs/modules/docforge.renderers.json b/mcp_docs/modules/docforge.renderers.json index c04eebf..d46becc 100644 --- a/mcp_docs/modules/docforge.renderers.json +++ b/mcp_docs/modules/docforge.renderers.json @@ -46,7 +46,7 @@ "kind": "function", "path": "docforge.renderers.MCPRenderer.generate_sources", "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + "docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." } } }, @@ -383,7 +383,7 @@ "name": "MCPRenderer", "kind": "class", "path": "docforge.renderers.mcp_renderer.MCPRenderer", - "signature": "", + "signature": "", "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", "members": { "name": { @@ -397,8 +397,8 @@ "name": "generate_sources", "kind": "function", "path": "docforge.renderers.mcp_renderer.MCPRenderer.generate_sources", - "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + "signature": "", + "docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." } } } diff --git a/mcp_docs/modules/docforge.renderers.mcp_renderer.json b/mcp_docs/modules/docforge.renderers.mcp_renderer.json index 7e44750..0bcfd11 100644 --- a/mcp_docs/modules/docforge.renderers.mcp_renderer.json +++ b/mcp_docs/modules/docforge.renderers.mcp_renderer.json @@ -210,7 +210,7 @@ "name": "MCPRenderer", "kind": "class", "path": "docforge.renderers.mcp_renderer.MCPRenderer", - "signature": "", + "signature": "", "docstring": "Renderer that emits MCP-native JSON resources from docforge models.", "members": { "name": { @@ -224,8 +224,8 @@ "name": "generate_sources", "kind": "function", "path": "docforge.renderers.mcp_renderer.MCPRenderer.generate_sources", - "signature": "", - "docstring": "Generate MCP-compatible JSON resources and navigation for the project." + "signature": "", + "docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." } } } -- 2.49.1