Compare commits
2 Commits
15c59ab274
...
8e97e571b7
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e97e571b7 | |||
| 03caf5ce4c |
@@ -21,4 +21,8 @@ groups:
|
|||||||
CLI:
|
CLI:
|
||||||
- docforge/cli/index.md
|
- docforge/cli/index.md
|
||||||
- docforge/cli/main.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
|
||||||
|
|||||||
129
docforge/cli/commands.py
Normal file
129
docforge/cli/commands.py
Normal file
@@ -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 + "│ ")
|
||||||
@@ -1,268 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
Main entry point for the doc-forge CLI. This module defines the core command
|
Main entry point for the doc-forge CLI.
|
||||||
group and the 'tree', 'generate', 'build', and 'serve' commands.
|
|
||||||
"""
|
"""
|
||||||
|
from docforge.cli.commands import 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
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
"""
|
"""
|
||||||
@@ -270,6 +9,5 @@ def main() -> None:
|
|||||||
"""
|
"""
|
||||||
cli()
|
cli()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -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."""
|
|
||||||
0
docforge/cli/mcp/__init__.py
Normal file
0
docforge/cli/mcp/__init__.py
Normal file
39
docforge/cli/mcp/logic.py
Normal file
39
docforge/cli/mcp/logic.py
Normal file
@@ -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()
|
||||||
@@ -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}")
|
|
||||||
@@ -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:
|
|
||||||
...
|
|
||||||
0
docforge/cli/mkdocs/__init__.py
Normal file
0
docforge/cli/mkdocs/__init__.py
Normal file
69
docforge/cli/mkdocs/logic.py
Normal file
69
docforge/cli/mkdocs/logic.py
Normal file
@@ -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))
|
||||||
3
docs/docforge/cli/commands.md
Normal file
3
docs/docforge/cli/commands.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Commands
|
||||||
|
|
||||||
|
::: docforge.cli.commands
|
||||||
3
docs/docforge/cli/mcp/index.md
Normal file
3
docs/docforge/cli/mcp/index.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Mcp
|
||||||
|
|
||||||
|
::: docforge.cli.mcp
|
||||||
3
docs/docforge/cli/mcp/logic.md
Normal file
3
docs/docforge/cli/mcp/logic.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Logic
|
||||||
|
|
||||||
|
::: docforge.cli.mcp.logic
|
||||||
3
docs/docforge/cli/mkdocs/logic.md
Normal file
3
docs/docforge/cli/mkdocs/logic.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Logic
|
||||||
|
|
||||||
|
::: docforge.cli.mkdocs.logic
|
||||||
3
docs/docforge/servers/index.md
Normal file
3
docs/docforge/servers/index.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Servers
|
||||||
|
|
||||||
|
::: docforge.servers
|
||||||
3
docs/docforge/servers/mcp_server.md
Normal file
3
docs/docforge/servers/mcp_server.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Mcp Server
|
||||||
|
|
||||||
|
::: docforge.servers.mcp_server
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"project": "docforge",
|
"project": "docforge",
|
||||||
"type": "docforge-model",
|
"type": "docforge-model",
|
||||||
"modules_count": 20,
|
"modules_count": 24,
|
||||||
"source": "docforge"
|
"source": "docforge"
|
||||||
}
|
}
|
||||||
356
mcp_docs/modules/docforge.cli.commands.json
Normal file
356
mcp_docs/modules/docforge.cli.commands.json
Normal file
@@ -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": "<bound method Alias.signature of Alias('click', 'click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Sequence": {
|
||||||
|
"name": "Sequence",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.Sequence",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Sequence', 'typing.Sequence')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Optional": {
|
||||||
|
"name": "Optional",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.Optional",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('mkdocs_logic', 'docforge.cli.mkdocs.logic')>",
|
||||||
|
"docstring": null,
|
||||||
|
"members": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mkdocs.logic.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"resources": {
|
||||||
|
"name": "resources",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.resources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('resources', 'docforge.cli.mkdocs.logic.resources')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mkdocs.logic.click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"yaml": {
|
||||||
|
"name": "yaml",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.yaml",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('yaml', 'docforge.cli.mkdocs.logic.yaml')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mkdocs.logic.GriffeLoader')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mkdocs.logic.discover_module_paths')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('MkDocsRenderer', 'docforge.cli.mkdocs.logic.MkDocsRenderer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_nav_spec', 'docforge.cli.mkdocs.logic.load_nav_spec')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('resolve_nav', 'docforge.cli.mkdocs.logic.resolve_nav')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('MkDocsNavEmitter', 'docforge.cli.mkdocs.logic.MkDocsNavEmitter')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('emit', 'docforge.nav.mkdocs.MkDocsNavEmitter.emit')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('generate_sources', 'docforge.cli.mkdocs.logic.generate_sources')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('generate_config', 'docforge.cli.mkdocs.logic.generate_config')>",
|
||||||
|
"docstring": "Generate an mkdocs.yml configuration file."
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"name": "build",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.build",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('build', 'docforge.cli.mkdocs.logic.build')>",
|
||||||
|
"docstring": "Build the documentation site using MkDocs."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.serve",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mkdocs.logic.serve')>",
|
||||||
|
"docstring": "Serve the documentation site with live-reload using MkDocs."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mcp_logic": {
|
||||||
|
"name": "mcp_logic",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('mcp_logic', 'docforge.cli.mcp.logic')>",
|
||||||
|
"docstring": null,
|
||||||
|
"members": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mcp.logic.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mcp.logic.click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mcp.logic.GriffeLoader')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mcp.logic.discover_module_paths')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.cli.mcp.logic.MCPRenderer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.MCPRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>",
|
||||||
|
"docstring": "Generate MCP-compatible JSON resources and navigation for the project."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MCPServer": {
|
||||||
|
"name": "MCPServer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.MCPServer",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MCPServer', 'docforge.cli.mcp.logic.MCPServer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('mcp_root', 'docforge.servers.mcp_server.MCPServer.mcp_root')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"name": "app",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.MCPServer.app",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('app', 'docforge.servers.mcp_server.MCPServer.app')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"run": {
|
||||||
|
"name": "run",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.MCPServer.run",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('generate_resources', 'docforge.cli.mcp.logic.generate_resources')>",
|
||||||
|
"docstring": "Generate MCP-compatible documentation resources."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.serve",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp.logic.serve')>",
|
||||||
|
"docstring": "Serve MCP documentation."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"cli": {
|
||||||
|
"name": "cli",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.cli",
|
||||||
|
"signature": "<bound method Function.signature of Function('cli', 8, 14)>",
|
||||||
|
"docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation."
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"name": "build",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.build",
|
||||||
|
"signature": "<bound method Function.signature of Function('build', 16, 69)>",
|
||||||
|
"docstring": "Build documentation (MkDocs site or MCP resources)."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.serve",
|
||||||
|
"signature": "<bound method Function.signature of Function('serve', 71, 93)>",
|
||||||
|
"docstring": "Serve documentation."
|
||||||
|
},
|
||||||
|
"tree": {
|
||||||
|
"name": "tree",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.tree",
|
||||||
|
"signature": "<bound method Function.signature of Function('tree', 95, 121)>",
|
||||||
|
"docstring": "Visualize the project structure."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,174 +9,506 @@
|
|||||||
"kind": "module",
|
"kind": "module",
|
||||||
"path": "docforge.cli.main",
|
"path": "docforge.cli.main",
|
||||||
"signature": null,
|
"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": {
|
"members": {
|
||||||
|
"cli": {
|
||||||
|
"name": "cli",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.main.cli",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('cli', 'docforge.cli.commands.cli')>",
|
||||||
|
"docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation."
|
||||||
|
},
|
||||||
|
"main": {
|
||||||
|
"name": "main",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.main.main",
|
||||||
|
"signature": "<bound method Function.signature of Function('main', 6, 10)>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('click', 'click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
"Path": {
|
"Path": {
|
||||||
"name": "Path",
|
"name": "Path",
|
||||||
"kind": "alias",
|
"kind": "alias",
|
||||||
"path": "docforge.cli.main.Path",
|
"path": "docforge.cli.commands.Path",
|
||||||
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
"docstring": null
|
"docstring": null
|
||||||
},
|
},
|
||||||
"Sequence": {
|
"Sequence": {
|
||||||
"name": "Sequence",
|
"name": "Sequence",
|
||||||
"kind": "alias",
|
"kind": "alias",
|
||||||
"path": "docforge.cli.main.Sequence",
|
"path": "docforge.cli.commands.Sequence",
|
||||||
"signature": "<bound method Alias.signature of Alias('Sequence', 'typing.Sequence')>",
|
"signature": "<bound method Alias.signature of Alias('Sequence', 'typing.Sequence')>",
|
||||||
"docstring": null
|
"docstring": null
|
||||||
},
|
},
|
||||||
"Optional": {
|
"Optional": {
|
||||||
"name": "Optional",
|
"name": "Optional",
|
||||||
"kind": "alias",
|
"kind": "alias",
|
||||||
"path": "docforge.cli.main.Optional",
|
"path": "docforge.cli.commands.Optional",
|
||||||
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||||||
"docstring": null
|
"docstring": null
|
||||||
},
|
},
|
||||||
"click": {
|
|
||||||
"name": "click",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.main.click",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('click', 'click')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"GriffeLoader": {
|
"GriffeLoader": {
|
||||||
"name": "GriffeLoader",
|
"name": "GriffeLoader",
|
||||||
"kind": "class",
|
"kind": "class",
|
||||||
"path": "docforge.cli.main.GriffeLoader",
|
"path": "docforge.cli.commands.GriffeLoader",
|
||||||
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
|
||||||
"docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.",
|
"docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.",
|
||||||
"members": {
|
"members": {
|
||||||
"load_project": {
|
"load_project": {
|
||||||
"name": "load_project",
|
"name": "load_project",
|
||||||
"kind": "function",
|
"kind": "function",
|
||||||
"path": "docforge.cli.main.GriffeLoader.load_project",
|
"path": "docforge.cli.commands.GriffeLoader.load_project",
|
||||||
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||||||
"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."
|
"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": {
|
"load_module": {
|
||||||
"name": "load_module",
|
"name": "load_module",
|
||||||
"kind": "function",
|
"kind": "function",
|
||||||
"path": "docforge.cli.main.GriffeLoader.load_module",
|
"path": "docforge.cli.commands.GriffeLoader.load_module",
|
||||||
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
"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."
|
"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": {
|
"mkdocs_logic": {
|
||||||
"name": "discover_module_paths",
|
"name": "mkdocs_logic",
|
||||||
"kind": "function",
|
"kind": "module",
|
||||||
"path": "docforge.cli.main.discover_module_paths",
|
"path": "docforge.cli.commands.mkdocs_logic",
|
||||||
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>",
|
"signature": "<bound method Alias.signature of Alias('mkdocs_logic', 'docforge.cli.mkdocs.logic')>",
|
||||||
"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."
|
"docstring": null,
|
||||||
},
|
|
||||||
"MkDocsRenderer": {
|
|
||||||
"name": "MkDocsRenderer",
|
|
||||||
"kind": "class",
|
|
||||||
"path": "docforge.cli.main.MkDocsRenderer",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('MkDocsRenderer', 'docforge.renderers.MkDocsRenderer')>",
|
|
||||||
"docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
|
|
||||||
"members": {
|
"members": {
|
||||||
"name": {
|
"Path": {
|
||||||
"name": "name",
|
"name": "Path",
|
||||||
"kind": "attribute",
|
"kind": "alias",
|
||||||
"path": "docforge.cli.main.MkDocsRenderer.name",
|
"path": "docforge.cli.commands.mkdocs_logic.Path",
|
||||||
"signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.name')>",
|
"signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mkdocs.logic.Path')>",
|
||||||
"docstring": null
|
"docstring": null
|
||||||
},
|
},
|
||||||
|
"resources": {
|
||||||
|
"name": "resources",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.resources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('resources', 'docforge.cli.mkdocs.logic.resources')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mkdocs.logic.click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"yaml": {
|
||||||
|
"name": "yaml",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.yaml",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('yaml', 'docforge.cli.mkdocs.logic.yaml')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mkdocs.logic.GriffeLoader')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mkdocs.logic.discover_module_paths')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('MkDocsRenderer', 'docforge.cli.mkdocs.logic.MkDocsRenderer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_nav_spec', 'docforge.cli.mkdocs.logic.load_nav_spec')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('resolve_nav', 'docforge.cli.mkdocs.logic.resolve_nav')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('MkDocsNavEmitter', 'docforge.cli.mkdocs.logic.MkDocsNavEmitter')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('emit', 'docforge.nav.mkdocs.MkDocsNavEmitter.emit')>",
|
||||||
|
"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": {
|
"generate_sources": {
|
||||||
"name": "generate_sources",
|
"name": "generate_sources",
|
||||||
"kind": "function",
|
"kind": "function",
|
||||||
"path": "docforge.cli.main.MkDocsRenderer.generate_sources",
|
"path": "docforge.cli.commands.mkdocs_logic.generate_sources",
|
||||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.cli.mkdocs.logic.generate_sources')>",
|
||||||
"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."
|
"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": "<bound method Alias.signature of Alias('generate_config', 'docforge.cli.mkdocs.logic.generate_config')>",
|
||||||
|
"docstring": "Generate an mkdocs.yml configuration file."
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"name": "build",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.build",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('build', 'docforge.cli.mkdocs.logic.build')>",
|
||||||
|
"docstring": "Build the documentation site using MkDocs."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_logic.serve",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mkdocs.logic.serve')>",
|
||||||
|
"docstring": "Serve the documentation site with live-reload using MkDocs."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"MCPRenderer": {
|
"mcp_logic": {
|
||||||
"name": "MCPRenderer",
|
"name": "mcp_logic",
|
||||||
"kind": "class",
|
"kind": "module",
|
||||||
"path": "docforge.cli.main.MCPRenderer",
|
"path": "docforge.cli.commands.mcp_logic",
|
||||||
"signature": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.renderers.MCPRenderer')>",
|
"signature": "<bound method Alias.signature of Alias('mcp_logic', 'docforge.cli.mcp.logic')>",
|
||||||
"docstring": "Renderer that emits MCP-native JSON resources from docforge models.",
|
"docstring": null,
|
||||||
"members": {
|
"members": {
|
||||||
"name": {
|
"Path": {
|
||||||
"name": "name",
|
"name": "Path",
|
||||||
"kind": "attribute",
|
"kind": "alias",
|
||||||
"path": "docforge.cli.main.MCPRenderer.name",
|
"path": "docforge.cli.commands.mcp_logic.Path",
|
||||||
"signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>",
|
"signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mcp.logic.Path')>",
|
||||||
"docstring": null
|
"docstring": null
|
||||||
},
|
},
|
||||||
"generate_sources": {
|
"click": {
|
||||||
"name": "generate_sources",
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mcp.logic.click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mcp.logic.GriffeLoader')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"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",
|
"kind": "function",
|
||||||
"path": "docforge.cli.main.MCPRenderer.generate_sources",
|
"path": "docforge.cli.commands.mcp_logic.discover_module_paths",
|
||||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>",
|
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mcp.logic.discover_module_paths')>",
|
||||||
"docstring": "Generate MCP-compatible JSON resources and navigation for the project."
|
"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": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.cli.mcp.logic.MCPRenderer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.MCPRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>",
|
||||||
|
"docstring": "Generate MCP-compatible JSON resources and navigation for the project."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MCPServer": {
|
||||||
|
"name": "MCPServer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.MCPServer",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MCPServer', 'docforge.cli.mcp.logic.MCPServer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('mcp_root', 'docforge.servers.mcp_server.MCPServer.mcp_root')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"name": "app",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.MCPServer.app",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('app', 'docforge.servers.mcp_server.MCPServer.app')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"run": {
|
||||||
|
"name": "run",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.MCPServer.run",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('generate_resources', 'docforge.cli.mcp.logic.generate_resources')>",
|
||||||
|
"docstring": "Generate MCP-compatible documentation resources."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_logic.serve",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp.logic.serve')>",
|
||||||
|
"docstring": "Serve MCP documentation."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mkdocs_cmd": {
|
|
||||||
"name": "mkdocs_cmd",
|
|
||||||
"kind": "function",
|
|
||||||
"path": "docforge.cli.main.mkdocs_cmd",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('mkdocs_cmd', 'docforge.cli.mkdocs.mkdocs_cmd')>",
|
|
||||||
"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": {
|
"cli": {
|
||||||
"name": "cli",
|
"name": "cli",
|
||||||
"kind": "function",
|
"kind": "function",
|
||||||
"path": "docforge.cli.main.cli",
|
"path": "docforge.cli.commands.cli",
|
||||||
"signature": "<bound method Function.signature of Function('cli', 16, 22)>",
|
"signature": "<bound method Function.signature of Function('cli', 8, 14)>",
|
||||||
"docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation."
|
"docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation."
|
||||||
},
|
},
|
||||||
"tree": {
|
|
||||||
"name": "tree",
|
|
||||||
"kind": "function",
|
|
||||||
"path": "docforge.cli.main.tree",
|
|
||||||
"signature": "<bound method Function.signature of Function('tree', 31, 62)>",
|
|
||||||
"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": "<bound method Function.signature of Function('generate', 82, 122)>",
|
|
||||||
"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": "<bound method Function.signature of Function('generate_mcp', 129, 168)>",
|
|
||||||
"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": {
|
"build": {
|
||||||
"name": "build",
|
"name": "build",
|
||||||
"kind": "function",
|
"kind": "function",
|
||||||
"path": "docforge.cli.main.build",
|
"path": "docforge.cli.commands.build",
|
||||||
"signature": "<bound method Function.signature of Function('build', 175, 196)>",
|
"signature": "<bound method Function.signature of Function('build', 16, 69)>",
|
||||||
"docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
|
"docstring": "Build documentation (MkDocs site or MCP resources)."
|
||||||
},
|
|
||||||
"serve_mcp": {
|
|
||||||
"name": "serve_mcp",
|
|
||||||
"kind": "function",
|
|
||||||
"path": "docforge.cli.main.serve_mcp",
|
|
||||||
"signature": "<bound method Function.signature of Function('serve_mcp', 203, 230)>",
|
|
||||||
"docstring": "Serve MCP documentation from the local mcp_docs directory."
|
|
||||||
},
|
},
|
||||||
"serve": {
|
"serve": {
|
||||||
"name": "serve",
|
"name": "serve",
|
||||||
"kind": "function",
|
"kind": "function",
|
||||||
"path": "docforge.cli.main.serve",
|
"path": "docforge.cli.commands.serve",
|
||||||
"signature": "<bound method Function.signature of Function('serve', 237, 260)>",
|
"signature": "<bound method Function.signature of Function('serve', 71, 93)>",
|
||||||
"docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
|
"docstring": "Serve documentation."
|
||||||
},
|
},
|
||||||
"main": {
|
"tree": {
|
||||||
"name": "main",
|
"name": "tree",
|
||||||
"kind": "function",
|
"kind": "function",
|
||||||
"path": "docforge.cli.main.main",
|
"path": "docforge.cli.commands.tree",
|
||||||
"signature": "<bound method Function.signature of Function('main', 267, 271)>",
|
"signature": "<bound method Function.signature of Function('tree', 95, 121)>",
|
||||||
"docstring": "CLI Entry point. Boots the click application."
|
"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": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mcp.logic.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.mcp.logic.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.renderers.MCPRenderer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mcp.logic.MCPRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>",
|
||||||
|
"docstring": "Generate MCP-compatible JSON resources and navigation for the project."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MCPServer": {
|
||||||
|
"name": "MCPServer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.mcp.logic.MCPServer",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MCPServer', 'docforge.servers.MCPServer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('mcp_root', 'docforge.servers.mcp_server.MCPServer.mcp_root')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"name": "app",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.mcp.logic.MCPServer.app",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('app', 'docforge.servers.mcp_server.MCPServer.app')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"run": {
|
||||||
|
"name": "run",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mcp.logic.MCPServer.run",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>",
|
||||||
|
"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": "<bound method Function.signature of Function('generate_resources', 7, 16)>",
|
||||||
|
"docstring": "Generate MCP-compatible documentation resources."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mcp.logic.serve",
|
||||||
|
"signature": "<bound method Function.signature of Function('serve', 18, 39)>",
|
||||||
|
"docstring": "Serve MCP documentation."
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -185,93 +517,155 @@
|
|||||||
"kind": "module",
|
"kind": "module",
|
||||||
"path": "docforge.cli.mkdocs",
|
"path": "docforge.cli.mkdocs",
|
||||||
"signature": null,
|
"signature": null,
|
||||||
"docstring": "This module contains the 'mkdocs' CLI command, which orchestrates the generation\nof the main mkdocs.yml configuration file.",
|
"docstring": null,
|
||||||
"members": {
|
"members": {
|
||||||
"Path": {
|
"logic": {
|
||||||
"name": "Path",
|
"name": "logic",
|
||||||
"kind": "alias",
|
"kind": "module",
|
||||||
"path": "docforge.cli.mkdocs.Path",
|
"path": "docforge.cli.mkdocs.logic",
|
||||||
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
"signature": null,
|
||||||
"docstring": null
|
"docstring": null,
|
||||||
},
|
|
||||||
"resources": {
|
|
||||||
"name": "resources",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.mkdocs.resources",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('resources', 'importlib.resources')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"click": {
|
|
||||||
"name": "click",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.mkdocs.click",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('click', 'click')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"yaml": {
|
|
||||||
"name": "yaml",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.mkdocs.yaml",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('yaml', 'yaml')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"load_nav_spec": {
|
|
||||||
"name": "load_nav_spec",
|
|
||||||
"kind": "function",
|
|
||||||
"path": "docforge.cli.mkdocs.load_nav_spec",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('load_nav_spec', 'docforge.nav.load_nav_spec')>",
|
|
||||||
"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": "<bound method Alias.signature of Alias('resolve_nav', 'docforge.nav.resolve_nav')>",
|
|
||||||
"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": "<bound method Alias.signature of Alias('MkDocsNavEmitter', 'docforge.nav.MkDocsNavEmitter')>",
|
|
||||||
"docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.",
|
|
||||||
"members": {
|
"members": {
|
||||||
"emit": {
|
"Path": {
|
||||||
"name": "emit",
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"resources": {
|
||||||
|
"name": "resources",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.resources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('resources', 'importlib.resources')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"yaml": {
|
||||||
|
"name": "yaml",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.yaml",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('yaml', 'yaml')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"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",
|
"kind": "function",
|
||||||
"path": "docforge.cli.mkdocs.MkDocsNavEmitter.emit",
|
"path": "docforge.cli.mkdocs.logic.discover_module_paths",
|
||||||
"signature": "<bound method Alias.signature of Alias('emit', 'docforge.nav.mkdocs.MkDocsNavEmitter.emit')>",
|
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>",
|
||||||
"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."
|
"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": "<bound method Alias.signature of Alias('MkDocsRenderer', 'docforge.renderers.MkDocsRenderer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.MkDocsRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_nav_spec', 'docforge.nav.load_nav_spec')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('resolve_nav', 'docforge.nav.resolve_nav')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('MkDocsNavEmitter', 'docforge.nav.MkDocsNavEmitter')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('emit', 'docforge.nav.mkdocs.MkDocsNavEmitter.emit')>",
|
||||||
|
"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": "<bound method Function.signature of Function('generate_sources', 9, 18)>",
|
||||||
|
"docstring": "Generate Markdown source files for the specified module."
|
||||||
|
},
|
||||||
|
"generate_config": {
|
||||||
|
"name": "generate_config",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.generate_config",
|
||||||
|
"signature": "<bound method Function.signature of Function('generate_config', 20, 47)>",
|
||||||
|
"docstring": "Generate an mkdocs.yml configuration file."
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"name": "build",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.build",
|
||||||
|
"signature": "<bound method Function.signature of Function('build', 49, 59)>",
|
||||||
|
"docstring": "Build the documentation site using MkDocs."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.serve",
|
||||||
|
"signature": "<bound method Function.signature of Function('serve', 61, 69)>",
|
||||||
|
"docstring": "Serve the documentation site with live-reload using MkDocs."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"mkdocs_cmd": {
|
|
||||||
"name": "mkdocs_cmd",
|
|
||||||
"kind": "function",
|
|
||||||
"path": "docforge.cli.mkdocs.mkdocs_cmd",
|
|
||||||
"signature": "<bound method Function.signature of Function('mkdocs_cmd', 42, 116)>",
|
|
||||||
"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": "<bound method Alias.signature of Alias('Any', 'typing.Any')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"Dict": {
|
|
||||||
"name": "Dict",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.mkdocs.Dict",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"Optional": {
|
|
||||||
"name": "Optional",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.mkdocs.Optional",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
|
||||||
"docstring": null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,173 +2,20 @@
|
|||||||
"module": "docforge.cli.main",
|
"module": "docforge.cli.main",
|
||||||
"content": {
|
"content": {
|
||||||
"path": "docforge.cli.main",
|
"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": {
|
"objects": {
|
||||||
"Path": {
|
|
||||||
"name": "Path",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.main.Path",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"Sequence": {
|
|
||||||
"name": "Sequence",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.main.Sequence",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('Sequence', 'typing.Sequence')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"Optional": {
|
|
||||||
"name": "Optional",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.main.Optional",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"click": {
|
|
||||||
"name": "click",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.main.click",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('click', 'click')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"GriffeLoader": {
|
|
||||||
"name": "GriffeLoader",
|
|
||||||
"kind": "class",
|
|
||||||
"path": "docforge.cli.main.GriffeLoader",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
|
|
||||||
"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": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
|
||||||
"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": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
|
||||||
"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": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>",
|
|
||||||
"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": "<bound method Alias.signature of Alias('MkDocsRenderer', 'docforge.renderers.MkDocsRenderer')>",
|
|
||||||
"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": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.name')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"generate_sources": {
|
|
||||||
"name": "generate_sources",
|
|
||||||
"kind": "function",
|
|
||||||
"path": "docforge.cli.main.MkDocsRenderer.generate_sources",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
|
||||||
"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": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.renderers.MCPRenderer')>",
|
|
||||||
"docstring": "Renderer that emits MCP-native JSON resources from docforge models.",
|
|
||||||
"members": {
|
|
||||||
"name": {
|
|
||||||
"name": "name",
|
|
||||||
"kind": "attribute",
|
|
||||||
"path": "docforge.cli.main.MCPRenderer.name",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"generate_sources": {
|
|
||||||
"name": "generate_sources",
|
|
||||||
"kind": "function",
|
|
||||||
"path": "docforge.cli.main.MCPRenderer.generate_sources",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>",
|
|
||||||
"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": "<bound method Alias.signature of Alias('mkdocs_cmd', 'docforge.cli.mkdocs.mkdocs_cmd')>",
|
|
||||||
"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": {
|
"cli": {
|
||||||
"name": "cli",
|
"name": "cli",
|
||||||
"kind": "function",
|
"kind": "function",
|
||||||
"path": "docforge.cli.main.cli",
|
"path": "docforge.cli.main.cli",
|
||||||
"signature": "<bound method Function.signature of Function('cli', 16, 22)>",
|
"signature": "<bound method Alias.signature of Alias('cli', 'docforge.cli.commands.cli')>",
|
||||||
"docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation."
|
"docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation."
|
||||||
},
|
},
|
||||||
"tree": {
|
|
||||||
"name": "tree",
|
|
||||||
"kind": "function",
|
|
||||||
"path": "docforge.cli.main.tree",
|
|
||||||
"signature": "<bound method Function.signature of Function('tree', 31, 62)>",
|
|
||||||
"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": "<bound method Function.signature of Function('generate', 82, 122)>",
|
|
||||||
"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": "<bound method Function.signature of Function('generate_mcp', 129, 168)>",
|
|
||||||
"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": "<bound method Function.signature of Function('build', 175, 196)>",
|
|
||||||
"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": "<bound method Function.signature of Function('serve_mcp', 203, 230)>",
|
|
||||||
"docstring": "Serve MCP documentation from the local mcp_docs directory."
|
|
||||||
},
|
|
||||||
"serve": {
|
|
||||||
"name": "serve",
|
|
||||||
"kind": "function",
|
|
||||||
"path": "docforge.cli.main.serve",
|
|
||||||
"signature": "<bound method Function.signature of Function('serve', 237, 260)>",
|
|
||||||
"docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
|
|
||||||
},
|
|
||||||
"main": {
|
"main": {
|
||||||
"name": "main",
|
"name": "main",
|
||||||
"kind": "function",
|
"kind": "function",
|
||||||
"path": "docforge.cli.main.main",
|
"path": "docforge.cli.main.main",
|
||||||
"signature": "<bound method Function.signature of Function('main', 267, 271)>",
|
"signature": "<bound method Function.signature of Function('main', 6, 10)>",
|
||||||
"docstring": "CLI Entry point. Boots the click application."
|
"docstring": "CLI Entry point. Boots the click application."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
129
mcp_docs/modules/docforge.cli.mcp.json
Normal file
129
mcp_docs/modules/docforge.cli.mcp.json
Normal file
@@ -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": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mcp.logic.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.mcp.logic.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.renderers.MCPRenderer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mcp.logic.MCPRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>",
|
||||||
|
"docstring": "Generate MCP-compatible JSON resources and navigation for the project."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MCPServer": {
|
||||||
|
"name": "MCPServer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.mcp.logic.MCPServer",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MCPServer', 'docforge.servers.MCPServer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('mcp_root', 'docforge.servers.mcp_server.MCPServer.mcp_root')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"name": "app",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.mcp.logic.MCPServer.app",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('app', 'docforge.servers.mcp_server.MCPServer.app')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"run": {
|
||||||
|
"name": "run",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mcp.logic.MCPServer.run",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>",
|
||||||
|
"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": "<bound method Function.signature of Function('generate_resources', 7, 16)>",
|
||||||
|
"docstring": "Generate MCP-compatible documentation resources."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mcp.logic.serve",
|
||||||
|
"signature": "<bound method Function.signature of Function('serve', 18, 39)>",
|
||||||
|
"docstring": "Serve MCP documentation."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
mcp_docs/modules/docforge.cli.mcp.logic.json
Normal file
120
mcp_docs/modules/docforge.cli.mcp.logic.json
Normal file
@@ -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": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mcp.logic.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.mcp.logic.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.renderers.MCPRenderer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mcp.logic.MCPRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>",
|
||||||
|
"docstring": "Generate MCP-compatible JSON resources and navigation for the project."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MCPServer": {
|
||||||
|
"name": "MCPServer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.mcp.logic.MCPServer",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MCPServer', 'docforge.servers.MCPServer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('mcp_root', 'docforge.servers.mcp_server.MCPServer.mcp_root')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"name": "app",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.mcp.logic.MCPServer.app",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('app', 'docforge.servers.mcp_server.MCPServer.app')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"run": {
|
||||||
|
"name": "run",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mcp.logic.MCPServer.run",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>",
|
||||||
|
"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": "<bound method Function.signature of Function('generate_resources', 7, 16)>",
|
||||||
|
"docstring": "Generate MCP-compatible documentation resources."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mcp.logic.serve",
|
||||||
|
"signature": "<bound method Function.signature of Function('serve', 18, 39)>",
|
||||||
|
"docstring": "Serve MCP documentation."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,93 +2,155 @@
|
|||||||
"module": "docforge.cli.mkdocs",
|
"module": "docforge.cli.mkdocs",
|
||||||
"content": {
|
"content": {
|
||||||
"path": "docforge.cli.mkdocs",
|
"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": {
|
"objects": {
|
||||||
"Path": {
|
"logic": {
|
||||||
"name": "Path",
|
"name": "logic",
|
||||||
"kind": "alias",
|
"kind": "module",
|
||||||
"path": "docforge.cli.mkdocs.Path",
|
"path": "docforge.cli.mkdocs.logic",
|
||||||
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
"signature": null,
|
||||||
"docstring": null
|
"docstring": null,
|
||||||
},
|
|
||||||
"resources": {
|
|
||||||
"name": "resources",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.mkdocs.resources",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('resources', 'importlib.resources')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"click": {
|
|
||||||
"name": "click",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.mkdocs.click",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('click', 'click')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"yaml": {
|
|
||||||
"name": "yaml",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.mkdocs.yaml",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('yaml', 'yaml')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"load_nav_spec": {
|
|
||||||
"name": "load_nav_spec",
|
|
||||||
"kind": "function",
|
|
||||||
"path": "docforge.cli.mkdocs.load_nav_spec",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('load_nav_spec', 'docforge.nav.load_nav_spec')>",
|
|
||||||
"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": "<bound method Alias.signature of Alias('resolve_nav', 'docforge.nav.resolve_nav')>",
|
|
||||||
"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": "<bound method Alias.signature of Alias('MkDocsNavEmitter', 'docforge.nav.MkDocsNavEmitter')>",
|
|
||||||
"docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.",
|
|
||||||
"members": {
|
"members": {
|
||||||
"emit": {
|
"Path": {
|
||||||
"name": "emit",
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"resources": {
|
||||||
|
"name": "resources",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.resources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('resources', 'importlib.resources')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"yaml": {
|
||||||
|
"name": "yaml",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.yaml",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('yaml', 'yaml')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"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",
|
"kind": "function",
|
||||||
"path": "docforge.cli.mkdocs.MkDocsNavEmitter.emit",
|
"path": "docforge.cli.mkdocs.logic.discover_module_paths",
|
||||||
"signature": "<bound method Alias.signature of Alias('emit', 'docforge.nav.mkdocs.MkDocsNavEmitter.emit')>",
|
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>",
|
||||||
"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."
|
"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": "<bound method Alias.signature of Alias('MkDocsRenderer', 'docforge.renderers.MkDocsRenderer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.MkDocsRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_nav_spec', 'docforge.nav.load_nav_spec')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('resolve_nav', 'docforge.nav.resolve_nav')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('MkDocsNavEmitter', 'docforge.nav.MkDocsNavEmitter')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('emit', 'docforge.nav.mkdocs.MkDocsNavEmitter.emit')>",
|
||||||
|
"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": "<bound method Function.signature of Function('generate_sources', 9, 18)>",
|
||||||
|
"docstring": "Generate Markdown source files for the specified module."
|
||||||
|
},
|
||||||
|
"generate_config": {
|
||||||
|
"name": "generate_config",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.generate_config",
|
||||||
|
"signature": "<bound method Function.signature of Function('generate_config', 20, 47)>",
|
||||||
|
"docstring": "Generate an mkdocs.yml configuration file."
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"name": "build",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.build",
|
||||||
|
"signature": "<bound method Function.signature of Function('build', 49, 59)>",
|
||||||
|
"docstring": "Build the documentation site using MkDocs."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.serve",
|
||||||
|
"signature": "<bound method Function.signature of Function('serve', 61, 69)>",
|
||||||
|
"docstring": "Serve the documentation site with live-reload using MkDocs."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"mkdocs_cmd": {
|
|
||||||
"name": "mkdocs_cmd",
|
|
||||||
"kind": "function",
|
|
||||||
"path": "docforge.cli.mkdocs.mkdocs_cmd",
|
|
||||||
"signature": "<bound method Function.signature of Function('mkdocs_cmd', 42, 116)>",
|
|
||||||
"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": "<bound method Alias.signature of Alias('Any', 'typing.Any')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"Dict": {
|
|
||||||
"name": "Dict",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.mkdocs.Dict",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
|
||||||
"docstring": null
|
|
||||||
},
|
|
||||||
"Optional": {
|
|
||||||
"name": "Optional",
|
|
||||||
"kind": "alias",
|
|
||||||
"path": "docforge.cli.mkdocs.Optional",
|
|
||||||
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
|
||||||
"docstring": null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
148
mcp_docs/modules/docforge.cli.mkdocs.logic.json
Normal file
148
mcp_docs/modules/docforge.cli.mkdocs.logic.json
Normal file
@@ -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": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"resources": {
|
||||||
|
"name": "resources",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.resources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('resources', 'importlib.resources')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"yaml": {
|
||||||
|
"name": "yaml",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.yaml",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('yaml', 'yaml')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('MkDocsRenderer', 'docforge.renderers.MkDocsRenderer')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.MkDocsRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('load_nav_spec', 'docforge.nav.load_nav_spec')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('resolve_nav', 'docforge.nav.resolve_nav')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('MkDocsNavEmitter', 'docforge.nav.MkDocsNavEmitter')>",
|
||||||
|
"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": "<bound method Alias.signature of Alias('emit', 'docforge.nav.mkdocs.MkDocsNavEmitter.emit')>",
|
||||||
|
"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": "<bound method Function.signature of Function('generate_sources', 9, 18)>",
|
||||||
|
"docstring": "Generate Markdown source files for the specified module."
|
||||||
|
},
|
||||||
|
"generate_config": {
|
||||||
|
"name": "generate_config",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.generate_config",
|
||||||
|
"signature": "<bound method Function.signature of Function('generate_config', 20, 47)>",
|
||||||
|
"docstring": "Generate an mkdocs.yml configuration file."
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"name": "build",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.build",
|
||||||
|
"signature": "<bound method Function.signature of Function('build', 49, 59)>",
|
||||||
|
"docstring": "Build the documentation site using MkDocs."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mkdocs.logic.serve",
|
||||||
|
"signature": "<bound method Function.signature of Function('serve', 61, 69)>",
|
||||||
|
"docstring": "Serve the documentation site with live-reload using MkDocs."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -7,14 +7,30 @@
|
|||||||
"module": "docforge.cli",
|
"module": "docforge.cli",
|
||||||
"resource": "doc://modules/docforge.cli"
|
"resource": "doc://modules/docforge.cli"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.cli.commands",
|
||||||
|
"resource": "doc://modules/docforge.cli.commands"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"module": "docforge.cli.main",
|
"module": "docforge.cli.main",
|
||||||
"resource": "doc://modules/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",
|
"module": "docforge.cli.mkdocs",
|
||||||
"resource": "doc://modules/docforge.cli.mkdocs"
|
"resource": "doc://modules/docforge.cli.mkdocs"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.cli.mkdocs.logic",
|
||||||
|
"resource": "doc://modules/docforge.cli.mkdocs.logic"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"module": "docforge.loaders",
|
"module": "docforge.loaders",
|
||||||
"resource": "doc://modules/docforge.loaders"
|
"resource": "doc://modules/docforge.loaders"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
site_name: DocForge
|
site_name: docforge
|
||||||
|
|
||||||
theme:
|
theme:
|
||||||
name: material
|
name: material
|
||||||
@@ -57,4 +57,8 @@ nav:
|
|||||||
- CLI:
|
- CLI:
|
||||||
- docforge/cli/index.md
|
- docforge/cli/index.md
|
||||||
- docforge/cli/main.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
|
||||||
|
|||||||
@@ -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"]
|
|
||||||
@@ -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
|
|
||||||
@@ -1,35 +1,31 @@
|
|||||||
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from click.testing import CliRunner
|
||||||
from docforge.cli.main import cli
|
from docforge.cli.main import cli
|
||||||
|
|
||||||
|
def test_mcp_build(cli_runner):
|
||||||
def test_generate_command(cli_runner):
|
|
||||||
with cli_runner.isolated_filesystem():
|
with cli_runner.isolated_filesystem():
|
||||||
cwd = Path.cwd()
|
cwd = Path.cwd()
|
||||||
|
|
||||||
# Create package structure
|
|
||||||
pkg = cwd / "testpkg"
|
pkg = cwd / "testpkg"
|
||||||
pkg.mkdir()
|
pkg.mkdir()
|
||||||
(pkg / "__init__.py").write_text("")
|
(pkg / "__init__.py").write_text("")
|
||||||
(pkg / "mod.py").write_text("def f(): ...\n")
|
(pkg / "mod.py").write_text("def f(): ...\n")
|
||||||
|
|
||||||
docs_dir = cwd / "docs"
|
out_dir = cwd / "mcp_docs"
|
||||||
|
|
||||||
result = cli_runner.invoke(
|
result = cli_runner.invoke(
|
||||||
cli,
|
cli,
|
||||||
[
|
[
|
||||||
"generate",
|
"build",
|
||||||
|
"--mcp",
|
||||||
"--module",
|
"--module",
|
||||||
"testpkg",
|
"testpkg",
|
||||||
"--docs-dir",
|
"--out-dir",
|
||||||
str(docs_dir),
|
str(out_dir),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
|
assert (out_dir / "index.json").exists()
|
||||||
md = docs_dir / "testpkg" / "mod.md"
|
assert (out_dir / "nav.json").exists()
|
||||||
assert md.exists()
|
assert (out_dir / "modules" / "testpkg.mod.json").exists()
|
||||||
|
|
||||||
content = md.read_text()
|
|
||||||
assert "::: testpkg.mod" in content
|
|
||||||
54
tests/cli/test_build_mkdocs.py
Normal file
54
tests/cli/test_build_mkdocs.py
Normal file
@@ -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
|
||||||
@@ -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
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
from docforge.cli.main import cli
|
from docforge.cli.main import cli
|
||||||
|
|
||||||
|
def test_mcp_serve(
|
||||||
def test_serve_mcp(
|
|
||||||
cli_runner,
|
cli_runner,
|
||||||
fake_mcp_docs,
|
fake_mcp_docs,
|
||||||
mock_mcp_server_run,
|
mock_mcp_server_run,
|
||||||
@@ -11,7 +10,7 @@ def test_serve_mcp(
|
|||||||
|
|
||||||
result = cli_runner.invoke(
|
result = cli_runner.invoke(
|
||||||
cli,
|
cli,
|
||||||
["serve-mcp"],
|
["serve", "--mcp", "--out-dir", str(fake_mcp_docs)],
|
||||||
)
|
)
|
||||||
|
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
from docforge.cli.main import cli
|
from docforge.cli.main import cli
|
||||||
|
|
||||||
|
def test_mkdocs_serve(
|
||||||
def test_serve_command(
|
|
||||||
cli_runner,
|
cli_runner,
|
||||||
fake_mkdocs_yml,
|
fake_mkdocs_yml,
|
||||||
mock_mkdocs_serve,
|
mock_mkdocs_serve,
|
||||||
@@ -10,6 +9,7 @@ def test_serve_command(
|
|||||||
cli,
|
cli,
|
||||||
[
|
[
|
||||||
"serve",
|
"serve",
|
||||||
|
"--mkdocs",
|
||||||
"--mkdocs-yml",
|
"--mkdocs-yml",
|
||||||
str(fake_mkdocs_yml),
|
str(fake_mkdocs_yml),
|
||||||
],
|
],
|
||||||
@@ -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
|
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
import sys
|
import sys
|
||||||
|
import json
|
||||||
|
import pytest
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
from click.testing import CliRunner
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@@ -16,3 +18,109 @@ def temp_package(tmp_path: Path):
|
|||||||
sys.path.insert(0, str(tmp_path))
|
sys.path.insert(0, str(tmp_path))
|
||||||
yield pkg
|
yield pkg
|
||||||
sys.path.remove(str(tmp_path))
|
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"]
|
||||||
|
|||||||
Reference in New Issue
Block a user