Compare commits

2 Commits

Author SHA1 Message Date
8e97e571b7 site name correct position 2026-01-21 18:00:34 +05:30
03caf5ce4c refactor: restructure CLI and improve documentation/typing
- Consolidated CLI commands into [build](cci:1://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/docforge/cli/mkdocs/logic.py:48:0-58:46) and [serve](cci:1://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/docforge/cli/commands.py:70:0-92:32) using `--mkdocs` and `--mcp` flags.
- Separated CLI orchestration logic into [docforge/cli/mkdocs/logic.py](cci:7://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/docforge/cli/mkdocs/logic.py:0:0-0:0) and [docforge/cli/mcp/logic.py](cci:7://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/docforge/cli/mcp/logic.py:0:0-0:0).
- Moved command definitions to [docforge/cli/commands.py](cci:7://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/docforge/cli/commands.py:0:0-0:0), making [main.py](cci:7://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/docforge/cli/main.py:0:0-0:0) a thin entry point.
- Aligned [.pyi](cci:7://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/docforge/cli/main.pyi:0:0-0:0) type stubs with [.py](cci:7://file:///c:/Users/vishe/WorkSpace/code/aetos/doc-forge/tests/conftest.py:0:0-0:0) implementations across the package.
- Added missing docstrings to internal helper functions and core classes.
- Restructured tests into `tests/mkdocs/` and `tests/mcp/`.
- Updated navigation specification to reflect the new project structure.
2026-01-21 17:59:46 +05:30
38 changed files with 1536 additions and 1117 deletions

327
ADS.llm.md Normal file
View File

@@ -0,0 +1,327 @@
# doc-forge — Architecture & Design Specification
**doc-forge** is a renderer-agnostic Python documentation compiler. It converts Python source code and docstrings into a structured, semantic documentation model and then emits multiple downstream representations, including:
* Human-facing documentation sites (MkDocs, Sphinx)
* Machine-facing documentation bundles (MCP JSON)
* Live documentation APIs (MCP servers)
This document is the **authoritative design and codebase specification** for the library. It is written to be both **LLM-friendly** and **developer-facing**, and should be treated as the canonical reference for implementation decisions.
---
## 1. Design Goals
1. **Single Source of Truth**
Python source code and docstrings are the only authoritative input.
2. **Renderer Agnosticism**
MkDocs, Sphinx, MCP, or future renderers must not influence the core model.
3. **Deterministic Output**
Given the same codebase, outputs must be reproducible.
4. **AI-Native Documentation**
Documentation must be structured, queryable, and machine-consumable.
5. **Library-First, CLI-Second**
All functionality must be accessible as a Python API. The CLI is a thin wrapper.
---
## 2. Core Mental Model
### Fundamental Abstraction
> **The atomic unit of documentation is a Python import path**
Examples:
* `mail_intake`
* `mail_intake.config`
* `mail_intake.adapters.base`
Files, Markdown, HTML, and JSON are *representations*, not documentation units.
---
## 3. High-Level Architecture
```
Python Source Code
Introspection Layer (Griffe)
Documentation Model (doc-forge core)
Renderer / Exporter Layer
├── MkDocs
├── Sphinx
├── MCP (static JSON)
└── MCP Server (live)
```
Only the **Documentation Model** is shared across all outputs.
---
## 4. Package Layout (Proposed)
```
docforge/
├── __init__.py
├── model/
│ ├── project.py
│ ├── module.py
│ ├── object.py
│ └── nav.py
├── loader/
│ └── griffe_loader.py
├── renderers/
│ ├── base.py
│ ├── mkdocs.py
│ └── sphinx.py
├── exporters/
│ └── mcp.py
├── server/
│ └── mcp_server.py
├── cli/
│ └── main.py
└── utils/
```
---
## 5. Documentation Model (Core)
The documentation model is renderer-neutral and must not contain any MkDocs-, Sphinx-, or MCP-specific logic.
### 5.1 Project
```python
class Project:
name: str
version: str | None
modules: dict[str, Module]
nav: Navigation
```
---
### 5.2 Module
```python
class Module:
path: str # import path
docstring: str | None
members: dict[str, DocObject]
```
---
### 5.3 DocObject
Represents classes, functions, variables, etc.
```python
class DocObject:
name: str
kind: str # class, function, attribute, module
path: str
signature: str | None
docstring: str | None
members: dict[str, DocObject]
```
Private members (`_name`) are excluded by default.
---
### 5.4 Navigation
```python
class Navigation:
entries: list[NavEntry]
class NavEntry:
title: str
module: str
```
Navigation is derived, not authored.
---
## 6. Introspection Layer
### 6.1 Griffe Loader
Griffe is the **only supported introspection backend**.
Responsibilities:
* Load modules by import path
* Resolve docstrings, signatures, and members
* Tolerate alias resolution failures
Output: fully populated `Project` and `Module` objects.
---
## 7. Renderer Interface
Renderers consume the documentation model and emit renderer-specific source trees.
```python
class DocRenderer(Protocol):
name: str
def generate_sources(self, project: Project, out_dir: Path) -> None:
"""Generate renderer-specific source files."""
def build(self, config: RendererConfig) -> None:
"""Build final artifacts (HTML, site, etc.)."""
def serve(self, config: RendererConfig) -> None:
"""Serve documentation locally (optional)."""
```
---
## 8. MkDocs Renderer
### Source Generation
* Emits `.md` files
* One file per module
* Uses `mkdocstrings` directives exclusively
```md
# Config
::: mail_intake.config
```
### Build
* Uses `mkdocs.commands.build`
### Serve
* Uses `mkdocs.commands.serve`
MkDocs-specific configuration lives outside the core model.
---
## 9. Sphinx Renderer
### Source Generation
* Emits `.rst` files
* Uses `autodoc` directives
```rst
mail_intake.config
==================
.. automodule:: mail_intake.config
:members:
:undoc-members:
```
### Build
* Uses `sphinx.application.Sphinx` directly
### Serve
* Optional (static build is sufficient)
---
## 10. MCP Exporter (Static)
The MCP exporter bypasses renderers entirely.
### Output Structure
```
mcp/
├── index.json
├── nav.json
└── modules/
└── package.module.json
```
### Design Principles
* Alias-safe
* Deterministic
* Fully self-contained
* No Markdown, HTML, or templates
---
## 11. MCP Server (Live)
The MCP server exposes documentation as queryable resources.
### Resources
* `docs://index`
* `docs://nav`
* `docs://module/{module}`
### Characteristics
* Read-only
* Stateless
* Backed by MCP JSON bundle
---
## 12. CLI Design
The CLI is a thin orchestration layer.
```bash
doc-forge generate --renderer mkdocs
doc-forge generate --renderer sphinx
doc-forge build --renderer mkdocs
doc-forge serve --renderer mkdocs
doc-forge export mcp
```
Renderer choice never affects the core model.
---
## 13. Explicit Non-Goals
* Markdown authoring
* Theme design
* Runtime code execution
* Code formatting or linting
---
## 14. Invariants (Must Never Break)
1. Import paths are canonical identifiers
2. Core model contains no renderer logic
3. MCP does not depend on MkDocs or Sphinx
4. Renderers do not introspect Python directly
5. All outputs trace back to the same model
---
## 15. One-Line Definition
> **doc-forge is a documentation compiler that turns Python code into structured knowledge and emits it through multiple human and machine interfaces.**
---
*End of specification.*

View File

@@ -22,5 +22,7 @@ groups:
- docforge/cli/index.md - docforge/cli/index.md
- docforge/cli/main.md - docforge/cli/main.md
- docforge/cli/commands.md - docforge/cli/commands.md
- docforge/cli/mcp_utils.md - docforge/cli/mcp/index.md
- docforge/cli/mkdocs_utils.md - docforge/cli/mcp/logic.md
- docforge/cli/mkdocs/index.md
- docforge/cli/mkdocs/logic.md

View File

@@ -6,35 +6,6 @@ speed, flexibility, and beautiful output. It decouples the introspection of
your code from the rendering process, allowing you to generate documentation your code from the rendering process, allowing you to generate documentation
for various platforms (starting with MkDocs) from a single internal models. for various platforms (starting with MkDocs) from a single internal models.
## Core Philosophy
`doc-forge` operates on two fundamental principles:
1. **The Atomic Unit is a Python Import Path**: Documentation is organized around the semantic structure of your code (e.g., `mypackage.utils`), not the filesystem.
2. **The Documentation Compiler Paradigm**: We separate documentation into three distinct phases:
- **Front-end (Introspection)**: Static analysis of source code and docstrings.
- **Middle-end (Semantic Model)**: A renderer-neutral internal representation.
- **Back-end (Renderers)**: Generation of human-facing (MkDocs) or machine-facing (MCP) outputs.
## Documentation Design
`doc-forge` is an "AI-Native" documentation compiler. To get the most out of it, design your docstrings with both humans and LLMs in mind:
### For Humans (Readability & Structure)
- **`__init__.py` as Landing Pages**: Use the docstring of your package's `__init__.py` as the home page. Include overviews, installation instructions, and high-level examples here.
- **Single Source of Truth**: Keep all technical details in docstrings. This ensures your MkDocs/Sphinx sites stay in sync with the code.
- **Semantic Hierarchy**: Use standard Markdown headers to structure complex module documentation.
### For LLMs (AI-Native Knowledge)
- **Model Context Protocol (MCP)**: `doc-forge` exports your docs as structured JSON. This allows AI agents to "understand" your API surface area without layout noise.
- **Canonical Paths**: Use dotted import paths as primary identifiers. AI tools use these to link code usage to documentation.
- **Type Annotations**: While not in docstrings, `doc-forge` (via Griffe) extracts signatures. Clean type hints dramatically improve an LLM's ability to generate correct code using your library.
## Available Commands
- **build**: Build documentation (MkDocs site or MCP resources).
- **serve**: Serve documentation (MkDocs or MCP).
- **tree**: Visualize the introspected project structure.
## Installation ## Installation
Install using `pip` with the optional `mkdocs` dependencies for a complete setup: Install using `pip` with the optional `mkdocs` dependencies for a complete setup:
@@ -45,14 +16,10 @@ pip install doc-forge
## Quick Start ## Quick Start
1. **Build Documentation**: 1. **Generate Markdown Sources**:
Introspect your package and generate documentation in one step: Introspect your package and create ready-to-use Markdown files:
```bash ```bash
# Build MkDocs site doc-forge generate --module my_package --docs-dir docs
doc-forge build --mkdocs --module my_package --site-name "My Docs"
# Build MCP resources
doc-forge build --mcp --module my_package
``` ```
2. **Define Navigation**: 2. **Define Navigation**:
@@ -66,13 +33,14 @@ pip install doc-forge
- my_package/utils.md - my_package/utils.md
``` ```
3. **Preview**: 3. **Generate MkDocs Configuration**:
```bash ```bash
# Serve MkDocs site doc-forge mkdocs --site-name "My Awesome Docs"
doc-forge serve --mkdocs ```
# Serve MCP documentation 4. **Preview**:
doc-forge serve --mcp ```bash
doc-forge serve
``` ```
## Project Structure ## Project Structure

View File

@@ -6,9 +6,11 @@ with doc-forge.
## Available Commands ## Available Commands
- **build**: Build documentation (MkDocs site or MCP resources).
- **serve**: Serve documentation (MkDocs or MCP).
- **tree**: Visualize the introspected project structure. - **tree**: Visualize the introspected project structure.
- **generate**: Create Markdown source files from Python code.
- **mkdocs**: Generate the primary `mkdocs.yml` configuration.
- **build**: Build the final documentation site.
- **serve**: Launch a local development server with live-reloading.
""" """
from .main import main from .main import main

View File

@@ -2,9 +2,8 @@ import click
from pathlib import Path from pathlib import Path
from typing import Sequence, Optional from typing import Sequence, Optional
from docforge.loaders import GriffeLoader from docforge.loaders import GriffeLoader
from docforge.cli import mkdocs_utils from docforge.cli.mkdocs import logic as mkdocs_logic
from docforge.cli import mcp_utils from docforge.cli.mcp import logic as mcp_logic
@click.group() @click.group()
def cli() -> None: def cli() -> None:
@@ -14,7 +13,6 @@ def cli() -> None:
""" """
pass pass
@cli.command() @cli.command()
@click.option("--mcp", is_flag=True, help="Build MCP resources") @click.option("--mcp", is_flag=True, help="Build MCP resources")
@click.option("--mkdocs", is_flag=True, help="Build MkDocs site") @click.option("--mkdocs", is_flag=True, help="Build MkDocs site")
@@ -23,8 +21,7 @@ def cli() -> None:
# MkDocs specific # MkDocs specific
@click.option("--site-name", help="MkDocs site name") @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("--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"), @click.option("--nav", "nav_file", type=click.Path(path_type=Path), default=Path("docforge.nav.yml"), help="Nav spec path")
help="Nav spec path")
@click.option("--template", type=click.Path(path_type=Path), help="MkDocs template 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") @click.option("--mkdocs-yml", type=click.Path(path_type=Path), default=Path("mkdocs.yml"), help="Output config path")
# MCP specific # MCP specific
@@ -43,23 +40,6 @@ def build(
) -> None: ) -> None:
""" """
Build documentation (MkDocs site or MCP resources). Build documentation (MkDocs site or MCP resources).
This command orchestrates the full build process:
1. Introspects the code (Griffe)
2. Renders sources (MkDocs Markdown or MCP JSON)
3. (MkDocs only) Generates config and runs the final site build.
Args:
mcp: Use the MCP documentation builder.
mkdocs: Use the MkDocs documentation builder.
module: The dotted path of the module to document.
project_name: Optional override for the project name.
site_name: (MkDocs) The site display name. Defaults to module name.
docs_dir: (MkDocs) Target directory for Markdown sources.
nav_file: (MkDocs) Path to the docforge.nav.yml specification.
template: (MkDocs) Optional custom mkdocs.yml template.
mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.
out_dir: (MCP) Target directory for MCP JSON resources.
""" """
if not mcp and not mkdocs: if not mcp and not mkdocs:
raise click.UsageError("Must specify either --mcp or --mkdocs") raise click.UsageError("Must specify either --mcp or --mkdocs")
@@ -71,13 +51,13 @@ def build(
site_name = module site_name = module
click.echo(f"Generating MkDocs sources in {docs_dir}...") click.echo(f"Generating MkDocs sources in {docs_dir}...")
mkdocs_utils.generate_sources(module, project_name, docs_dir) mkdocs_logic.generate_sources(module, project_name, docs_dir)
click.echo(f"Generating MkDocs config {mkdocs_yml}...") click.echo(f"Generating MkDocs config {mkdocs_yml}...")
mkdocs_utils.generate_config(docs_dir, nav_file, template, mkdocs_yml, site_name) mkdocs_logic.generate_config(docs_dir, nav_file, template, mkdocs_yml, site_name)
click.echo("Running MkDocs build...") click.echo("Running MkDocs build...")
mkdocs_utils.build(mkdocs_yml) mkdocs_logic.build(mkdocs_yml)
click.echo("MkDocs build completed.") click.echo("MkDocs build completed.")
if mcp: if mcp:
@@ -85,69 +65,53 @@ def build(
raise click.UsageError("--module is required for MCP build") raise click.UsageError("--module is required for MCP build")
click.echo(f"Generating MCP resources in {out_dir}...") click.echo(f"Generating MCP resources in {out_dir}...")
mcp_utils.generate_resources(module, project_name, out_dir) mcp_logic.generate_resources(module, project_name, out_dir)
click.echo("MCP build completed.") click.echo("MCP build completed.")
@cli.command() @cli.command()
@click.option("--mcp", is_flag=True, help="Serve MCP documentation") @click.option("--mcp", is_flag=True, help="Serve MCP documentation")
@click.option("--mkdocs", is_flag=True, help="Serve MkDocs site") @click.option("--mkdocs", is_flag=True, help="Serve MkDocs site")
@click.option("--module", help="Python module to serve")
@click.option("--mkdocs-yml", type=click.Path(path_type=Path), default=Path("mkdocs.yml"), help="MkDocs config path") @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") @click.option("--out-dir", type=click.Path(path_type=Path), default=Path("mcp_docs"), help="MCP root directory")
def serve( def serve(
mcp: bool, mcp: bool,
mkdocs: bool, mkdocs: bool,
module: Optional[str],
mkdocs_yml: Path, mkdocs_yml: Path,
out_dir: Path, out_dir: Path,
) -> None: ) -> None:
""" """
Serve documentation (MkDocs or MCP). Serve documentation.
Args:
mcp: Serve MCP resources via an MCP server.
mkdocs: Serve the MkDocs site using the built-in development server.
module: The dotted path of the module to serve.
mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.
out_dir: (MCP) Path to the mcp_docs/ directory.
""" """
if mcp and mkdocs: if mcp and mkdocs:
raise click.UsageError("Cannot specify both --mcp and --mkdocs") raise click.UsageError("Cannot specify both --mcp and --mkdocs")
if not mcp and not mkdocs: if not mcp and not mkdocs:
raise click.UsageError("Must specify either --mcp or --mkdocs") raise click.UsageError("Must specify either --mcp or --mkdocs")
if mcp and not module:
raise click.UsageError("--module is required for MCP serve")
if mkdocs: if mkdocs:
mkdocs_utils.serve(mkdocs_yml) mkdocs_logic.serve(mkdocs_yml)
elif mcp: elif mcp:
mcp_utils.serve(module, out_dir) mcp_logic.serve(out_dir)
@cli.command() @cli.command()
@click.option( @click.option(
"--module", "--modules",
multiple=True,
required=True, required=True,
help="Python module import path to introspect", help="Python module import paths to introspect",
) )
@click.option( @click.option(
"--project-name", "--project-name",
help="Project name (defaults to specified module)", help="Project name (defaults to first module)",
) )
def tree( def tree(
module: str, modules: Sequence[str],
project_name: Optional[str], project_name: Optional[str],
) -> None: ) -> None:
""" """
Visualize the project structure in the terminal. Visualize the project structure.
Args:
module: The module import path to recursively introspect.
project_name: Optional override for the project name shown at the root.
""" """
loader = GriffeLoader() loader = GriffeLoader()
project = loader.load_project([module], project_name) project = loader.load_project(list(modules), project_name)
click.echo(project.name) click.echo(project.name)
@@ -156,14 +120,9 @@ def tree(
for obj in module.get_all_objects(): for obj in module.get_all_objects():
_print_object(obj, indent="") _print_object(obj, indent="")
def _print_object(obj, indent: str) -> None: def _print_object(obj, indent: str) -> None:
""" """
Recursive helper to print doc objects and their members to the console. Recursive helper to print doc objects and their members to the console.
Args:
obj: The DocObject instance to print.
indent: Current line indentation (e.g., '').
""" """
click.echo(f"{indent}├── {obj.name}") click.echo(f"{indent}├── {obj.name}")
for member in obj.get_all_members(): for member in obj.get_all_members():

View File

@@ -1,33 +0,0 @@
from click.core import Group
from pathlib import Path
from typing import Sequence, Optional, Any
cli: Group
def build(
mcp: bool,
mkdocs: bool,
module: Optional[str],
project_name: Optional[str],
site_name: Optional[str],
docs_dir: Path,
nav_file: Path,
template: Optional[Path],
mkdocs_yml: Path,
out_dir: Path,
) -> None: ...
def serve(
mcp: bool,
mkdocs: bool,
module: Optional[str],
mkdocs_yml: Path,
out_dir: Path,
) -> None: ...
def tree(
module: str,
project_name: Optional[str],
) -> None: ...
def _print_object(obj: Any, indent: str) -> None: ...

View File

@@ -1,6 +1,5 @@
""" """
Main entry point for the doc-forge CLI. This module delegates all command Main entry point for the doc-forge CLI.
execution to docforge.cli.commands.
""" """
from docforge.cli.commands import cli from docforge.cli.commands import cli

View File

@@ -1 +0,0 @@
def main() -> None: ...

View File

View File

@@ -7,11 +7,6 @@ from docforge.servers import MCPServer
def generate_resources(module: str, project_name: str | None, out_dir: Path) -> None: def generate_resources(module: str, project_name: str | None, out_dir: Path) -> None:
""" """
Generate MCP-compatible documentation resources. Generate MCP-compatible documentation resources.
Args:
module: The dotted path of the primary module to document.
project_name: Optional override for the project name.
out_dir: Directory where the MCP JSON resources and nav will be written.
""" """
loader = GriffeLoader() loader = GriffeLoader()
discovered_paths = discover_module_paths(module) discovered_paths = discover_module_paths(module)
@@ -20,13 +15,9 @@ def generate_resources(module: str, project_name: str | None, out_dir: Path) ->
renderer = MCPRenderer() renderer = MCPRenderer()
renderer.generate_sources(project, out_dir) renderer.generate_sources(project, out_dir)
def serve(module: str, mcp_root: Path) -> None: def serve(mcp_root: Path) -> None:
""" """
Serve MCP documentation from a pre-built bundle. Serve MCP documentation.
Args:
module: The dotted path of the primary module to serve.
mcp_root: Path to the directory containing index.json, nav.json, and modules/.
""" """
if not mcp_root.exists(): if not mcp_root.exists():
raise click.ClickException(f"mcp_docs directory not found: {mcp_root}") raise click.ClickException(f"mcp_docs directory not found: {mcp_root}")
@@ -43,6 +34,6 @@ def serve(module: str, mcp_root: Path) -> None:
server = MCPServer( server = MCPServer(
mcp_root=mcp_root, mcp_root=mcp_root,
name=f"{module}-mcp", name="doc-forge-mcp",
) )
server.run() server.run()

View File

@@ -1,4 +0,0 @@
from pathlib import Path
def generate_resources(module: str, project_name: str | None, out_dir: Path) -> None: ...
def serve(module: str, mcp_root: Path) -> None: ...

View File

View File

@@ -9,11 +9,6 @@ from docforge.nav import load_nav_spec, resolve_nav, MkDocsNavEmitter
def generate_sources(module: str, project_name: str | None, docs_dir: Path) -> None: def generate_sources(module: str, project_name: str | None, docs_dir: Path) -> None:
""" """
Generate Markdown source files for the specified module. Generate Markdown source files for the specified module.
Args:
module: The dotted path of the primary module to document.
project_name: Optional override for the project name.
docs_dir: Directory where the generated Markdown files will be written.
""" """
loader = GriffeLoader() loader = GriffeLoader()
discovered_paths = discover_module_paths(module) discovered_paths = discover_module_paths(module)
@@ -25,13 +20,6 @@ def generate_sources(module: str, project_name: str | None, docs_dir: Path) -> N
def generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None: def generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None:
""" """
Generate an mkdocs.yml configuration file. Generate an mkdocs.yml configuration file.
Args:
docs_dir: Path to the directory containing documentation Markdown files.
nav_file: Path to the docforge.nav.yml specification.
template: Optional path to an mkdocs.yml template (overrides built-in).
out: Path where the final mkdocs.yml will be written.
site_name: The display name for the documentation site.
""" """
if not nav_file.exists(): if not nav_file.exists():
raise click.FileError(str(nav_file), hint="Nav spec not found") raise click.FileError(str(nav_file), hint="Nav spec not found")
@@ -61,9 +49,6 @@ def generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out:
def build(mkdocs_yml: Path) -> None: def build(mkdocs_yml: Path) -> None:
""" """
Build the documentation site using MkDocs. Build the documentation site using MkDocs.
Args:
mkdocs_yml: Path to the mkdocs.yml configuration file.
""" """
if not mkdocs_yml.exists(): if not mkdocs_yml.exists():
raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}") raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}")
@@ -76,9 +61,6 @@ def build(mkdocs_yml: Path) -> None:
def serve(mkdocs_yml: Path) -> None: def serve(mkdocs_yml: Path) -> None:
""" """
Serve the documentation site with live-reload using MkDocs. Serve the documentation site with live-reload using MkDocs.
Args:
mkdocs_yml: Path to the mkdocs.yml configuration file.
""" """
if not mkdocs_yml.exists(): if not mkdocs_yml.exists():
raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}") raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}")

View File

@@ -1,6 +0,0 @@
from pathlib import Path
def generate_sources(module: str, project_name: str | None, docs_dir: Path) -> None: ...
def generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None: ...
def build(mkdocs_yml: Path) -> None: ...
def serve(mkdocs_yml: Path) -> None: ...

View File

@@ -15,10 +15,6 @@ class MCPRenderer:
def generate_sources(self, project: Project, out_dir: Path) -> None: def generate_sources(self, project: Project, out_dir: Path) -> None:
""" """
Generate MCP-compatible JSON resources and navigation for the project. Generate MCP-compatible JSON resources and navigation for the project.
Args:
project: The project model to render.
out_dir: Target directory for the generated JSON files.
""" """
modules_dir = out_dir / "modules" modules_dir = out_dir / "modules"
modules_dir.mkdir(parents=True, exist_ok=True) modules_dir.mkdir(parents=True, exist_ok=True)
@@ -54,11 +50,7 @@ class MCPRenderer:
def _write_module(self, module: Module, modules_dir: Path) -> None: def _write_module(self, module: Module, modules_dir: Path) -> None:
""" """
Serialize a module into an MCP JSON resource on disk. Serialize a module into an MCP JSON resource.
Args:
module: The module instance to serialize.
modules_dir: The directory where the module JSON file should be written.
""" """
payload = { payload = {
"module": module.path, "module": module.path,
@@ -72,12 +64,6 @@ class MCPRenderer:
def _render_module(self, module: Module) -> Dict: def _render_module(self, module: Module) -> Dict:
""" """
Render a Module into MCP-friendly structured data. Render a Module into MCP-friendly structured data.
Args:
module: The module instance to render.
Returns:
A dictionary following the MCP documentation resource schema.
""" """
data: Dict = { data: Dict = {
"path": module.path, "path": module.path,
@@ -93,12 +79,6 @@ class MCPRenderer:
def _render_object(self, obj: DocObject) -> Dict: def _render_object(self, obj: DocObject) -> Dict:
""" """
Recursively render a DocObject into structured MCP data. Recursively render a DocObject into structured MCP data.
Args:
obj: The documented object (class, func, etc.) to render.
Returns:
A dictionary representing the object and its members.
""" """
data: Dict = { data: Dict = {
"name": obj.name, "name": obj.name,

View File

@@ -0,0 +1,3 @@
# Mcp
::: docforge.cli.mcp

View File

@@ -0,0 +1,3 @@
# Logic
::: docforge.cli.mcp.logic

View File

@@ -1,3 +0,0 @@
# Mcp Utils
::: docforge.cli.mcp_utils

View File

@@ -0,0 +1,3 @@
# Mkdocs
::: docforge.cli.mkdocs

View File

@@ -0,0 +1,3 @@
# Logic
::: docforge.cli.mkdocs.logic

View File

@@ -1,3 +0,0 @@
# Mkdocs Utils
::: docforge.cli.mkdocs_utils

View File

@@ -1,6 +1,6 @@
{ {
"project": "docforge", "project": "docforge",
"type": "docforge-model", "type": "docforge-model",
"modules_count": 22, "modules_count": 24,
"source": "docforge" "source": "docforge"
} }

View File

@@ -55,59 +55,59 @@
} }
} }
}, },
"mkdocs_utils": { "mkdocs_logic": {
"name": "mkdocs_utils", "name": "mkdocs_logic",
"kind": "module", "kind": "module",
"path": "docforge.cli.commands.mkdocs_utils", "path": "docforge.cli.commands.mkdocs_logic",
"signature": "<bound method Alias.signature of Alias('mkdocs_utils', 'docforge.cli.mkdocs_utils')>", "signature": "<bound method Alias.signature of Alias('mkdocs_logic', 'docforge.cli.mkdocs.logic')>",
"docstring": null, "docstring": null,
"members": { "members": {
"Path": { "Path": {
"name": "Path", "name": "Path",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.commands.mkdocs_utils.Path", "path": "docforge.cli.commands.mkdocs_logic.Path",
"signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mkdocs_utils.Path')>", "signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mkdocs.logic.Path')>",
"docstring": null "docstring": null
}, },
"resources": { "resources": {
"name": "resources", "name": "resources",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.commands.mkdocs_utils.resources", "path": "docforge.cli.commands.mkdocs_logic.resources",
"signature": "<bound method Alias.signature of Alias('resources', 'docforge.cli.mkdocs_utils.resources')>", "signature": "<bound method Alias.signature of Alias('resources', 'docforge.cli.mkdocs.logic.resources')>",
"docstring": null "docstring": null
}, },
"click": { "click": {
"name": "click", "name": "click",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.commands.mkdocs_utils.click", "path": "docforge.cli.commands.mkdocs_logic.click",
"signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mkdocs_utils.click')>", "signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mkdocs.logic.click')>",
"docstring": null "docstring": null
}, },
"yaml": { "yaml": {
"name": "yaml", "name": "yaml",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.commands.mkdocs_utils.yaml", "path": "docforge.cli.commands.mkdocs_logic.yaml",
"signature": "<bound method Alias.signature of Alias('yaml', 'docforge.cli.mkdocs_utils.yaml')>", "signature": "<bound method Alias.signature of Alias('yaml', 'docforge.cli.mkdocs.logic.yaml')>",
"docstring": null "docstring": null
}, },
"GriffeLoader": { "GriffeLoader": {
"name": "GriffeLoader", "name": "GriffeLoader",
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mkdocs_utils.GriffeLoader", "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mkdocs_utils.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.", "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.commands.mkdocs_utils.GriffeLoader.load_project", "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')>", "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.commands.mkdocs_utils.GriffeLoader.load_module", "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')>", "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."
} }
@@ -116,28 +116,28 @@
"discover_module_paths": { "discover_module_paths": {
"name": "discover_module_paths", "name": "discover_module_paths",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.discover_module_paths", "path": "docforge.cli.commands.mkdocs_logic.discover_module_paths",
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mkdocs_utils.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." "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": { "MkDocsRenderer": {
"name": "MkDocsRenderer", "name": "MkDocsRenderer",
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer", "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer",
"signature": "<bound method Alias.signature of Alias('MkDocsRenderer', 'docforge.cli.mkdocs_utils.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.", "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
"kind": "attribute", "kind": "attribute",
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.name", "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.name",
"signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.name')>", "signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.name')>",
"docstring": null "docstring": null
}, },
"generate_sources": { "generate_sources": {
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.generate_sources", "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')>", "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." "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
} }
@@ -146,28 +146,28 @@
"load_nav_spec": { "load_nav_spec": {
"name": "load_nav_spec", "name": "load_nav_spec",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.load_nav_spec", "path": "docforge.cli.commands.mkdocs_logic.load_nav_spec",
"signature": "<bound method Alias.signature of Alias('load_nav_spec', 'docforge.cli.mkdocs_utils.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." "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": { "resolve_nav": {
"name": "resolve_nav", "name": "resolve_nav",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.resolve_nav", "path": "docforge.cli.commands.mkdocs_logic.resolve_nav",
"signature": "<bound method Alias.signature of Alias('resolve_nav', 'docforge.cli.mkdocs_utils.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." "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": { "MkDocsNavEmitter": {
"name": "MkDocsNavEmitter", "name": "MkDocsNavEmitter",
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mkdocs_utils.MkDocsNavEmitter", "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter",
"signature": "<bound method Alias.signature of Alias('MkDocsNavEmitter', 'docforge.cli.mkdocs_utils.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.", "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.",
"members": { "members": {
"emit": { "emit": {
"name": "emit", "name": "emit",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.MkDocsNavEmitter.emit", "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter.emit",
"signature": "<bound method Alias.signature of Alias('emit', 'docforge.nav.mkdocs.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." "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation."
} }
@@ -176,72 +176,72 @@
"generate_sources": { "generate_sources": {
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.generate_sources", "path": "docforge.cli.commands.mkdocs_logic.generate_sources",
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.cli.mkdocs_utils.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.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written." "docstring": "Generate Markdown source files for the specified module."
}, },
"generate_config": { "generate_config": {
"name": "generate_config", "name": "generate_config",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.generate_config", "path": "docforge.cli.commands.mkdocs_logic.generate_config",
"signature": "<bound method Alias.signature of Alias('generate_config', 'docforge.cli.mkdocs_utils.generate_config')>", "signature": "<bound method Alias.signature of Alias('generate_config', 'docforge.cli.mkdocs.logic.generate_config')>",
"docstring": "Generate an mkdocs.yml configuration file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template (overrides built-in).\n out: Path where the final mkdocs.yml will be written.\n site_name: The display name for the documentation site." "docstring": "Generate an mkdocs.yml configuration file."
}, },
"build": { "build": {
"name": "build", "name": "build",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.build", "path": "docforge.cli.commands.mkdocs_logic.build",
"signature": "<bound method Alias.signature of Alias('build', 'docforge.cli.mkdocs_utils.build')>", "signature": "<bound method Alias.signature of Alias('build', 'docforge.cli.mkdocs.logic.build')>",
"docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." "docstring": "Build the documentation site using MkDocs."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.serve", "path": "docforge.cli.commands.mkdocs_logic.serve",
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mkdocs_utils.serve')>", "signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mkdocs.logic.serve')>",
"docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." "docstring": "Serve the documentation site with live-reload using MkDocs."
} }
} }
}, },
"mcp_utils": { "mcp_logic": {
"name": "mcp_utils", "name": "mcp_logic",
"kind": "module", "kind": "module",
"path": "docforge.cli.commands.mcp_utils", "path": "docforge.cli.commands.mcp_logic",
"signature": "<bound method Alias.signature of Alias('mcp_utils', 'docforge.cli.mcp_utils')>", "signature": "<bound method Alias.signature of Alias('mcp_logic', 'docforge.cli.mcp.logic')>",
"docstring": null, "docstring": null,
"members": { "members": {
"Path": { "Path": {
"name": "Path", "name": "Path",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.commands.mcp_utils.Path", "path": "docforge.cli.commands.mcp_logic.Path",
"signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mcp_utils.Path')>", "signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mcp.logic.Path')>",
"docstring": null "docstring": null
}, },
"click": { "click": {
"name": "click", "name": "click",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.commands.mcp_utils.click", "path": "docforge.cli.commands.mcp_logic.click",
"signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mcp_utils.click')>", "signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mcp.logic.click')>",
"docstring": null "docstring": null
}, },
"GriffeLoader": { "GriffeLoader": {
"name": "GriffeLoader", "name": "GriffeLoader",
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mcp_utils.GriffeLoader", "path": "docforge.cli.commands.mcp_logic.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mcp_utils.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.", "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.commands.mcp_utils.GriffeLoader.load_project", "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')>", "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.commands.mcp_utils.GriffeLoader.load_module", "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')>", "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."
} }
@@ -250,58 +250,58 @@
"discover_module_paths": { "discover_module_paths": {
"name": "discover_module_paths", "name": "discover_module_paths",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.discover_module_paths", "path": "docforge.cli.commands.mcp_logic.discover_module_paths",
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mcp_utils.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." "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": { "MCPRenderer": {
"name": "MCPRenderer", "name": "MCPRenderer",
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mcp_utils.MCPRenderer", "path": "docforge.cli.commands.mcp_logic.MCPRenderer",
"signature": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.cli.mcp_utils.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.", "docstring": "Renderer that emits MCP-native JSON resources from docforge models.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
"kind": "attribute", "kind": "attribute",
"path": "docforge.cli.commands.mcp_utils.MCPRenderer.name", "path": "docforge.cli.commands.mcp_logic.MCPRenderer.name",
"signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>", "signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>",
"docstring": null "docstring": null
}, },
"generate_sources": { "generate_sources": {
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.MCPRenderer.generate_sources", "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')>", "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.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." "docstring": "Generate MCP-compatible JSON resources and navigation for the project."
} }
} }
}, },
"MCPServer": { "MCPServer": {
"name": "MCPServer", "name": "MCPServer",
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mcp_utils.MCPServer", "path": "docforge.cli.commands.mcp_logic.MCPServer",
"signature": "<bound method Alias.signature of Alias('MCPServer', 'docforge.cli.mcp_utils.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.", "docstring": "MCP server for serving a pre-built MCP documentation bundle.",
"members": { "members": {
"mcp_root": { "mcp_root": {
"name": "mcp_root", "name": "mcp_root",
"kind": "attribute", "kind": "attribute",
"path": "docforge.cli.commands.mcp_utils.MCPServer.mcp_root", "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')>", "signature": "<bound method Alias.signature of Alias('mcp_root', 'docforge.servers.mcp_server.MCPServer.mcp_root')>",
"docstring": null "docstring": null
}, },
"app": { "app": {
"name": "app", "name": "app",
"kind": "attribute", "kind": "attribute",
"path": "docforge.cli.commands.mcp_utils.MCPServer.app", "path": "docforge.cli.commands.mcp_logic.MCPServer.app",
"signature": "<bound method Alias.signature of Alias('app', 'docforge.servers.mcp_server.MCPServer.app')>", "signature": "<bound method Alias.signature of Alias('app', 'docforge.servers.mcp_server.MCPServer.app')>",
"docstring": null "docstring": null
}, },
"run": { "run": {
"name": "run", "name": "run",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.MCPServer.run", "path": "docforge.cli.commands.mcp_logic.MCPServer.run",
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.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)" "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)"
} }
@@ -310,60 +310,46 @@
"generate_resources": { "generate_resources": {
"name": "generate_resources", "name": "generate_resources",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.generate_resources", "path": "docforge.cli.commands.mcp_logic.generate_resources",
"signature": "<bound method Alias.signature of Alias('generate_resources', 'docforge.cli.mcp_utils.generate_resources')>", "signature": "<bound method Alias.signature of Alias('generate_resources', 'docforge.cli.mcp.logic.generate_resources')>",
"docstring": "Generate MCP-compatible documentation resources.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n out_dir: Directory where the MCP JSON resources and nav will be written." "docstring": "Generate MCP-compatible documentation resources."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.serve", "path": "docforge.cli.commands.mcp_logic.serve",
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp_utils.serve')>", "signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp.logic.serve')>",
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/." "docstring": "Serve MCP documentation."
} }
} }
}, },
"cli": { "cli": {
"name": "cli", "name": "cli",
"kind": "attribute", "kind": "function",
"path": "docforge.cli.commands.cli", "path": "docforge.cli.commands.cli",
"signature": null, "signature": "<bound method Function.signature of Function('cli', 8, 14)>",
"docstring": null "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation."
}, },
"build": { "build": {
"name": "build", "name": "build",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.build", "path": "docforge.cli.commands.build",
"signature": "<bound method Function.signature of Function('build', 18, 89)>", "signature": "<bound method Function.signature of Function('build', 16, 69)>",
"docstring": "Build documentation (MkDocs site or MCP resources).\n\nThis command orchestrates the full build process:\n1. Introspects the code (Griffe)\n2. Renders sources (MkDocs Markdown or MCP JSON)\n3. (MkDocs only) Generates config and runs the final site build.\n\nArgs:\n mcp: Use the MCP documentation builder.\n mkdocs: Use the MkDocs documentation builder.\n module: The dotted path of the module to document.\n project_name: Optional override for the project name.\n site_name: (MkDocs) The site display name. Defaults to module name.\n docs_dir: (MkDocs) Target directory for Markdown sources.\n nav_file: (MkDocs) Path to the docforge.nav.yml specification.\n template: (MkDocs) Optional custom mkdocs.yml template.\n mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.\n out_dir: (MCP) Target directory for MCP JSON resources." "docstring": "Build documentation (MkDocs site or MCP resources)."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.serve", "path": "docforge.cli.commands.serve",
"signature": "<bound method Function.signature of Function('serve', 92, 120)>", "signature": "<bound method Function.signature of Function('serve', 71, 93)>",
"docstring": "Serve documentation (MkDocs or MCP).\n\nArgs:\n mcp: Serve MCP resources via an MCP server.\n mkdocs: Serve the MkDocs site using the built-in development server.\n mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.\n out_dir: (MCP) Path to the mcp_docs/ directory." "docstring": "Serve documentation."
}, },
"tree": { "tree": {
"name": "tree", "name": "tree",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.tree", "path": "docforge.cli.commands.tree",
"signature": "<bound method Function.signature of Function('tree', 123, 153)>", "signature": "<bound method Function.signature of Function('tree', 95, 121)>",
"docstring": "Visualize the project structure in the terminal.\n\nArgs:\n modules: List of module import paths to recursively introspect.\n project_name: Optional override for the project name shown at the root." "docstring": "Visualize the project structure."
},
"Group": {
"name": "Group",
"kind": "alias",
"path": "docforge.cli.commands.Group",
"signature": "<bound method Alias.signature of Alias('Group', 'click.core.Group')>",
"docstring": null
},
"Any": {
"name": "Any",
"kind": "alias",
"path": "docforge.cli.commands.Any",
"signature": "<bound method Alias.signature of Alias('Any', 'typing.Any')>",
"docstring": null
} }
} }
} }

View File

@@ -2,27 +2,27 @@
"module": "docforge.cli", "module": "docforge.cli",
"content": { "content": {
"path": "docforge.cli", "path": "docforge.cli",
"docstring": "# CLI Layer\n\nThe `docforge.cli` package provides the command-line interface for interacting\nwith doc-forge.\n\n## Available Commands\n\n- **build**: Build documentation (MkDocs site or MCP resources).\n- **serve**: Serve documentation (MkDocs or MCP).\n- **tree**: Visualize the introspected project structure.", "docstring": "# CLI Layer\n\nThe `docforge.cli` package provides the command-line interface for interacting\nwith doc-forge.\n\n## Available Commands\n\n- **tree**: Visualize the introspected project structure.\n- **generate**: Create Markdown source files from Python code.\n- **mkdocs**: Generate the primary `mkdocs.yml` configuration.\n- **build**: Build the final documentation site.\n- **serve**: Launch a local development server with live-reloading.",
"objects": { "objects": {
"main": { "main": {
"name": "main", "name": "main",
"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 delegates all command\nexecution to docforge.cli.commands.", "docstring": "Main entry point for the doc-forge CLI.",
"members": { "members": {
"cli": { "cli": {
"name": "cli", "name": "cli",
"kind": "attribute", "kind": "function",
"path": "docforge.cli.main.cli", "path": "docforge.cli.main.cli",
"signature": "<bound method Alias.signature of Alias('cli', 'docforge.cli.commands.cli')>", "signature": "<bound method Alias.signature of Alias('cli', 'docforge.cli.commands.cli')>",
"docstring": null "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation."
}, },
"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', 7, 11)>", "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."
} }
} }
@@ -85,59 +85,59 @@
} }
} }
}, },
"mkdocs_utils": { "mkdocs_logic": {
"name": "mkdocs_utils", "name": "mkdocs_logic",
"kind": "module", "kind": "module",
"path": "docforge.cli.commands.mkdocs_utils", "path": "docforge.cli.commands.mkdocs_logic",
"signature": "<bound method Alias.signature of Alias('mkdocs_utils', 'docforge.cli.mkdocs_utils')>", "signature": "<bound method Alias.signature of Alias('mkdocs_logic', 'docforge.cli.mkdocs.logic')>",
"docstring": null, "docstring": null,
"members": { "members": {
"Path": { "Path": {
"name": "Path", "name": "Path",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.commands.mkdocs_utils.Path", "path": "docforge.cli.commands.mkdocs_logic.Path",
"signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mkdocs_utils.Path')>", "signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mkdocs.logic.Path')>",
"docstring": null "docstring": null
}, },
"resources": { "resources": {
"name": "resources", "name": "resources",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.commands.mkdocs_utils.resources", "path": "docforge.cli.commands.mkdocs_logic.resources",
"signature": "<bound method Alias.signature of Alias('resources', 'docforge.cli.mkdocs_utils.resources')>", "signature": "<bound method Alias.signature of Alias('resources', 'docforge.cli.mkdocs.logic.resources')>",
"docstring": null "docstring": null
}, },
"click": { "click": {
"name": "click", "name": "click",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.commands.mkdocs_utils.click", "path": "docforge.cli.commands.mkdocs_logic.click",
"signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mkdocs_utils.click')>", "signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mkdocs.logic.click')>",
"docstring": null "docstring": null
}, },
"yaml": { "yaml": {
"name": "yaml", "name": "yaml",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.commands.mkdocs_utils.yaml", "path": "docforge.cli.commands.mkdocs_logic.yaml",
"signature": "<bound method Alias.signature of Alias('yaml', 'docforge.cli.mkdocs_utils.yaml')>", "signature": "<bound method Alias.signature of Alias('yaml', 'docforge.cli.mkdocs.logic.yaml')>",
"docstring": null "docstring": null
}, },
"GriffeLoader": { "GriffeLoader": {
"name": "GriffeLoader", "name": "GriffeLoader",
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mkdocs_utils.GriffeLoader", "path": "docforge.cli.commands.mkdocs_logic.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mkdocs_utils.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.", "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.commands.mkdocs_utils.GriffeLoader.load_project", "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')>", "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.commands.mkdocs_utils.GriffeLoader.load_module", "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')>", "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."
} }
@@ -146,28 +146,28 @@
"discover_module_paths": { "discover_module_paths": {
"name": "discover_module_paths", "name": "discover_module_paths",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.discover_module_paths", "path": "docforge.cli.commands.mkdocs_logic.discover_module_paths",
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mkdocs_utils.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." "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": { "MkDocsRenderer": {
"name": "MkDocsRenderer", "name": "MkDocsRenderer",
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer", "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer",
"signature": "<bound method Alias.signature of Alias('MkDocsRenderer', 'docforge.cli.mkdocs_utils.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.", "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
"kind": "attribute", "kind": "attribute",
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.name", "path": "docforge.cli.commands.mkdocs_logic.MkDocsRenderer.name",
"signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.name')>", "signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.name')>",
"docstring": null "docstring": null
}, },
"generate_sources": { "generate_sources": {
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.generate_sources", "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')>", "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." "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
} }
@@ -176,28 +176,28 @@
"load_nav_spec": { "load_nav_spec": {
"name": "load_nav_spec", "name": "load_nav_spec",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.load_nav_spec", "path": "docforge.cli.commands.mkdocs_logic.load_nav_spec",
"signature": "<bound method Alias.signature of Alias('load_nav_spec', 'docforge.cli.mkdocs_utils.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." "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": { "resolve_nav": {
"name": "resolve_nav", "name": "resolve_nav",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.resolve_nav", "path": "docforge.cli.commands.mkdocs_logic.resolve_nav",
"signature": "<bound method Alias.signature of Alias('resolve_nav', 'docforge.cli.mkdocs_utils.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." "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": { "MkDocsNavEmitter": {
"name": "MkDocsNavEmitter", "name": "MkDocsNavEmitter",
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mkdocs_utils.MkDocsNavEmitter", "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter",
"signature": "<bound method Alias.signature of Alias('MkDocsNavEmitter', 'docforge.cli.mkdocs_utils.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.", "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.",
"members": { "members": {
"emit": { "emit": {
"name": "emit", "name": "emit",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.MkDocsNavEmitter.emit", "path": "docforge.cli.commands.mkdocs_logic.MkDocsNavEmitter.emit",
"signature": "<bound method Alias.signature of Alias('emit', 'docforge.nav.mkdocs.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." "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation."
} }
@@ -206,72 +206,72 @@
"generate_sources": { "generate_sources": {
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.generate_sources", "path": "docforge.cli.commands.mkdocs_logic.generate_sources",
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.cli.mkdocs_utils.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.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written." "docstring": "Generate Markdown source files for the specified module."
}, },
"generate_config": { "generate_config": {
"name": "generate_config", "name": "generate_config",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.generate_config", "path": "docforge.cli.commands.mkdocs_logic.generate_config",
"signature": "<bound method Alias.signature of Alias('generate_config', 'docforge.cli.mkdocs_utils.generate_config')>", "signature": "<bound method Alias.signature of Alias('generate_config', 'docforge.cli.mkdocs.logic.generate_config')>",
"docstring": "Generate an mkdocs.yml configuration file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template (overrides built-in).\n out: Path where the final mkdocs.yml will be written.\n site_name: The display name for the documentation site." "docstring": "Generate an mkdocs.yml configuration file."
}, },
"build": { "build": {
"name": "build", "name": "build",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.build", "path": "docforge.cli.commands.mkdocs_logic.build",
"signature": "<bound method Alias.signature of Alias('build', 'docforge.cli.mkdocs_utils.build')>", "signature": "<bound method Alias.signature of Alias('build', 'docforge.cli.mkdocs.logic.build')>",
"docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." "docstring": "Build the documentation site using MkDocs."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.serve", "path": "docforge.cli.commands.mkdocs_logic.serve",
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mkdocs_utils.serve')>", "signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mkdocs.logic.serve')>",
"docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." "docstring": "Serve the documentation site with live-reload using MkDocs."
} }
} }
}, },
"mcp_utils": { "mcp_logic": {
"name": "mcp_utils", "name": "mcp_logic",
"kind": "module", "kind": "module",
"path": "docforge.cli.commands.mcp_utils", "path": "docforge.cli.commands.mcp_logic",
"signature": "<bound method Alias.signature of Alias('mcp_utils', 'docforge.cli.mcp_utils')>", "signature": "<bound method Alias.signature of Alias('mcp_logic', 'docforge.cli.mcp.logic')>",
"docstring": null, "docstring": null,
"members": { "members": {
"Path": { "Path": {
"name": "Path", "name": "Path",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.commands.mcp_utils.Path", "path": "docforge.cli.commands.mcp_logic.Path",
"signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mcp_utils.Path')>", "signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mcp.logic.Path')>",
"docstring": null "docstring": null
}, },
"click": { "click": {
"name": "click", "name": "click",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.commands.mcp_utils.click", "path": "docforge.cli.commands.mcp_logic.click",
"signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mcp_utils.click')>", "signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mcp.logic.click')>",
"docstring": null "docstring": null
}, },
"GriffeLoader": { "GriffeLoader": {
"name": "GriffeLoader", "name": "GriffeLoader",
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mcp_utils.GriffeLoader", "path": "docforge.cli.commands.mcp_logic.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mcp_utils.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.", "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.commands.mcp_utils.GriffeLoader.load_project", "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')>", "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.commands.mcp_utils.GriffeLoader.load_module", "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')>", "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."
} }
@@ -280,58 +280,58 @@
"discover_module_paths": { "discover_module_paths": {
"name": "discover_module_paths", "name": "discover_module_paths",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.discover_module_paths", "path": "docforge.cli.commands.mcp_logic.discover_module_paths",
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mcp_utils.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." "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": { "MCPRenderer": {
"name": "MCPRenderer", "name": "MCPRenderer",
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mcp_utils.MCPRenderer", "path": "docforge.cli.commands.mcp_logic.MCPRenderer",
"signature": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.cli.mcp_utils.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.", "docstring": "Renderer that emits MCP-native JSON resources from docforge models.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
"kind": "attribute", "kind": "attribute",
"path": "docforge.cli.commands.mcp_utils.MCPRenderer.name", "path": "docforge.cli.commands.mcp_logic.MCPRenderer.name",
"signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>", "signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>",
"docstring": null "docstring": null
}, },
"generate_sources": { "generate_sources": {
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.MCPRenderer.generate_sources", "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')>", "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.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." "docstring": "Generate MCP-compatible JSON resources and navigation for the project."
} }
} }
}, },
"MCPServer": { "MCPServer": {
"name": "MCPServer", "name": "MCPServer",
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mcp_utils.MCPServer", "path": "docforge.cli.commands.mcp_logic.MCPServer",
"signature": "<bound method Alias.signature of Alias('MCPServer', 'docforge.cli.mcp_utils.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.", "docstring": "MCP server for serving a pre-built MCP documentation bundle.",
"members": { "members": {
"mcp_root": { "mcp_root": {
"name": "mcp_root", "name": "mcp_root",
"kind": "attribute", "kind": "attribute",
"path": "docforge.cli.commands.mcp_utils.MCPServer.mcp_root", "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')>", "signature": "<bound method Alias.signature of Alias('mcp_root', 'docforge.servers.mcp_server.MCPServer.mcp_root')>",
"docstring": null "docstring": null
}, },
"app": { "app": {
"name": "app", "name": "app",
"kind": "attribute", "kind": "attribute",
"path": "docforge.cli.commands.mcp_utils.MCPServer.app", "path": "docforge.cli.commands.mcp_logic.MCPServer.app",
"signature": "<bound method Alias.signature of Alias('app', 'docforge.servers.mcp_server.MCPServer.app')>", "signature": "<bound method Alias.signature of Alias('app', 'docforge.servers.mcp_server.MCPServer.app')>",
"docstring": null "docstring": null
}, },
"run": { "run": {
"name": "run", "name": "run",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.MCPServer.run", "path": "docforge.cli.commands.mcp_logic.MCPServer.run",
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.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)" "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)"
} }
@@ -340,328 +340,332 @@
"generate_resources": { "generate_resources": {
"name": "generate_resources", "name": "generate_resources",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.generate_resources", "path": "docforge.cli.commands.mcp_logic.generate_resources",
"signature": "<bound method Alias.signature of Alias('generate_resources', 'docforge.cli.mcp_utils.generate_resources')>", "signature": "<bound method Alias.signature of Alias('generate_resources', 'docforge.cli.mcp.logic.generate_resources')>",
"docstring": "Generate MCP-compatible documentation resources.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n out_dir: Directory where the MCP JSON resources and nav will be written." "docstring": "Generate MCP-compatible documentation resources."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.serve", "path": "docforge.cli.commands.mcp_logic.serve",
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp_utils.serve')>", "signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp.logic.serve')>",
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/." "docstring": "Serve MCP documentation."
} }
} }
}, },
"cli": { "cli": {
"name": "cli", "name": "cli",
"kind": "attribute", "kind": "function",
"path": "docforge.cli.commands.cli", "path": "docforge.cli.commands.cli",
"signature": null, "signature": "<bound method Function.signature of Function('cli', 8, 14)>",
"docstring": null "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation."
}, },
"build": { "build": {
"name": "build", "name": "build",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.build", "path": "docforge.cli.commands.build",
"signature": "<bound method Function.signature of Function('build', 18, 89)>", "signature": "<bound method Function.signature of Function('build', 16, 69)>",
"docstring": "Build documentation (MkDocs site or MCP resources).\n\nThis command orchestrates the full build process:\n1. Introspects the code (Griffe)\n2. Renders sources (MkDocs Markdown or MCP JSON)\n3. (MkDocs only) Generates config and runs the final site build.\n\nArgs:\n mcp: Use the MCP documentation builder.\n mkdocs: Use the MkDocs documentation builder.\n module: The dotted path of the module to document.\n project_name: Optional override for the project name.\n site_name: (MkDocs) The site display name. Defaults to module name.\n docs_dir: (MkDocs) Target directory for Markdown sources.\n nav_file: (MkDocs) Path to the docforge.nav.yml specification.\n template: (MkDocs) Optional custom mkdocs.yml template.\n mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.\n out_dir: (MCP) Target directory for MCP JSON resources." "docstring": "Build documentation (MkDocs site or MCP resources)."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.serve", "path": "docforge.cli.commands.serve",
"signature": "<bound method Function.signature of Function('serve', 92, 120)>", "signature": "<bound method Function.signature of Function('serve', 71, 93)>",
"docstring": "Serve documentation (MkDocs or MCP).\n\nArgs:\n mcp: Serve MCP resources via an MCP server.\n mkdocs: Serve the MkDocs site using the built-in development server.\n mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.\n out_dir: (MCP) Path to the mcp_docs/ directory." "docstring": "Serve documentation."
}, },
"tree": { "tree": {
"name": "tree", "name": "tree",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.tree", "path": "docforge.cli.commands.tree",
"signature": "<bound method Function.signature of Function('tree', 123, 153)>", "signature": "<bound method Function.signature of Function('tree', 95, 121)>",
"docstring": "Visualize the project structure in the terminal.\n\nArgs:\n modules: List of module import paths to recursively introspect.\n project_name: Optional override for the project name shown at the root." "docstring": "Visualize the project structure."
},
"Group": {
"name": "Group",
"kind": "alias",
"path": "docforge.cli.commands.Group",
"signature": "<bound method Alias.signature of Alias('Group', 'click.core.Group')>",
"docstring": null
},
"Any": {
"name": "Any",
"kind": "alias",
"path": "docforge.cli.commands.Any",
"signature": "<bound method Alias.signature of Alias('Any', 'typing.Any')>",
"docstring": null
} }
} }
}, },
"mcp_utils": { "mcp": {
"name": "mcp_utils", "name": "mcp",
"kind": "module", "kind": "module",
"path": "docforge.cli.mcp_utils", "path": "docforge.cli.mcp",
"signature": null, "signature": null,
"docstring": null, "docstring": null,
"members": { "members": {
"Path": { "logic": {
"name": "Path", "name": "logic",
"kind": "alias", "kind": "module",
"path": "docforge.cli.mcp_utils.Path", "path": "docforge.cli.mcp.logic",
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>", "signature": null,
"docstring": null "docstring": null,
},
"click": {
"name": "click",
"kind": "alias",
"path": "docforge.cli.mcp_utils.click",
"signature": "<bound method Alias.signature of Alias('click', 'click')>",
"docstring": null
},
"GriffeLoader": {
"name": "GriffeLoader",
"kind": "class",
"path": "docforge.cli.mcp_utils.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": { "members": {
"load_project": { "Path": {
"name": "load_project", "name": "Path",
"kind": "function", "kind": "alias",
"path": "docforge.cli.mcp_utils.GriffeLoader.load_project", "path": "docforge.cli.mcp.logic.Path",
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>", "signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
"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": null
}, },
"load_module": { "click": {
"name": "load_module", "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", "kind": "function",
"path": "docforge.cli.mcp_utils.GriffeLoader.load_module", "path": "docforge.cli.mcp.logic.discover_module_paths",
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>", "signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>",
"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": "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."
} }
} }
}, }
"discover_module_paths": { }
"name": "discover_module_paths", },
"kind": "function", "mkdocs": {
"path": "docforge.cli.mcp_utils.discover_module_paths", "name": "mkdocs",
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>", "kind": "module",
"docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths." "path": "docforge.cli.mkdocs",
}, "signature": null,
"MCPRenderer": { "docstring": null,
"name": "MCPRenderer", "members": {
"kind": "class", "logic": {
"path": "docforge.cli.mcp_utils.MCPRenderer", "name": "logic",
"signature": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.renderers.MCPRenderer')>", "kind": "module",
"docstring": "Renderer that emits MCP-native JSON resources from docforge models.", "path": "docforge.cli.mkdocs.logic",
"signature": null,
"docstring": null,
"members": { "members": {
"name": { "Path": {
"name": "name", "name": "Path",
"kind": "attribute", "kind": "alias",
"path": "docforge.cli.mcp_utils.MCPRenderer.name", "path": "docforge.cli.mkdocs.logic.Path",
"signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>", "signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
"docstring": null "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": { "generate_sources": {
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.MCPRenderer.generate_sources", "path": "docforge.cli.mkdocs.logic.generate_sources",
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>", "signature": "<bound method Function.signature of Function('generate_sources', 9, 18)>",
"docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." "docstring": "Generate Markdown source files for the specified module."
}
}
},
"MCPServer": {
"name": "MCPServer",
"kind": "class",
"path": "docforge.cli.mcp_utils.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_utils.MCPServer.mcp_root",
"signature": "<bound method Alias.signature of Alias('mcp_root', 'docforge.servers.mcp_server.MCPServer.mcp_root')>",
"docstring": null
}, },
"app": { "generate_config": {
"name": "app", "name": "generate_config",
"kind": "attribute", "kind": "function",
"path": "docforge.cli.mcp_utils.MCPServer.app", "path": "docforge.cli.mkdocs.logic.generate_config",
"signature": "<bound method Alias.signature of Alias('app', 'docforge.servers.mcp_server.MCPServer.app')>", "signature": "<bound method Function.signature of Function('generate_config', 20, 47)>",
"docstring": null "docstring": "Generate an mkdocs.yml configuration file."
}, },
"run": { "build": {
"name": "run", "name": "build",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.MCPServer.run", "path": "docforge.cli.mkdocs.logic.build",
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>", "signature": "<bound method Function.signature of Function('build', 49, 59)>",
"docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)" "docstring": "Build the documentation site using MkDocs."
}
}
},
"generate_resources": {
"name": "generate_resources",
"kind": "function",
"path": "docforge.cli.mcp_utils.generate_resources",
"signature": "<bound method Function.signature of Function('generate_resources', 7, 21)>",
"docstring": "Generate MCP-compatible documentation resources.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n out_dir: Directory where the MCP JSON resources and nav will be written."
},
"serve": {
"name": "serve",
"kind": "function",
"path": "docforge.cli.mcp_utils.serve",
"signature": "<bound method Function.signature of Function('serve', 23, 47)>",
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/."
}
}
},
"mkdocs_utils": {
"name": "mkdocs_utils",
"kind": "module",
"path": "docforge.cli.mkdocs_utils",
"signature": null,
"docstring": null,
"members": {
"Path": {
"name": "Path",
"kind": "alias",
"path": "docforge.cli.mkdocs_utils.Path",
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
"docstring": null
},
"resources": {
"name": "resources",
"kind": "alias",
"path": "docforge.cli.mkdocs_utils.resources",
"signature": "<bound method Alias.signature of Alias('resources', 'importlib.resources')>",
"docstring": null
},
"click": {
"name": "click",
"kind": "alias",
"path": "docforge.cli.mkdocs_utils.click",
"signature": "<bound method Alias.signature of Alias('click', 'click')>",
"docstring": null
},
"yaml": {
"name": "yaml",
"kind": "alias",
"path": "docforge.cli.mkdocs_utils.yaml",
"signature": "<bound method Alias.signature of Alias('yaml', 'yaml')>",
"docstring": null
},
"GriffeLoader": {
"name": "GriffeLoader",
"kind": "class",
"path": "docforge.cli.mkdocs_utils.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_utils.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": { "serve": {
"name": "load_module", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.GriffeLoader.load_module", "path": "docforge.cli.mkdocs.logic.serve",
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>", "signature": "<bound method Function.signature of Function('serve', 61, 69)>",
"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": "Serve the documentation site with live-reload using MkDocs."
} }
} }
},
"discover_module_paths": {
"name": "discover_module_paths",
"kind": "function",
"path": "docforge.cli.mkdocs_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.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_utils.generate_sources",
"signature": "<bound method Function.signature of Function('generate_sources', 9, 23)>",
"docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written."
},
"generate_config": {
"name": "generate_config",
"kind": "function",
"path": "docforge.cli.mkdocs_utils.generate_config",
"signature": "<bound method Function.signature of Function('generate_config', 25, 59)>",
"docstring": "Generate an mkdocs.yml configuration file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template (overrides built-in).\n out: Path where the final mkdocs.yml will be written.\n site_name: The display name for the documentation site."
},
"build": {
"name": "build",
"kind": "function",
"path": "docforge.cli.mkdocs_utils.build",
"signature": "<bound method Function.signature of Function('build', 61, 74)>",
"docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
},
"serve": {
"name": "serve",
"kind": "function",
"path": "docforge.cli.mkdocs_utils.serve",
"signature": "<bound method Function.signature of Function('serve', 76, 87)>",
"docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
} }
} }
} }

View File

@@ -2,20 +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 delegates all command\nexecution to docforge.cli.commands.", "docstring": "Main entry point for the doc-forge CLI.",
"objects": { "objects": {
"cli": { "cli": {
"name": "cli", "name": "cli",
"kind": "attribute", "kind": "function",
"path": "docforge.cli.main.cli", "path": "docforge.cli.main.cli",
"signature": "<bound method Alias.signature of Alias('cli', 'docforge.cli.commands.cli')>", "signature": "<bound method Alias.signature of Alias('cli', 'docforge.cli.commands.cli')>",
"docstring": null "docstring": "doc-forge CLI: A tool for introspecting Python projects and generating\ndocumentation."
}, },
"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', 7, 11)>", "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."
} }
} }

View 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."
}
}
}
}
}
}

View File

@@ -1,41 +1,41 @@
{ {
"module": "docforge.cli.mcp_utils", "module": "docforge.cli.mcp.logic",
"content": { "content": {
"path": "docforge.cli.mcp_utils", "path": "docforge.cli.mcp.logic",
"docstring": null, "docstring": null,
"objects": { "objects": {
"Path": { "Path": {
"name": "Path", "name": "Path",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.mcp_utils.Path", "path": "docforge.cli.mcp.logic.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
}, },
"click": { "click": {
"name": "click", "name": "click",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.mcp_utils.click", "path": "docforge.cli.mcp.logic.click",
"signature": "<bound method Alias.signature of Alias('click', 'click')>", "signature": "<bound method Alias.signature of Alias('click', 'click')>",
"docstring": null "docstring": null
}, },
"GriffeLoader": { "GriffeLoader": {
"name": "GriffeLoader", "name": "GriffeLoader",
"kind": "class", "kind": "class",
"path": "docforge.cli.mcp_utils.GriffeLoader", "path": "docforge.cli.mcp.logic.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.mcp_utils.GriffeLoader.load_project", "path": "docforge.cli.mcp.logic.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.mcp_utils.GriffeLoader.load_module", "path": "docforge.cli.mcp.logic.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."
} }
@@ -44,58 +44,58 @@
"discover_module_paths": { "discover_module_paths": {
"name": "discover_module_paths", "name": "discover_module_paths",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.discover_module_paths", "path": "docforge.cli.mcp.logic.discover_module_paths",
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.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." "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": { "MCPRenderer": {
"name": "MCPRenderer", "name": "MCPRenderer",
"kind": "class", "kind": "class",
"path": "docforge.cli.mcp_utils.MCPRenderer", "path": "docforge.cli.mcp.logic.MCPRenderer",
"signature": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.renderers.MCPRenderer')>", "signature": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.renderers.MCPRenderer')>",
"docstring": "Renderer that emits MCP-native JSON resources from docforge models.", "docstring": "Renderer that emits MCP-native JSON resources from docforge models.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
"kind": "attribute", "kind": "attribute",
"path": "docforge.cli.mcp_utils.MCPRenderer.name", "path": "docforge.cli.mcp.logic.MCPRenderer.name",
"signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>", "signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>",
"docstring": null "docstring": null
}, },
"generate_sources": { "generate_sources": {
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.MCPRenderer.generate_sources", "path": "docforge.cli.mcp.logic.MCPRenderer.generate_sources",
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.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.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." "docstring": "Generate MCP-compatible JSON resources and navigation for the project."
} }
} }
}, },
"MCPServer": { "MCPServer": {
"name": "MCPServer", "name": "MCPServer",
"kind": "class", "kind": "class",
"path": "docforge.cli.mcp_utils.MCPServer", "path": "docforge.cli.mcp.logic.MCPServer",
"signature": "<bound method Alias.signature of Alias('MCPServer', 'docforge.servers.MCPServer')>", "signature": "<bound method Alias.signature of Alias('MCPServer', 'docforge.servers.MCPServer')>",
"docstring": "MCP server for serving a pre-built MCP documentation bundle.", "docstring": "MCP server for serving a pre-built MCP documentation bundle.",
"members": { "members": {
"mcp_root": { "mcp_root": {
"name": "mcp_root", "name": "mcp_root",
"kind": "attribute", "kind": "attribute",
"path": "docforge.cli.mcp_utils.MCPServer.mcp_root", "path": "docforge.cli.mcp.logic.MCPServer.mcp_root",
"signature": "<bound method Alias.signature of Alias('mcp_root', 'docforge.servers.mcp_server.MCPServer.mcp_root')>", "signature": "<bound method Alias.signature of Alias('mcp_root', 'docforge.servers.mcp_server.MCPServer.mcp_root')>",
"docstring": null "docstring": null
}, },
"app": { "app": {
"name": "app", "name": "app",
"kind": "attribute", "kind": "attribute",
"path": "docforge.cli.mcp_utils.MCPServer.app", "path": "docforge.cli.mcp.logic.MCPServer.app",
"signature": "<bound method Alias.signature of Alias('app', 'docforge.servers.mcp_server.MCPServer.app')>", "signature": "<bound method Alias.signature of Alias('app', 'docforge.servers.mcp_server.MCPServer.app')>",
"docstring": null "docstring": null
}, },
"run": { "run": {
"name": "run", "name": "run",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.MCPServer.run", "path": "docforge.cli.mcp.logic.MCPServer.run",
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.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)" "docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)"
} }
@@ -104,16 +104,16 @@
"generate_resources": { "generate_resources": {
"name": "generate_resources", "name": "generate_resources",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.generate_resources", "path": "docforge.cli.mcp.logic.generate_resources",
"signature": "<bound method Function.signature of Function('generate_resources', 7, 21)>", "signature": "<bound method Function.signature of Function('generate_resources', 7, 16)>",
"docstring": "Generate MCP-compatible documentation resources.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n out_dir: Directory where the MCP JSON resources and nav will be written." "docstring": "Generate MCP-compatible documentation resources."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.serve", "path": "docforge.cli.mcp.logic.serve",
"signature": "<bound method Function.signature of Function('serve', 23, 47)>", "signature": "<bound method Function.signature of Function('serve', 18, 39)>",
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/." "docstring": "Serve MCP documentation."
} }
} }
} }

View File

@@ -0,0 +1,157 @@
{
"module": "docforge.cli.mkdocs",
"content": {
"path": "docforge.cli.mkdocs",
"docstring": null,
"objects": {
"logic": {
"name": "logic",
"kind": "module",
"path": "docforge.cli.mkdocs.logic",
"signature": null,
"docstring": null,
"members": {
"Path": {
"name": "Path",
"kind": "alias",
"path": "docforge.cli.mkdocs.logic.Path",
"signature": "<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."
}
}
}
}
}
}

View File

@@ -1,55 +1,55 @@
{ {
"module": "docforge.cli.mkdocs_utils", "module": "docforge.cli.mkdocs.logic",
"content": { "content": {
"path": "docforge.cli.mkdocs_utils", "path": "docforge.cli.mkdocs.logic",
"docstring": null, "docstring": null,
"objects": { "objects": {
"Path": { "Path": {
"name": "Path", "name": "Path",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.mkdocs_utils.Path", "path": "docforge.cli.mkdocs.logic.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
}, },
"resources": { "resources": {
"name": "resources", "name": "resources",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.mkdocs_utils.resources", "path": "docforge.cli.mkdocs.logic.resources",
"signature": "<bound method Alias.signature of Alias('resources', 'importlib.resources')>", "signature": "<bound method Alias.signature of Alias('resources', 'importlib.resources')>",
"docstring": null "docstring": null
}, },
"click": { "click": {
"name": "click", "name": "click",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.mkdocs_utils.click", "path": "docforge.cli.mkdocs.logic.click",
"signature": "<bound method Alias.signature of Alias('click', 'click')>", "signature": "<bound method Alias.signature of Alias('click', 'click')>",
"docstring": null "docstring": null
}, },
"yaml": { "yaml": {
"name": "yaml", "name": "yaml",
"kind": "alias", "kind": "alias",
"path": "docforge.cli.mkdocs_utils.yaml", "path": "docforge.cli.mkdocs.logic.yaml",
"signature": "<bound method Alias.signature of Alias('yaml', 'yaml')>", "signature": "<bound method Alias.signature of Alias('yaml', 'yaml')>",
"docstring": null "docstring": null
}, },
"GriffeLoader": { "GriffeLoader": {
"name": "GriffeLoader", "name": "GriffeLoader",
"kind": "class", "kind": "class",
"path": "docforge.cli.mkdocs_utils.GriffeLoader", "path": "docforge.cli.mkdocs.logic.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.mkdocs_utils.GriffeLoader.load_project", "path": "docforge.cli.mkdocs.logic.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.mkdocs_utils.GriffeLoader.load_module", "path": "docforge.cli.mkdocs.logic.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."
} }
@@ -58,28 +58,28 @@
"discover_module_paths": { "discover_module_paths": {
"name": "discover_module_paths", "name": "discover_module_paths",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.discover_module_paths", "path": "docforge.cli.mkdocs.logic.discover_module_paths",
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.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." "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": { "MkDocsRenderer": {
"name": "MkDocsRenderer", "name": "MkDocsRenderer",
"kind": "class", "kind": "class",
"path": "docforge.cli.mkdocs_utils.MkDocsRenderer", "path": "docforge.cli.mkdocs.logic.MkDocsRenderer",
"signature": "<bound method Alias.signature of Alias('MkDocsRenderer', 'docforge.renderers.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.", "docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
"kind": "attribute", "kind": "attribute",
"path": "docforge.cli.mkdocs_utils.MkDocsRenderer.name", "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.name",
"signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.name')>", "signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.name')>",
"docstring": null "docstring": null
}, },
"generate_sources": { "generate_sources": {
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_sources", "path": "docforge.cli.mkdocs.logic.MkDocsRenderer.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.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." "docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
} }
@@ -88,28 +88,28 @@
"load_nav_spec": { "load_nav_spec": {
"name": "load_nav_spec", "name": "load_nav_spec",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.load_nav_spec", "path": "docforge.cli.mkdocs.logic.load_nav_spec",
"signature": "<bound method Alias.signature of Alias('load_nav_spec', 'docforge.nav.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." "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": { "resolve_nav": {
"name": "resolve_nav", "name": "resolve_nav",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.resolve_nav", "path": "docforge.cli.mkdocs.logic.resolve_nav",
"signature": "<bound method Alias.signature of Alias('resolve_nav', 'docforge.nav.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." "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": { "MkDocsNavEmitter": {
"name": "MkDocsNavEmitter", "name": "MkDocsNavEmitter",
"kind": "class", "kind": "class",
"path": "docforge.cli.mkdocs_utils.MkDocsNavEmitter", "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter",
"signature": "<bound method Alias.signature of Alias('MkDocsNavEmitter', 'docforge.nav.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.", "docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.",
"members": { "members": {
"emit": { "emit": {
"name": "emit", "name": "emit",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.MkDocsNavEmitter.emit", "path": "docforge.cli.mkdocs.logic.MkDocsNavEmitter.emit",
"signature": "<bound method Alias.signature of Alias('emit', 'docforge.nav.mkdocs.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." "docstring": "Generate a list of navigation entries for mkdocs.yml.\n\nArgs:\n nav: The resolved navigation data.\n\nReturns:\n A list of dictionary mappings representing the MkDocs navigation."
} }
@@ -118,30 +118,30 @@
"generate_sources": { "generate_sources": {
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.generate_sources", "path": "docforge.cli.mkdocs.logic.generate_sources",
"signature": "<bound method Function.signature of Function('generate_sources', 9, 23)>", "signature": "<bound method Function.signature of Function('generate_sources', 9, 18)>",
"docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written." "docstring": "Generate Markdown source files for the specified module."
}, },
"generate_config": { "generate_config": {
"name": "generate_config", "name": "generate_config",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.generate_config", "path": "docforge.cli.mkdocs.logic.generate_config",
"signature": "<bound method Function.signature of Function('generate_config', 25, 59)>", "signature": "<bound method Function.signature of Function('generate_config', 20, 47)>",
"docstring": "Generate an mkdocs.yml configuration file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template (overrides built-in).\n out: Path where the final mkdocs.yml will be written.\n site_name: The display name for the documentation site." "docstring": "Generate an mkdocs.yml configuration file."
}, },
"build": { "build": {
"name": "build", "name": "build",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.build", "path": "docforge.cli.mkdocs.logic.build",
"signature": "<bound method Function.signature of Function('build', 61, 74)>", "signature": "<bound method Function.signature of Function('build', 49, 59)>",
"docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." "docstring": "Build the documentation site using MkDocs."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.serve", "path": "docforge.cli.mkdocs.logic.serve",
"signature": "<bound method Function.signature of Function('serve', 76, 87)>", "signature": "<bound method Function.signature of Function('serve', 61, 69)>",
"docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file." "docstring": "Serve the documentation site with live-reload using MkDocs."
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -46,7 +46,7 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.MCPRenderer.generate_sources", "path": "docforge.renderers.MCPRenderer.generate_sources",
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.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.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." "docstring": "Generate MCP-compatible JSON resources and navigation for the project."
} }
} }
}, },
@@ -383,7 +383,7 @@
"name": "MCPRenderer", "name": "MCPRenderer",
"kind": "class", "kind": "class",
"path": "docforge.renderers.mcp_renderer.MCPRenderer", "path": "docforge.renderers.mcp_renderer.MCPRenderer",
"signature": "<bound method Class.signature of Class('MCPRenderer', 8, 122)>", "signature": "<bound method Class.signature of Class('MCPRenderer', 8, 102)>",
"docstring": "Renderer that emits MCP-native JSON resources from docforge models.", "docstring": "Renderer that emits MCP-native JSON resources from docforge models.",
"members": { "members": {
"name": { "name": {
@@ -397,8 +397,8 @@
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.MCPRenderer.generate_sources", "path": "docforge.renderers.mcp_renderer.MCPRenderer.generate_sources",
"signature": "<bound method Function.signature of Function('generate_sources', 15, 53)>", "signature": "<bound method Function.signature of Function('generate_sources', 15, 49)>",
"docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." "docstring": "Generate MCP-compatible JSON resources and navigation for the project."
} }
} }
} }

View File

@@ -210,7 +210,7 @@
"name": "MCPRenderer", "name": "MCPRenderer",
"kind": "class", "kind": "class",
"path": "docforge.renderers.mcp_renderer.MCPRenderer", "path": "docforge.renderers.mcp_renderer.MCPRenderer",
"signature": "<bound method Class.signature of Class('MCPRenderer', 8, 122)>", "signature": "<bound method Class.signature of Class('MCPRenderer', 8, 102)>",
"docstring": "Renderer that emits MCP-native JSON resources from docforge models.", "docstring": "Renderer that emits MCP-native JSON resources from docforge models.",
"members": { "members": {
"name": { "name": {
@@ -224,8 +224,8 @@
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.MCPRenderer.generate_sources", "path": "docforge.renderers.mcp_renderer.MCPRenderer.generate_sources",
"signature": "<bound method Function.signature of Function('generate_sources', 15, 53)>", "signature": "<bound method Function.signature of Function('generate_sources', 15, 49)>",
"docstring": "Generate MCP-compatible JSON resources and navigation for the project.\n\nArgs:\n project: The project model to render.\n out_dir: Target directory for the generated JSON files." "docstring": "Generate MCP-compatible JSON resources and navigation for the project."
} }
} }
} }

View File

@@ -16,12 +16,20 @@
"resource": "doc://modules/docforge.cli.main" "resource": "doc://modules/docforge.cli.main"
}, },
{ {
"module": "docforge.cli.mcp_utils", "module": "docforge.cli.mcp",
"resource": "doc://modules/docforge.cli.mcp_utils" "resource": "doc://modules/docforge.cli.mcp"
}, },
{ {
"module": "docforge.cli.mkdocs_utils", "module": "docforge.cli.mcp.logic",
"resource": "doc://modules/docforge.cli.mkdocs_utils" "resource": "doc://modules/docforge.cli.mcp.logic"
},
{
"module": "docforge.cli.mkdocs",
"resource": "doc://modules/docforge.cli.mkdocs"
},
{
"module": "docforge.cli.mkdocs.logic",
"resource": "doc://modules/docforge.cli.mkdocs.logic"
}, },
{ {
"module": "docforge.loaders", "module": "docforge.loaders",

View File

@@ -58,5 +58,7 @@ nav:
- docforge/cli/index.md - docforge/cli/index.md
- docforge/cli/main.md - docforge/cli/main.md
- docforge/cli/commands.md - docforge/cli/commands.md
- docforge/cli/mcp_utils.md - docforge/cli/mcp/index.md
- docforge/cli/mkdocs_utils.md - docforge/cli/mcp/logic.md
- docforge/cli/mkdocs/index.md
- docforge/cli/mkdocs/logic.md

View File

@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "doc-forge" name = "doc-forge"
version = "0.0.4" version = "0.0.2"
description = "A renderer-agnostic Python documentation compiler" description = "A renderer-agnostic Python documentation compiler"
readme = "README.md" readme = "README.md"
requires-python = ">=3.10" requires-python = ">=3.10"

View File

@@ -1,4 +1,6 @@
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_mcp_build(cli_runner):

View File

@@ -48,52 +48,7 @@ def test_mkdocs_build_missing_module_fails(cli_runner):
assert result.exit_code != 0 assert result.exit_code != 0
assert "--module is required" in result.output assert "--module is required" in result.output
def test_mkdocs_build_without_site_name_uses_module_as_default_full_flow( def test_mkdocs_build_missing_site_name_fails(cli_runner):
cli_runner, result = cli_runner.invoke(cli, ["build", "--mkdocs", "--module", "testpkg"])
mock_mkdocs_build, assert result.exit_code != 0
mock_mkdocs_load_config, assert "--site-name is required" in result.output
):
# Full integration test: real generation, real config, mocked mkdocs build
with cli_runner.isolated_filesystem():
cwd = Path.cwd()
# Create a minimal Python package
pkg = cwd / "testpkg"
pkg.mkdir()
(pkg / "__init__.py").write_text("")
(pkg / "mod.py").write_text("def f(): ...\n")
# Create nav spec expected by generate_config
nav_file = cwd / "docforge.nav.yml"
nav_file.write_text(
"home: testpkg/index.md\ngroups: {}\n",
encoding="utf-8",
)
result = cli_runner.invoke(
cli,
[
"build",
"--mkdocs",
"--module",
"testpkg",
"--docs-dir",
"docs",
"--mkdocs-yml",
"mkdocs.yml",
],
)
assert result.exit_code == 0
assert mock_mkdocs_build() is True
# MkDocs config must exist
mkdocs_yml = cwd / "mkdocs.yml"
assert mkdocs_yml.exists()
# Site name must default to module name
content = mkdocs_yml.read_text()
assert "site_name: testpkg" in content
# Docs must be generated
assert (cwd / "docs" / "testpkg" / "mod.md").exists()

View File

@@ -10,7 +10,7 @@ def test_mcp_serve(
result = cli_runner.invoke( result = cli_runner.invoke(
cli, cli,
["serve", "--mcp", "--module", "fake_module", "--out-dir", str(fake_mcp_docs)], ["serve", "--mcp", "--out-dir", str(fake_mcp_docs)],
) )
assert result.exit_code == 0 assert result.exit_code == 0