Compare commits
34 Commits
dca19caaf3
...
0.0.4
| Author | SHA1 | Date | |
|---|---|---|---|
| 56fb39de08 | |||
| 8a509e590a | |||
| cb68b0b93f | |||
| 2ed962d639 | |||
| 678f522456 | |||
| ff92906720 | |||
| 94c1818103 | |||
| 15c59ab274 | |||
| e33133cb0e | |||
| f76d8ccce4 | |||
| f6a596ab62 | |||
| ef378e676b | |||
| 751bbe8949 | |||
| 5370a7faa2 | |||
| ce2eafac85 | |||
| 0d0959c95b | |||
| 427e407d26 | |||
| 9a5e356039 | |||
| b1544c9610 | |||
| 4a876abc62 | |||
| b6e5114532 | |||
| 81e8a8cd49 | |||
| be8f23c8ab | |||
| 9392d2c999 | |||
| 9d0b6e78d1 | |||
| 4fa3bc0533 | |||
| 46b7cc52e1 | |||
| c8ecc6a476 | |||
| 5c8d9dcc9c | |||
| b497c5d2e9 | |||
| 0061dbe2eb | |||
| 6f9776dff2 | |||
| 6c9fb433cb | |||
| 6b334fd181 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -57,7 +57,6 @@ docs/build/
|
|||||||
# =========================
|
# =========================
|
||||||
# MkDocs / Sphinx output
|
# MkDocs / Sphinx output
|
||||||
# =========================
|
# =========================
|
||||||
mkdocs.yml
|
|
||||||
site/
|
site/
|
||||||
.build/
|
.build/
|
||||||
_doctrees/
|
_doctrees/
|
||||||
|
|||||||
327
ADS.llm.md
327
ADS.llm.md
@@ -1,327 +0,0 @@
|
|||||||
# 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.*
|
|
||||||
@@ -56,7 +56,7 @@ doc-forge server mypackage
|
|||||||
### Python API
|
### Python API
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from docforge.loader import GriffeLoader
|
from docforge.loaders import GriffeLoader
|
||||||
from docforge.renderers import MkDocsRenderer
|
from docforge.renderers import MkDocsRenderer
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
@@ -70,6 +70,7 @@ renderer.generate_sources(project, Path("docs"))
|
|||||||
|
|
||||||
# Build final documentation
|
# Build final documentation
|
||||||
from docforge.renderers.base import RendererConfig
|
from docforge.renderers.base import RendererConfig
|
||||||
|
|
||||||
config = RendererConfig(Path("docs"), project)
|
config = RendererConfig(Path("docs"), project)
|
||||||
renderer.build(config)
|
renderer.build(config)
|
||||||
```
|
```
|
||||||
|
|||||||
26
docforge.nav.yml
Normal file
26
docforge.nav.yml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
home: docforge/index.md
|
||||||
|
groups:
|
||||||
|
Loaders:
|
||||||
|
- docforge/loaders/index.md
|
||||||
|
- docforge/loaders/griffe_loader.md
|
||||||
|
Models:
|
||||||
|
- docforge/models/index.md
|
||||||
|
- docforge/models/module.md
|
||||||
|
- docforge/models/object.md
|
||||||
|
- docforge/models/project.md
|
||||||
|
Navigation:
|
||||||
|
- docforge/nav/index.md
|
||||||
|
- docforge/nav/spec.md
|
||||||
|
- docforge/nav/resolver.md
|
||||||
|
- docforge/nav/mkdocs.md
|
||||||
|
Renderers:
|
||||||
|
- docforge/renderers/index.md
|
||||||
|
- docforge/renderers/base.md
|
||||||
|
- docforge/renderers/mkdocs_renderer.md
|
||||||
|
- docforge/renderers/mcp_renderer.md
|
||||||
|
CLI:
|
||||||
|
- docforge/cli/index.md
|
||||||
|
- docforge/cli/main.md
|
||||||
|
- docforge/cli/commands.md
|
||||||
|
- docforge/cli/mcp_utils.md
|
||||||
|
- docforge/cli/mkdocs_utils.md
|
||||||
@@ -1,20 +1,98 @@
|
|||||||
"""
|
"""
|
||||||
doc-forge — renderer-agnostic Python documentation compiler.
|
# doc-forge
|
||||||
|
|
||||||
At this stage, doc-forge publicly exposes only the Introspection Layer.
|
`doc-forge` is a renderer-agnostic Python documentation compiler designed for
|
||||||
All the rendering, exporting, and serving APIs are intentionally private
|
speed, flexibility, and beautiful output. It decouples the introspection of
|
||||||
until their contracts are finalized.
|
your code from the rendering process, allowing you to generate documentation
|
||||||
|
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
|
||||||
|
|
||||||
|
Install using `pip` with the optional `mkdocs` dependencies for a complete setup:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install doc-forge
|
||||||
|
```
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
1. **Build Documentation**:
|
||||||
|
Introspect your package and generate documentation in one step:
|
||||||
|
```bash
|
||||||
|
# Build MkDocs site
|
||||||
|
doc-forge build --mkdocs --module my_package --site-name "My Docs"
|
||||||
|
|
||||||
|
# Build MCP resources
|
||||||
|
doc-forge build --mcp --module my_package
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Define Navigation**:
|
||||||
|
Create a `docforge.nav.yml` to organize your documentation:
|
||||||
|
```yaml
|
||||||
|
home: my_package/index.md
|
||||||
|
groups:
|
||||||
|
Core API:
|
||||||
|
- my_package/core/*.md
|
||||||
|
Utilities:
|
||||||
|
- my_package/utils.md
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Preview**:
|
||||||
|
```bash
|
||||||
|
# Serve MkDocs site
|
||||||
|
doc-forge serve --mkdocs
|
||||||
|
|
||||||
|
# Serve MCP documentation
|
||||||
|
doc-forge serve --mcp
|
||||||
|
```
|
||||||
|
|
||||||
|
## Project Structure
|
||||||
|
|
||||||
|
- `docforge.loaders`: Introspects source code using static analysis (`griffe`).
|
||||||
|
- `docforge.models`: The internal representation of your project, modules, and objects.
|
||||||
|
- `docforge.renderers`: Converters that turn the models into physical files.
|
||||||
|
- `docforge.nav`: Managers for logical-to-physical path mapping and navigation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from .loader import GriffeLoader, discover_module_paths
|
from .loaders import GriffeLoader, discover_module_paths
|
||||||
from .renderers import MkDocsRenderer
|
from .renderers import MkDocsRenderer, MCPRenderer
|
||||||
from .cli import main
|
from .cli import main
|
||||||
from . import model
|
from . import models
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"GriffeLoader",
|
"GriffeLoader",
|
||||||
"discover_module_paths",
|
"discover_module_paths",
|
||||||
"MkDocsRenderer",
|
"MkDocsRenderer",
|
||||||
"model",
|
"MCPRenderer",
|
||||||
|
"models",
|
||||||
"main",
|
"main",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
from .loader import GriffeLoader
|
from .loaders import GriffeLoader, discover_module_paths
|
||||||
from .renderers import MkDocsRenderer
|
from .renderers import MkDocsRenderer, MCPRenderer
|
||||||
from .cli import main
|
from .cli import main
|
||||||
from . import model
|
from . import models
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"GriffeLoader",
|
"GriffeLoader",
|
||||||
|
"discover_module_paths",
|
||||||
"MkDocsRenderer",
|
"MkDocsRenderer",
|
||||||
"model",
|
"MCPRenderer",
|
||||||
|
"models",
|
||||||
"main",
|
"main",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,3 +1,16 @@
|
|||||||
|
"""
|
||||||
|
# CLI Layer
|
||||||
|
|
||||||
|
The `docforge.cli` package provides the command-line interface for interacting
|
||||||
|
with doc-forge.
|
||||||
|
|
||||||
|
## Available Commands
|
||||||
|
|
||||||
|
- **build**: Build documentation (MkDocs site or MCP resources).
|
||||||
|
- **serve**: Serve documentation (MkDocs or MCP).
|
||||||
|
- **tree**: Visualize the introspected project structure.
|
||||||
|
"""
|
||||||
|
|
||||||
from .main import main
|
from .main import main
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
|||||||
170
docforge/cli/commands.py
Normal file
170
docforge/cli/commands.py
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
import click
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import Sequence, Optional
|
||||||
|
from docforge.loaders import GriffeLoader
|
||||||
|
from docforge.cli import mkdocs_utils
|
||||||
|
from docforge.cli import mcp_utils
|
||||||
|
|
||||||
|
|
||||||
|
@click.group()
|
||||||
|
def cli() -> None:
|
||||||
|
"""
|
||||||
|
doc-forge CLI: A tool for introspecting Python projects and generating
|
||||||
|
documentation.
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@cli.command()
|
||||||
|
@click.option("--mcp", is_flag=True, help="Build MCP resources")
|
||||||
|
@click.option("--mkdocs", is_flag=True, help="Build MkDocs site")
|
||||||
|
@click.option("--module", help="Python module to document")
|
||||||
|
@click.option("--project-name", help="Project name override")
|
||||||
|
# MkDocs specific
|
||||||
|
@click.option("--site-name", help="MkDocs site name")
|
||||||
|
@click.option("--docs-dir", type=click.Path(path_type=Path), default=Path("docs"), help="Directory for MD sources")
|
||||||
|
@click.option("--nav", "nav_file", type=click.Path(path_type=Path), default=Path("docforge.nav.yml"),
|
||||||
|
help="Nav spec path")
|
||||||
|
@click.option("--template", type=click.Path(path_type=Path), help="MkDocs template path")
|
||||||
|
@click.option("--mkdocs-yml", type=click.Path(path_type=Path), default=Path("mkdocs.yml"), help="Output config path")
|
||||||
|
# MCP specific
|
||||||
|
@click.option("--out-dir", type=click.Path(path_type=Path), default=Path("mcp_docs"), help="MCP output directory")
|
||||||
|
def build(
|
||||||
|
mcp: bool,
|
||||||
|
mkdocs: bool,
|
||||||
|
module: Optional[str],
|
||||||
|
project_name: Optional[str],
|
||||||
|
site_name: Optional[str],
|
||||||
|
docs_dir: Path,
|
||||||
|
nav_file: Path,
|
||||||
|
template: Optional[Path],
|
||||||
|
mkdocs_yml: Path,
|
||||||
|
out_dir: Path,
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Build documentation (MkDocs site or MCP resources).
|
||||||
|
|
||||||
|
This command orchestrates the full build process:
|
||||||
|
1. Introspects the code (Griffe)
|
||||||
|
2. Renders sources (MkDocs Markdown or MCP JSON)
|
||||||
|
3. (MkDocs only) Generates config and runs the final site build.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
mcp: Use the MCP documentation builder.
|
||||||
|
mkdocs: Use the MkDocs documentation builder.
|
||||||
|
module: The dotted path of the module to document.
|
||||||
|
project_name: Optional override for the project name.
|
||||||
|
site_name: (MkDocs) The site display name. Defaults to module name.
|
||||||
|
docs_dir: (MkDocs) Target directory for Markdown sources.
|
||||||
|
nav_file: (MkDocs) Path to the docforge.nav.yml specification.
|
||||||
|
template: (MkDocs) Optional custom mkdocs.yml template.
|
||||||
|
mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.
|
||||||
|
out_dir: (MCP) Target directory for MCP JSON resources.
|
||||||
|
"""
|
||||||
|
if not mcp and not mkdocs:
|
||||||
|
raise click.UsageError("Must specify either --mcp or --mkdocs")
|
||||||
|
|
||||||
|
if mkdocs:
|
||||||
|
if not module:
|
||||||
|
raise click.UsageError("--module is required for MkDocs build")
|
||||||
|
if not site_name:
|
||||||
|
site_name = module
|
||||||
|
|
||||||
|
click.echo(f"Generating MkDocs sources in {docs_dir}...")
|
||||||
|
mkdocs_utils.generate_sources(module, project_name, docs_dir)
|
||||||
|
|
||||||
|
click.echo(f"Generating MkDocs config {mkdocs_yml}...")
|
||||||
|
mkdocs_utils.generate_config(docs_dir, nav_file, template, mkdocs_yml, site_name)
|
||||||
|
|
||||||
|
click.echo("Running MkDocs build...")
|
||||||
|
mkdocs_utils.build(mkdocs_yml)
|
||||||
|
click.echo("MkDocs build completed.")
|
||||||
|
|
||||||
|
if mcp:
|
||||||
|
if not module:
|
||||||
|
raise click.UsageError("--module is required for MCP build")
|
||||||
|
|
||||||
|
click.echo(f"Generating MCP resources in {out_dir}...")
|
||||||
|
mcp_utils.generate_resources(module, project_name, out_dir)
|
||||||
|
click.echo("MCP build completed.")
|
||||||
|
|
||||||
|
|
||||||
|
@cli.command()
|
||||||
|
@click.option("--mcp", is_flag=True, help="Serve MCP documentation")
|
||||||
|
@click.option("--mkdocs", is_flag=True, help="Serve MkDocs site")
|
||||||
|
@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("--out-dir", type=click.Path(path_type=Path), default=Path("mcp_docs"), help="MCP root directory")
|
||||||
|
def serve(
|
||||||
|
mcp: bool,
|
||||||
|
mkdocs: bool,
|
||||||
|
module: Optional[str],
|
||||||
|
mkdocs_yml: Path,
|
||||||
|
out_dir: Path,
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Serve documentation (MkDocs or MCP).
|
||||||
|
|
||||||
|
Args:
|
||||||
|
mcp: Serve MCP resources via an MCP server.
|
||||||
|
mkdocs: Serve the MkDocs site using the built-in development server.
|
||||||
|
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:
|
||||||
|
raise click.UsageError("Cannot specify both --mcp and --mkdocs")
|
||||||
|
if not mcp and not mkdocs:
|
||||||
|
raise click.UsageError("Must specify either --mcp or --mkdocs")
|
||||||
|
if mcp and not module:
|
||||||
|
raise click.UsageError("--module is required for MCP serve")
|
||||||
|
|
||||||
|
if mkdocs:
|
||||||
|
mkdocs_utils.serve(mkdocs_yml)
|
||||||
|
elif mcp:
|
||||||
|
mcp_utils.serve(module, out_dir)
|
||||||
|
|
||||||
|
|
||||||
|
@cli.command()
|
||||||
|
@click.option(
|
||||||
|
"--module",
|
||||||
|
required=True,
|
||||||
|
help="Python module import path to introspect",
|
||||||
|
)
|
||||||
|
@click.option(
|
||||||
|
"--project-name",
|
||||||
|
help="Project name (defaults to specified module)",
|
||||||
|
)
|
||||||
|
def tree(
|
||||||
|
module: str,
|
||||||
|
project_name: Optional[str],
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Visualize the project structure in the terminal.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
module: The module import path to recursively introspect.
|
||||||
|
project_name: Optional override for the project name shown at the root.
|
||||||
|
"""
|
||||||
|
loader = GriffeLoader()
|
||||||
|
project = loader.load_project([module], project_name)
|
||||||
|
|
||||||
|
click.echo(project.name)
|
||||||
|
|
||||||
|
for module in project.get_all_modules():
|
||||||
|
click.echo(f"├── {module.path}")
|
||||||
|
for obj in module.get_all_objects():
|
||||||
|
_print_object(obj, indent="│ ")
|
||||||
|
|
||||||
|
|
||||||
|
def _print_object(obj, indent: str) -> None:
|
||||||
|
"""
|
||||||
|
Recursive helper to print doc objects and their members to the console.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
obj: The DocObject instance to print.
|
||||||
|
indent: Current line indentation (e.g., '│ ').
|
||||||
|
"""
|
||||||
|
click.echo(f"{indent}├── {obj.name}")
|
||||||
|
for member in obj.get_all_members():
|
||||||
|
_print_object(member, indent + "│ ")
|
||||||
33
docforge/cli/commands.pyi
Normal file
33
docforge/cli/commands.pyi
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
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: ...
|
||||||
@@ -1,152 +1,14 @@
|
|||||||
from __future__ import annotations
|
"""
|
||||||
|
Main entry point for the doc-forge CLI. This module delegates all command
|
||||||
from pathlib import Path
|
execution to docforge.cli.commands.
|
||||||
from typing import Sequence, Optional
|
"""
|
||||||
|
from docforge.cli.commands import cli
|
||||||
import click
|
|
||||||
|
|
||||||
from docforge.loader import GriffeLoader, discover_module_paths
|
|
||||||
from docforge.renderers.mkdocs import MkDocsRenderer
|
|
||||||
from docforge.cli.mkdocs import mkdocs_cmd
|
|
||||||
|
|
||||||
|
|
||||||
@click.group()
|
|
||||||
def cli() -> None:
|
|
||||||
"""doc-forge command-line interface."""
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
cli.add_command(mkdocs_cmd)
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# tree
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
|
|
||||||
@cli.command()
|
|
||||||
@click.option(
|
|
||||||
"--modules",
|
|
||||||
multiple=True,
|
|
||||||
required=True,
|
|
||||||
help="Python module import paths to introspect",
|
|
||||||
)
|
|
||||||
@click.option(
|
|
||||||
"--project-name",
|
|
||||||
help="Project name (defaults to first module)",
|
|
||||||
)
|
|
||||||
def tree(
|
|
||||||
modules: Sequence[str],
|
|
||||||
project_name: Optional[str],
|
|
||||||
) -> None:
|
|
||||||
"""Show introspection tree."""
|
|
||||||
loader = GriffeLoader()
|
|
||||||
project = loader.load_project(list(modules), project_name)
|
|
||||||
|
|
||||||
click.echo(project.name)
|
|
||||||
|
|
||||||
for module in project.get_all_modules():
|
|
||||||
click.echo(f"├── {module.path}")
|
|
||||||
|
|
||||||
for obj in module.get_all_objects():
|
|
||||||
_print_object(obj, indent="│ ")
|
|
||||||
|
|
||||||
|
|
||||||
def _print_object(obj, indent: str) -> None:
|
|
||||||
click.echo(f"{indent}├── {obj.name}")
|
|
||||||
for member in obj.get_all_members():
|
|
||||||
_print_object(member, indent + "│ ")
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# generate
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
|
|
||||||
@cli.command()
|
|
||||||
@click.option(
|
|
||||||
"--modules",
|
|
||||||
multiple=True,
|
|
||||||
required=True,
|
|
||||||
help="Python module import paths to document",
|
|
||||||
)
|
|
||||||
@click.option(
|
|
||||||
"--project-name",
|
|
||||||
help="Project name (defaults to first module)",
|
|
||||||
)
|
|
||||||
@click.option(
|
|
||||||
"--docs-dir",
|
|
||||||
type=click.Path(path_type=Path),
|
|
||||||
default=Path("docs"),
|
|
||||||
)
|
|
||||||
def generate(
|
|
||||||
modules: Sequence[str],
|
|
||||||
project_name: Optional[str],
|
|
||||||
docs_dir: Path,
|
|
||||||
) -> None:
|
|
||||||
"""Generate documentation source files using MkDocs renderer."""
|
|
||||||
loader = GriffeLoader()
|
|
||||||
discovered_paths = discover_module_paths(
|
|
||||||
"docforge",
|
|
||||||
Path(r"C:\Users\vishe\WorkSpace\code\aetos\doc-forge")
|
|
||||||
)
|
|
||||||
project = loader.load_project(
|
|
||||||
discovered_paths,
|
|
||||||
project_name
|
|
||||||
)
|
|
||||||
|
|
||||||
renderer = MkDocsRenderer()
|
|
||||||
renderer.generate_sources(project, docs_dir)
|
|
||||||
|
|
||||||
click.echo(f"Documentation sources generated in {docs_dir}")
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# build
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
|
|
||||||
@cli.command()
|
|
||||||
@click.option(
|
|
||||||
"--mkdocs-yml",
|
|
||||||
type=click.Path(path_type=Path),
|
|
||||||
default=Path("mkdocs.yml"),
|
|
||||||
)
|
|
||||||
def build(mkdocs_yml: Path) -> None:
|
|
||||||
"""Build documentation using MkDocs."""
|
|
||||||
if not mkdocs_yml.exists():
|
|
||||||
raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}")
|
|
||||||
|
|
||||||
from mkdocs.config import load_config
|
|
||||||
from mkdocs.commands.build import build as mkdocs_build
|
|
||||||
|
|
||||||
mkdocs_build(load_config(str(mkdocs_yml)))
|
|
||||||
|
|
||||||
click.echo("MkDocs build completed")
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# serve
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
|
|
||||||
@cli.command()
|
|
||||||
@click.option(
|
|
||||||
"--mkdocs-yml",
|
|
||||||
type=click.Path(path_type=Path),
|
|
||||||
default=Path("mkdocs.yml"),
|
|
||||||
)
|
|
||||||
def serve(mkdocs_yml: Path) -> None:
|
|
||||||
"""Serve documentation using MkDocs."""
|
|
||||||
if not mkdocs_yml.exists():
|
|
||||||
raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}")
|
|
||||||
|
|
||||||
from mkdocs.commands.serve import serve as mkdocs_serve
|
|
||||||
mkdocs_serve(config_file=str(mkdocs_yml))
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# entry point
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
|
"""
|
||||||
|
CLI Entry point. Boots the click application.
|
||||||
|
"""
|
||||||
cli()
|
cli()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -1,77 +1 @@
|
|||||||
from typing import Sequence
|
def main() -> None: ...
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import click
|
|
||||||
|
|
||||||
|
|
||||||
@click.group()
|
|
||||||
def cli() -> None:
|
|
||||||
"""doc-forge command-line interface."""
|
|
||||||
|
|
||||||
|
|
||||||
@cli.command()
|
|
||||||
@click.option(
|
|
||||||
"--modules",
|
|
||||||
multiple=True,
|
|
||||||
help="Python module import paths to introspect",
|
|
||||||
)
|
|
||||||
@click.option(
|
|
||||||
"--project-name",
|
|
||||||
help="Project name (defaults to first module)",
|
|
||||||
)
|
|
||||||
def tree(
|
|
||||||
modules: Sequence[str],
|
|
||||||
project_name: str | None,
|
|
||||||
) -> None:
|
|
||||||
"""Show introspection tree."""
|
|
||||||
|
|
||||||
|
|
||||||
@cli.command()
|
|
||||||
@click.option(
|
|
||||||
"--modules",
|
|
||||||
multiple=True,
|
|
||||||
help="Python module import paths to document",
|
|
||||||
)
|
|
||||||
@click.option(
|
|
||||||
"--project-name",
|
|
||||||
help="Project name (defaults to first module)",
|
|
||||||
)
|
|
||||||
@click.option(
|
|
||||||
"--docs-dir",
|
|
||||||
type=click.Path(path_type=Path),
|
|
||||||
default=Path("docs"),
|
|
||||||
)
|
|
||||||
def generate(
|
|
||||||
modules: Sequence[str],
|
|
||||||
project_name: str | None,
|
|
||||||
docs_dir: Path,
|
|
||||||
) -> None:
|
|
||||||
"""Generate documentation source files using MkDocs renderer."""
|
|
||||||
|
|
||||||
|
|
||||||
@cli.command()
|
|
||||||
@click.option(
|
|
||||||
"--mkdocs-yml",
|
|
||||||
type=click.Path(path_type=Path),
|
|
||||||
default=Path("mkdocs.yml"),
|
|
||||||
)
|
|
||||||
def build(
|
|
||||||
mkdocs_yml: Path,
|
|
||||||
) -> None:
|
|
||||||
"""Build documentation using MkDocs."""
|
|
||||||
|
|
||||||
|
|
||||||
@cli.command()
|
|
||||||
@click.option(
|
|
||||||
"--mkdocs-yml",
|
|
||||||
type=click.Path(path_type=Path),
|
|
||||||
default=Path("mkdocs.yml"),
|
|
||||||
)
|
|
||||||
def serve(
|
|
||||||
mkdocs_yml: Path,
|
|
||||||
) -> None:
|
|
||||||
"""Serve documentation using MkDocs."""
|
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
|
||||||
"""CLI entry point."""
|
|
||||||
|
|||||||
48
docforge/cli/mcp_utils.py
Normal file
48
docforge/cli/mcp_utils.py
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
import click
|
||||||
|
from docforge.loaders import GriffeLoader, discover_module_paths
|
||||||
|
from docforge.renderers import MCPRenderer
|
||||||
|
from docforge.servers import MCPServer
|
||||||
|
|
||||||
|
def generate_resources(module: str, project_name: str | None, out_dir: Path) -> None:
|
||||||
|
"""
|
||||||
|
Generate MCP-compatible documentation resources.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
module: The dotted path of the primary module to document.
|
||||||
|
project_name: Optional override for the project name.
|
||||||
|
out_dir: Directory where the MCP JSON resources and nav will be written.
|
||||||
|
"""
|
||||||
|
loader = GriffeLoader()
|
||||||
|
discovered_paths = discover_module_paths(module)
|
||||||
|
project = loader.load_project(discovered_paths, project_name)
|
||||||
|
|
||||||
|
renderer = MCPRenderer()
|
||||||
|
renderer.generate_sources(project, out_dir)
|
||||||
|
|
||||||
|
def serve(module: str, mcp_root: Path) -> None:
|
||||||
|
"""
|
||||||
|
Serve MCP documentation from a pre-built bundle.
|
||||||
|
|
||||||
|
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():
|
||||||
|
raise click.ClickException(f"mcp_docs directory not found: {mcp_root}")
|
||||||
|
|
||||||
|
required = [
|
||||||
|
mcp_root / "index.json",
|
||||||
|
mcp_root / "nav.json",
|
||||||
|
mcp_root / "modules",
|
||||||
|
]
|
||||||
|
|
||||||
|
for path in required:
|
||||||
|
if not path.exists():
|
||||||
|
raise click.ClickException(f"Invalid MCP bundle, missing: {path.name}")
|
||||||
|
|
||||||
|
server = MCPServer(
|
||||||
|
mcp_root=mcp_root,
|
||||||
|
name=f"{module}-mcp",
|
||||||
|
)
|
||||||
|
server.run()
|
||||||
4
docforge/cli/mcp_utils.pyi
Normal file
4
docforge/cli/mcp_utils.pyi
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
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: ...
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from importlib import resources
|
|
||||||
|
|
||||||
import click
|
|
||||||
import yaml
|
|
||||||
|
|
||||||
from docforge.nav import load_nav_spec
|
|
||||||
from docforge.nav import resolve_nav
|
|
||||||
from docforge.nav import MkDocsNavEmitter
|
|
||||||
|
|
||||||
|
|
||||||
def _load_template(template: Path | None) -> dict:
|
|
||||||
if template is not None:
|
|
||||||
if not template.exists():
|
|
||||||
raise click.FileError(str(template), hint="Template not found")
|
|
||||||
return yaml.safe_load(template.read_text(encoding="utf-8"))
|
|
||||||
|
|
||||||
# Load built-in default
|
|
||||||
text = (
|
|
||||||
resources.files("docforge.templates")
|
|
||||||
.joinpath("mkdocs.sample.yml")
|
|
||||||
.read_text(encoding="utf-8")
|
|
||||||
)
|
|
||||||
return yaml.safe_load(text)
|
|
||||||
|
|
||||||
|
|
||||||
@click.command("mkdocs")
|
|
||||||
@click.option(
|
|
||||||
"--docs-dir",
|
|
||||||
type=click.Path(path_type=Path),
|
|
||||||
default=Path("docs"),
|
|
||||||
)
|
|
||||||
@click.option(
|
|
||||||
"--nav",
|
|
||||||
"nav_file",
|
|
||||||
type=click.Path(path_type=Path),
|
|
||||||
default=Path("docforge.nav.yml"),
|
|
||||||
)
|
|
||||||
@click.option(
|
|
||||||
"--template",
|
|
||||||
type=click.Path(path_type=Path),
|
|
||||||
default=None,
|
|
||||||
help="Override the built-in mkdocs template",
|
|
||||||
)
|
|
||||||
@click.option(
|
|
||||||
"--out",
|
|
||||||
type=click.Path(path_type=Path),
|
|
||||||
default=Path("mkdocs.yml"),
|
|
||||||
)
|
|
||||||
def mkdocs_cmd(
|
|
||||||
docs_dir: Path,
|
|
||||||
nav_file: Path,
|
|
||||||
template: Path | None,
|
|
||||||
out: Path,
|
|
||||||
) -> None:
|
|
||||||
"""Generate mkdocs.yml from nav spec and template."""
|
|
||||||
|
|
||||||
if not nav_file.exists():
|
|
||||||
raise click.FileError(str(nav_file), hint="Nav spec not found")
|
|
||||||
|
|
||||||
# Load nav spec
|
|
||||||
spec = load_nav_spec(nav_file)
|
|
||||||
|
|
||||||
# Resolve nav
|
|
||||||
resolved = resolve_nav(spec, docs_dir)
|
|
||||||
|
|
||||||
# Emit mkdocs nav
|
|
||||||
nav_block = MkDocsNavEmitter().emit(resolved)
|
|
||||||
|
|
||||||
# Load template (user or built-in)
|
|
||||||
data = _load_template(template)
|
|
||||||
|
|
||||||
# Inject nav
|
|
||||||
data["nav"] = nav_block
|
|
||||||
|
|
||||||
# Write output
|
|
||||||
out.write_text(
|
|
||||||
yaml.safe_dump(data, sort_keys=False),
|
|
||||||
encoding="utf-8",
|
|
||||||
)
|
|
||||||
|
|
||||||
click.echo(f"mkdocs.yml written to {out}")
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import Any, Dict, Optional
|
|
||||||
|
|
||||||
import click
|
|
||||||
|
|
||||||
|
|
||||||
def _load_template(template: Optional[Path]) -> Dict[str, Any]:
|
|
||||||
...
|
|
||||||
|
|
||||||
|
|
||||||
@click.command("mkdocs")
|
|
||||||
@click.option(
|
|
||||||
"--docs-dir",
|
|
||||||
type=click.Path(path_type=Path),
|
|
||||||
default=Path("docs"),
|
|
||||||
)
|
|
||||||
@click.option(
|
|
||||||
"--nav",
|
|
||||||
"nav_file",
|
|
||||||
type=click.Path(path_type=Path),
|
|
||||||
default=Path("docforge.nav.yml"),
|
|
||||||
)
|
|
||||||
@click.option(
|
|
||||||
"--template",
|
|
||||||
type=click.Path(path_type=Path),
|
|
||||||
default=None,
|
|
||||||
)
|
|
||||||
@click.option(
|
|
||||||
"--out",
|
|
||||||
type=click.Path(path_type=Path),
|
|
||||||
default=Path("mkdocs.yml"),
|
|
||||||
)
|
|
||||||
def mkdocs_cmd(
|
|
||||||
docs_dir: Path,
|
|
||||||
nav_file: Path,
|
|
||||||
template: Optional[Path],
|
|
||||||
out: Path,
|
|
||||||
) -> None:
|
|
||||||
...
|
|
||||||
87
docforge/cli/mkdocs_utils.py
Normal file
87
docforge/cli/mkdocs_utils.py
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
from importlib import resources
|
||||||
|
import click
|
||||||
|
import yaml
|
||||||
|
from docforge.loaders import GriffeLoader, discover_module_paths
|
||||||
|
from docforge.renderers import MkDocsRenderer
|
||||||
|
from docforge.nav import load_nav_spec, resolve_nav, MkDocsNavEmitter
|
||||||
|
|
||||||
|
def generate_sources(module: str, project_name: str | None, docs_dir: Path) -> None:
|
||||||
|
"""
|
||||||
|
Generate Markdown source files for the specified module.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
module: The dotted path of the primary module to document.
|
||||||
|
project_name: Optional override for the project name.
|
||||||
|
docs_dir: Directory where the generated Markdown files will be written.
|
||||||
|
"""
|
||||||
|
loader = GriffeLoader()
|
||||||
|
discovered_paths = discover_module_paths(module)
|
||||||
|
project = loader.load_project(discovered_paths, project_name)
|
||||||
|
|
||||||
|
renderer = MkDocsRenderer()
|
||||||
|
renderer.generate_sources(project, docs_dir)
|
||||||
|
|
||||||
|
def generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None:
|
||||||
|
"""
|
||||||
|
Generate an mkdocs.yml configuration file.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
docs_dir: Path to the directory containing documentation Markdown files.
|
||||||
|
nav_file: Path to the docforge.nav.yml specification.
|
||||||
|
template: Optional path to an mkdocs.yml template (overrides built-in).
|
||||||
|
out: Path where the final mkdocs.yml will be written.
|
||||||
|
site_name: The display name for the documentation site.
|
||||||
|
"""
|
||||||
|
if not nav_file.exists():
|
||||||
|
raise click.FileError(str(nav_file), hint="Nav spec not found")
|
||||||
|
|
||||||
|
spec = load_nav_spec(nav_file)
|
||||||
|
resolved = resolve_nav(spec, docs_dir)
|
||||||
|
nav_block = MkDocsNavEmitter().emit(resolved)
|
||||||
|
|
||||||
|
# Load template
|
||||||
|
if template is not None:
|
||||||
|
if not template.exists():
|
||||||
|
raise click.FileError(str(template), hint="Template not found")
|
||||||
|
data = yaml.safe_load(template.read_text(encoding="utf-8"))
|
||||||
|
else:
|
||||||
|
text = (
|
||||||
|
resources.files("docforge.templates")
|
||||||
|
.joinpath("mkdocs.sample.yml")
|
||||||
|
.read_text(encoding="utf-8")
|
||||||
|
)
|
||||||
|
data = yaml.safe_load(text)
|
||||||
|
|
||||||
|
data["site_name"] = site_name
|
||||||
|
data["nav"] = nav_block
|
||||||
|
|
||||||
|
out.write_text(yaml.safe_dump(data, sort_keys=False), encoding="utf-8")
|
||||||
|
|
||||||
|
def build(mkdocs_yml: Path) -> None:
|
||||||
|
"""
|
||||||
|
Build the documentation site using MkDocs.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
mkdocs_yml: Path to the mkdocs.yml configuration file.
|
||||||
|
"""
|
||||||
|
if not mkdocs_yml.exists():
|
||||||
|
raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}")
|
||||||
|
|
||||||
|
from mkdocs.config import load_config
|
||||||
|
from mkdocs.commands.build import build as mkdocs_build
|
||||||
|
|
||||||
|
mkdocs_build(load_config(str(mkdocs_yml)))
|
||||||
|
|
||||||
|
def serve(mkdocs_yml: Path) -> None:
|
||||||
|
"""
|
||||||
|
Serve the documentation site with live-reload using MkDocs.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
mkdocs_yml: Path to the mkdocs.yml configuration file.
|
||||||
|
"""
|
||||||
|
if not mkdocs_yml.exists():
|
||||||
|
raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}")
|
||||||
|
|
||||||
|
from mkdocs.commands.serve import serve as mkdocs_serve
|
||||||
|
mkdocs_serve(config_file=str(mkdocs_yml))
|
||||||
6
docforge/cli/mkdocs_utils.pyi
Normal file
6
docforge/cli/mkdocs_utils.pyi
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
def generate_sources(module: str, project_name: str | None, docs_dir: Path) -> None: ...
|
||||||
|
def generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None: ...
|
||||||
|
def build(mkdocs_yml: Path) -> None: ...
|
||||||
|
def serve(mkdocs_yml: Path) -> None: ...
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
from .griffe_loader import GriffeLoader, discover_module_paths
|
|
||||||
|
|
||||||
__all__ = [
|
|
||||||
"GriffeLoader",
|
|
||||||
"discover_module_paths",
|
|
||||||
]
|
|
||||||
22
docforge/loaders/__init__.py
Normal file
22
docforge/loaders/__init__.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
"""
|
||||||
|
# Loader Layer
|
||||||
|
|
||||||
|
The `docforge.loaders` package is responsible for discovering Python source files
|
||||||
|
and extracting their documentation using static analysis.
|
||||||
|
|
||||||
|
## Core Features
|
||||||
|
|
||||||
|
- **Discovery**: Automatically find all modules and packages in a project
|
||||||
|
directory.
|
||||||
|
- **Introspection**: Uses `griffe` to parse docstrings, signatures, and
|
||||||
|
hierarchical relationships without executing the code.
|
||||||
|
- **Filtering**: Automatically excludes private members (prefixed with `_`) to
|
||||||
|
ensure clean public documentation.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from .griffe_loader import GriffeLoader, discover_module_paths
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"GriffeLoader",
|
||||||
|
"discover_module_paths",
|
||||||
|
]
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
from __future__ import annotations
|
"""
|
||||||
|
This module provides the GriffeLoader, which uses the 'griffe' library to
|
||||||
|
introspect Python source code and populate the doc-forge Project models.
|
||||||
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -12,7 +15,7 @@ from griffe import (
|
|||||||
AliasResolutionError,
|
AliasResolutionError,
|
||||||
)
|
)
|
||||||
|
|
||||||
from docforge.model import Module, Project, DocObject
|
from docforge.models import Module, Project, DocObject
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -25,9 +28,16 @@ def discover_module_paths(
|
|||||||
Discover all Python modules under a package via filesystem traversal.
|
Discover all Python modules under a package via filesystem traversal.
|
||||||
|
|
||||||
Rules:
|
Rules:
|
||||||
- Directory with __init__.py => package
|
- Directory with __init__.py is treated as a package.
|
||||||
- .py file => module
|
- Any .py file is treated as a module.
|
||||||
- Paths converted to dotted module paths
|
- All paths are converted to dotted module paths.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
module_name: The name of the package to discover.
|
||||||
|
project_root: The root directory of the project. Defaults to current working directory.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A sorted list of dotted module paths.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if project_root is None:
|
if project_root is None:
|
||||||
@@ -53,9 +63,14 @@ def discover_module_paths(
|
|||||||
|
|
||||||
|
|
||||||
class GriffeLoader:
|
class GriffeLoader:
|
||||||
"""Loads Python modules using Griffe introspection."""
|
"""
|
||||||
|
Loads Python modules and extracts documentation using the Griffe introspection engine.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
|
"""
|
||||||
|
Initialize the GriffeLoader.
|
||||||
|
"""
|
||||||
self._loader = _GriffeLoader(
|
self._loader = _GriffeLoader(
|
||||||
modules_collection=ModulesCollection(),
|
modules_collection=ModulesCollection(),
|
||||||
lines_collection=LinesCollection(),
|
lines_collection=LinesCollection(),
|
||||||
@@ -65,7 +80,19 @@ class GriffeLoader:
|
|||||||
self,
|
self,
|
||||||
module_paths: List[str],
|
module_paths: List[str],
|
||||||
project_name: Optional[str] = None,
|
project_name: Optional[str] = None,
|
||||||
|
skip_import_errors: bool = None,
|
||||||
) -> Project:
|
) -> Project:
|
||||||
|
"""
|
||||||
|
Load multiple modules and combine them into a single Project models.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
module_paths: A list of dotted paths to the modules to load.
|
||||||
|
project_name: Optional name for the project. Defaults to the first module name.
|
||||||
|
skip_import_errors: If True, modules that fail to import will be skipped.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A Project instance containing the loaded modules.
|
||||||
|
"""
|
||||||
if not module_paths:
|
if not module_paths:
|
||||||
raise ValueError("At least one module path must be provided")
|
raise ValueError("At least one module path must be provided")
|
||||||
|
|
||||||
@@ -77,19 +104,28 @@ class GriffeLoader:
|
|||||||
for module_path in module_paths:
|
for module_path in module_paths:
|
||||||
try:
|
try:
|
||||||
module = self.load_module(module_path)
|
module = self.load_module(module_path)
|
||||||
project.add_module(module)
|
except ImportError as import_error:
|
||||||
except Exception as e:
|
if skip_import_errors:
|
||||||
logger.error("Failed to load module %s: %s", module_path, e)
|
logger.debug("Could not load %s: %s", module_path, import_error)
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
|
raise import_error
|
||||||
|
project.add_module(module)
|
||||||
|
|
||||||
return project
|
return project
|
||||||
|
|
||||||
def load_module(self, path: str) -> Module:
|
def load_module(self, path: str) -> Module:
|
||||||
try:
|
"""
|
||||||
|
Load a single module and convert its introspection data into the docforge models.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
path: The dotted path of the module to load.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A Module instance.
|
||||||
|
"""
|
||||||
self._loader.load(path)
|
self._loader.load(path)
|
||||||
griffe_module = self._loader.modules_collection[path]
|
griffe_module = self._loader.modules_collection[path]
|
||||||
except Exception as e:
|
|
||||||
raise ImportError(f"Failed to load module '{path}': {e}") from e
|
|
||||||
|
|
||||||
return self._convert_module(griffe_module)
|
return self._convert_module(griffe_module)
|
||||||
|
|
||||||
@@ -98,6 +134,15 @@ class GriffeLoader:
|
|||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
||||||
def _convert_module(self, obj: Object) -> Module:
|
def _convert_module(self, obj: Object) -> Module:
|
||||||
|
"""
|
||||||
|
Convert a Griffe Object (module) into a docforge Module.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
obj: The Griffe Object representing the module.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A populated Module instance.
|
||||||
|
"""
|
||||||
module = Module(
|
module = Module(
|
||||||
path=obj.path,
|
path=obj.path,
|
||||||
docstring=self._safe_docstring(obj),
|
docstring=self._safe_docstring(obj),
|
||||||
@@ -106,14 +151,21 @@ class GriffeLoader:
|
|||||||
for name, member in obj.members.items():
|
for name, member in obj.members.items():
|
||||||
if name.startswith("_"):
|
if name.startswith("_"):
|
||||||
continue
|
continue
|
||||||
try:
|
|
||||||
module.add_object(self._convert_object(member))
|
module.add_object(self._convert_object(member))
|
||||||
except Exception as e:
|
|
||||||
logger.warning("Skipping member %s: %s", name, e)
|
|
||||||
|
|
||||||
return module
|
return module
|
||||||
|
|
||||||
def _convert_object(self, obj: Object) -> DocObject:
|
def _convert_object(self, obj: Object) -> DocObject:
|
||||||
|
"""
|
||||||
|
Recursively convert a Griffe Object into a DocObject hierarchy.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
obj: The Griffe Object to convert.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A DocObject instance.
|
||||||
|
"""
|
||||||
kind = obj.kind.value
|
kind = obj.kind.value
|
||||||
signature = self._safe_signature(obj)
|
signature = self._safe_signature(obj)
|
||||||
|
|
||||||
@@ -125,14 +177,13 @@ class GriffeLoader:
|
|||||||
docstring=self._safe_docstring(obj),
|
docstring=self._safe_docstring(obj),
|
||||||
)
|
)
|
||||||
|
|
||||||
if hasattr(obj, "members"):
|
try:
|
||||||
for name, member in obj.members.items():
|
for name, member in obj.members.items():
|
||||||
if name.startswith("_"):
|
if name.startswith("_"):
|
||||||
continue
|
continue
|
||||||
try:
|
|
||||||
doc_obj.add_member(self._convert_object(member))
|
doc_obj.add_member(self._convert_object(member))
|
||||||
except Exception:
|
except AliasResolutionError:
|
||||||
continue
|
pass
|
||||||
|
|
||||||
return doc_obj
|
return doc_obj
|
||||||
|
|
||||||
@@ -141,12 +192,30 @@ class GriffeLoader:
|
|||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
||||||
def _safe_docstring(self, obj: Object) -> Optional[str]:
|
def _safe_docstring(self, obj: Object) -> Optional[str]:
|
||||||
|
"""
|
||||||
|
Safely retrieve the docstring value from a Griffe object.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
obj: The Griffe Object to inspect.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The raw docstring string, or None if missing or unresolvable.
|
||||||
|
"""
|
||||||
try:
|
try:
|
||||||
return obj.docstring.value if obj.docstring else None
|
return obj.docstring.value if obj.docstring else None
|
||||||
except AliasResolutionError:
|
except AliasResolutionError:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _safe_signature(self, obj: Object) -> Optional[str]:
|
def _safe_signature(self, obj: Object) -> Optional[str]:
|
||||||
|
"""
|
||||||
|
Safely retrieve the signature string from a Griffe object.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
obj: The Griffe Object to inspect.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The string representation of the signature, or None.
|
||||||
|
"""
|
||||||
try:
|
try:
|
||||||
if hasattr(obj, "signature") and obj.signature:
|
if hasattr(obj, "signature") and obj.signature:
|
||||||
return str(obj.signature)
|
return str(obj.signature)
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from docforge.model import Module, Project
|
from docforge.models import Module, Project
|
||||||
|
|
||||||
|
|
||||||
def discover_module_paths(
|
def discover_module_paths(
|
||||||
@@ -12,7 +12,7 @@ def discover_module_paths(
|
|||||||
|
|
||||||
|
|
||||||
class GriffeLoader:
|
class GriffeLoader:
|
||||||
"""Griffe-based introspection loader.
|
"""Griffe-based introspection loaders.
|
||||||
|
|
||||||
This is the only supported introspection backend in doc-forge.
|
This is the only supported introspection backend in doc-forge.
|
||||||
"""
|
"""
|
||||||
@@ -23,6 +23,7 @@ class GriffeLoader:
|
|||||||
self,
|
self,
|
||||||
module_paths: List[str],
|
module_paths: List[str],
|
||||||
project_name: Optional[str] = ...,
|
project_name: Optional[str] = ...,
|
||||||
|
skip_import_errors: bool = ...,
|
||||||
) -> Project:
|
) -> Project:
|
||||||
"""Load a documentation project from Python modules."""
|
"""Load a documentation project from Python modules."""
|
||||||
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
"""
|
|
||||||
Core documentation model for doc-forge.
|
|
||||||
|
|
||||||
These classes form the renderer-agnostic, introspection-derived
|
|
||||||
representation of Python documentation.
|
|
||||||
"""
|
|
||||||
|
|
||||||
from .project import Project
|
|
||||||
from .module import Module
|
|
||||||
from .object import DocObject
|
|
||||||
|
|
||||||
__all__ = [
|
|
||||||
"Project",
|
|
||||||
"Module",
|
|
||||||
"DocObject",
|
|
||||||
]
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from typing import Dict, Iterable, Optional
|
|
||||||
|
|
||||||
from docforge.model.object import DocObject
|
|
||||||
|
|
||||||
|
|
||||||
class Module:
|
|
||||||
"""Represents a documented Python module."""
|
|
||||||
|
|
||||||
def __init__(
|
|
||||||
self,
|
|
||||||
path: str,
|
|
||||||
docstring: Optional[str] = None,
|
|
||||||
) -> None:
|
|
||||||
self.path = path
|
|
||||||
self.docstring = docstring
|
|
||||||
self.members: Dict[str, DocObject] = {}
|
|
||||||
|
|
||||||
def add_object(self, obj: DocObject) -> None:
|
|
||||||
self.members[obj.name] = obj
|
|
||||||
|
|
||||||
def get_object(self, name: str) -> DocObject:
|
|
||||||
return self.members[name]
|
|
||||||
|
|
||||||
def get_all_objects(self) -> Iterable[DocObject]:
|
|
||||||
return self.members.values()
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from typing import Dict, Iterable, Optional
|
|
||||||
|
|
||||||
|
|
||||||
class DocObject:
|
|
||||||
"""Represents a documented Python object."""
|
|
||||||
|
|
||||||
def __init__(
|
|
||||||
self,
|
|
||||||
name: str,
|
|
||||||
kind: str,
|
|
||||||
path: str,
|
|
||||||
signature: Optional[str] = None,
|
|
||||||
docstring: Optional[str] = None,
|
|
||||||
) -> None:
|
|
||||||
self.name = name
|
|
||||||
self.kind = kind
|
|
||||||
self.path = path
|
|
||||||
self.signature = signature
|
|
||||||
self.docstring = docstring
|
|
||||||
self.members: Dict[str, DocObject] = {}
|
|
||||||
|
|
||||||
def add_member(self, obj: DocObject) -> None:
|
|
||||||
self.members[obj.name] = obj
|
|
||||||
|
|
||||||
def get_member(self, name: str) -> DocObject:
|
|
||||||
return self.members[name]
|
|
||||||
|
|
||||||
def get_all_members(self) -> Iterable[DocObject]:
|
|
||||||
return self.members.values()
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from typing import Dict, Iterable
|
|
||||||
|
|
||||||
from docforge.model.module import Module
|
|
||||||
|
|
||||||
|
|
||||||
class Project:
|
|
||||||
"""Represents a documentation project."""
|
|
||||||
|
|
||||||
def __init__(self, name: str) -> None:
|
|
||||||
self.name = name
|
|
||||||
self.modules: Dict[str, Module] = {}
|
|
||||||
|
|
||||||
def add_module(self, module: Module) -> None:
|
|
||||||
self.modules[module.path] = module
|
|
||||||
|
|
||||||
def get_module(self, path: str) -> Module:
|
|
||||||
return self.modules[path]
|
|
||||||
|
|
||||||
def get_all_modules(self) -> Iterable[Module]:
|
|
||||||
return self.modules.values()
|
|
||||||
|
|
||||||
def get_module_list(self) -> list[str]:
|
|
||||||
return list(self.modules.keys())
|
|
||||||
25
docforge/models/__init__.py
Normal file
25
docforge/models/__init__.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
"""
|
||||||
|
# Model Layer
|
||||||
|
|
||||||
|
The `docforge.models` package provides the core data structures used to represent
|
||||||
|
Python source code in a documentation-focused hierarchy.
|
||||||
|
|
||||||
|
## Key Components
|
||||||
|
|
||||||
|
- **Project**: The root container for all documented modules.
|
||||||
|
- **Module**: Represents a Python module or package, containing members.
|
||||||
|
- **DocObject**: A recursive structure for classes, functions, and attributes.
|
||||||
|
|
||||||
|
These classes are designed to be renderer-agnostic, allowing the same internal
|
||||||
|
representation to be transformed into various output formats (currently MkDocs).
|
||||||
|
"""
|
||||||
|
|
||||||
|
from .project import Project
|
||||||
|
from .module import Module
|
||||||
|
from .object import DocObject
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"Project",
|
||||||
|
"Module",
|
||||||
|
"DocObject",
|
||||||
|
]
|
||||||
66
docforge/models/module.py
Normal file
66
docforge/models/module.py
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
"""
|
||||||
|
This module defines the Module class, which represents a Python module or package
|
||||||
|
in the doc-forge documentation models. It acts as a container for top-level
|
||||||
|
documented objects.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from typing import Dict, Iterable, Optional
|
||||||
|
|
||||||
|
from docforge.models.object import DocObject
|
||||||
|
|
||||||
|
|
||||||
|
class Module:
|
||||||
|
"""
|
||||||
|
Represents a documented Python module or package.
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
path: Dotted import path of the module.
|
||||||
|
docstring: Module-level docstring content.
|
||||||
|
members: Dictionary mapping object names to their DocObject representations.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
path: str,
|
||||||
|
docstring: Optional[str] = None,
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Initialize a new Module.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
path: The dotted path of the module.
|
||||||
|
docstring: The module's docstring, if any.
|
||||||
|
"""
|
||||||
|
self.path = path
|
||||||
|
self.docstring = docstring
|
||||||
|
self.members: Dict[str, DocObject] = {}
|
||||||
|
|
||||||
|
def add_object(self, obj: DocObject) -> None:
|
||||||
|
"""
|
||||||
|
Add a documented object to the module.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
obj: The object to add.
|
||||||
|
"""
|
||||||
|
self.members[obj.name] = obj
|
||||||
|
|
||||||
|
def get_object(self, name: str) -> DocObject:
|
||||||
|
"""
|
||||||
|
Retrieve a member object by name.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
name: The name of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The requested DocObject.
|
||||||
|
"""
|
||||||
|
return self.members[name]
|
||||||
|
|
||||||
|
def get_all_objects(self) -> Iterable[DocObject]:
|
||||||
|
"""
|
||||||
|
Get all top-level objects in the module.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An iterable of DocObject instances.
|
||||||
|
"""
|
||||||
|
return self.members.values()
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
from typing import Dict, Iterable, Optional
|
from typing import Dict, Iterable, Optional
|
||||||
|
|
||||||
from docforge.model.object import DocObject
|
from docforge.models.object import DocObject
|
||||||
|
|
||||||
|
|
||||||
class Module:
|
class Module:
|
||||||
76
docforge/models/object.py
Normal file
76
docforge/models/object.py
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
"""
|
||||||
|
This module defines the DocObject class, the fundamental recursive unit of the
|
||||||
|
doc-forge documentation models. A DocObject represents a single Python entity
|
||||||
|
(class, function, method, or attribute) and its nested members.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from typing import Dict, Iterable, Optional
|
||||||
|
|
||||||
|
|
||||||
|
class DocObject:
|
||||||
|
"""
|
||||||
|
Represents a documented Python object (class, function, method, etc.).
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
name: Local name of the object.
|
||||||
|
kind: Type of object (e.g., 'class', 'function', 'attribute').
|
||||||
|
path: Full dotted import path to the object.
|
||||||
|
signature: Callable signature, if applicable.
|
||||||
|
docstring: Raw docstring content extracted from the source.
|
||||||
|
members: Dictionary mapping member names to their DocObject representations.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
name: str,
|
||||||
|
kind: str,
|
||||||
|
path: str,
|
||||||
|
signature: Optional[str] = None,
|
||||||
|
docstring: Optional[str] = None,
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Initialize a new DocObject.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
name: The local name of the object.
|
||||||
|
kind: The kind of object (e.g., 'class', 'function').
|
||||||
|
path: The full dotted path to the object.
|
||||||
|
signature: The object's signature (for callable objects).
|
||||||
|
docstring: The object's docstring, if any.
|
||||||
|
"""
|
||||||
|
self.name = name
|
||||||
|
self.kind = kind
|
||||||
|
self.path = path
|
||||||
|
self.signature = signature
|
||||||
|
self.docstring = docstring
|
||||||
|
self.members: Dict[str, 'DocObject'] = {}
|
||||||
|
|
||||||
|
def add_member(self, obj: 'DocObject') -> None:
|
||||||
|
"""
|
||||||
|
Add a child member to this object (e.g., a method to a class).
|
||||||
|
|
||||||
|
Args:
|
||||||
|
obj: The child DocObject to add.
|
||||||
|
"""
|
||||||
|
self.members[obj.name] = obj
|
||||||
|
|
||||||
|
def get_member(self, name: str) -> 'DocObject':
|
||||||
|
"""
|
||||||
|
Retrieve a child member by name.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
name: The name of the member.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The requested DocObject.
|
||||||
|
"""
|
||||||
|
return self.members[name]
|
||||||
|
|
||||||
|
def get_all_members(self) -> Iterable['DocObject']:
|
||||||
|
"""
|
||||||
|
Get all members of this object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An iterable of child DocObject instances.
|
||||||
|
"""
|
||||||
|
return self.members.values()
|
||||||
67
docforge/models/project.py
Normal file
67
docforge/models/project.py
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
"""
|
||||||
|
This module defines the Project class, the top-level container for a documented
|
||||||
|
project. It aggregates multiple Module instances into a single named entity.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from typing import Dict, Iterable
|
||||||
|
|
||||||
|
from docforge.models.module import Module
|
||||||
|
|
||||||
|
|
||||||
|
class Project:
|
||||||
|
"""
|
||||||
|
Represents a documentation project, serving as a container for modules.
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
name: Name of the project.
|
||||||
|
modules: Dictionary mapping module paths to Module instances.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, name: str) -> None:
|
||||||
|
"""
|
||||||
|
Initialize a new Project.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
name: The name of the project.
|
||||||
|
"""
|
||||||
|
self.name = name
|
||||||
|
self.modules: Dict[str, Module] = {}
|
||||||
|
|
||||||
|
def add_module(self, module: Module) -> None:
|
||||||
|
"""
|
||||||
|
Add a module to the project.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
module: The module to add.
|
||||||
|
"""
|
||||||
|
self.modules[module.path] = module
|
||||||
|
|
||||||
|
def get_module(self, path: str) -> Module:
|
||||||
|
"""
|
||||||
|
Retrieve a module by its dotted path.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
path: The dotted path of the module (e.g., 'pkg.mod').
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The requested Module.
|
||||||
|
"""
|
||||||
|
return self.modules[path]
|
||||||
|
|
||||||
|
def get_all_modules(self) -> Iterable[Module]:
|
||||||
|
"""
|
||||||
|
Get all modules in the project.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An iterable of Module objects.
|
||||||
|
"""
|
||||||
|
return self.modules.values()
|
||||||
|
|
||||||
|
def get_module_list(self) -> list[str]:
|
||||||
|
"""
|
||||||
|
Get the list of all module dotted paths.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A list of module paths.
|
||||||
|
"""
|
||||||
|
return list(self.modules.keys())
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
from typing import Dict, Iterable
|
from typing import Dict, Iterable
|
||||||
|
|
||||||
from docforge.model.module import Module
|
from docforge.models.module import Module
|
||||||
|
|
||||||
|
|
||||||
class Project:
|
class Project:
|
||||||
@@ -1,3 +1,19 @@
|
|||||||
|
"""
|
||||||
|
# Navigation Layer
|
||||||
|
|
||||||
|
The `docforge.nav` package manages the mapping between the logical documentation
|
||||||
|
structure and the physical files on disk.
|
||||||
|
|
||||||
|
## Workflow
|
||||||
|
|
||||||
|
1. **Spec Definition**: Users define navigation intent in `docforge.nav.yml`.
|
||||||
|
2. **Resolution**: `resolve_nav` matches patterns in the spec to generated `.md` files.
|
||||||
|
3. **Emission**: `MkDocsNavEmitter` produces the final YAML structure for `mkdocs.yml`.
|
||||||
|
|
||||||
|
This abstraction allows doc-forge to support complex grouping and ordering
|
||||||
|
independently of the source code's physical layout.
|
||||||
|
"""
|
||||||
|
|
||||||
from .spec import NavSpec, load_nav_spec
|
from .spec import NavSpec, load_nav_spec
|
||||||
from .resolver import ResolvedNav, resolve_nav
|
from .resolver import ResolvedNav, resolve_nav
|
||||||
from .mkdocs import MkDocsNavEmitter
|
from .mkdocs import MkDocsNavEmitter
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
from __future__ import annotations
|
"""
|
||||||
|
This module provides the MkDocsNavEmitter, which converts a ResolvedNav instance
|
||||||
|
into the specific YAML-ready list structure expected by the MkDocs 'nav'
|
||||||
|
configuration.
|
||||||
|
"""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Dict, Any
|
from typing import List, Dict, Any
|
||||||
@@ -7,9 +11,21 @@ from docforge.nav.resolver import ResolvedNav
|
|||||||
|
|
||||||
|
|
||||||
class MkDocsNavEmitter:
|
class MkDocsNavEmitter:
|
||||||
"""Emit MkDocs-compatible nav structures."""
|
"""
|
||||||
|
Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible
|
||||||
|
navigation structure.
|
||||||
|
"""
|
||||||
|
|
||||||
def emit(self, nav: ResolvedNav) -> List[Dict[str, Any]]:
|
def emit(self, nav: ResolvedNav) -> List[Dict[str, Any]]:
|
||||||
|
"""
|
||||||
|
Generate a list of navigation entries for mkdocs.yml.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
nav: The resolved navigation data.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A list of dictionary mappings representing the MkDocs navigation.
|
||||||
|
"""
|
||||||
result: List[Dict[str, Any]] = []
|
result: List[Dict[str, Any]] = []
|
||||||
|
|
||||||
# Home entry (semantic path)
|
# Home entry (semantic path)
|
||||||
@@ -21,14 +37,36 @@ class MkDocsNavEmitter:
|
|||||||
entries: List[str] = []
|
entries: List[str] = []
|
||||||
for p in paths:
|
for p in paths:
|
||||||
# Convert filesystem path back to docs-relative path
|
# Convert filesystem path back to docs-relative path
|
||||||
entries.append(self._to_relative(p))
|
rel_path = self._to_relative(p, nav._docs_root)
|
||||||
|
entries.append(rel_path)
|
||||||
result.append({group: entries})
|
result.append({group: entries})
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def _to_relative(self, path: Path) -> str:
|
def _to_relative(self, path: Path, docs_root: Path | None) -> str:
|
||||||
"""
|
"""
|
||||||
Convert a filesystem path to a docs-relative path.
|
Convert a filesystem path to a path relative to the documentation root.
|
||||||
|
This handles both absolute and relative filesystem paths, ensuring the
|
||||||
|
output is compatible with MkDocs navigation requirements.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
path: The path to convert.
|
||||||
|
docs_root: The root directory for documentation.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A string representing the relative POSIX-style path.
|
||||||
"""
|
"""
|
||||||
# Normalize to POSIX-style for MkDocs
|
if docs_root and path.is_absolute():
|
||||||
|
try:
|
||||||
|
path = path.relative_to(docs_root.resolve())
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
elif docs_root:
|
||||||
|
# Handle relative paths (e.g. starting with 'docs/')
|
||||||
|
path_str = path.as_posix()
|
||||||
|
docs_root_str = docs_root.as_posix()
|
||||||
|
if path_str.startswith(docs_root_str + "/"):
|
||||||
|
return path_str[len(docs_root_str) + 1:]
|
||||||
|
|
||||||
|
# Fallback for other cases
|
||||||
return path.as_posix().split("/docs/", 1)[-1]
|
return path.as_posix().split("/docs/", 1)[-1]
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class MkDocsNavEmitter:
|
|||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
def _to_relative(self, path: Path) -> str:
|
def _to_relative(self, path: Path, docs_root: Path | None) -> str:
|
||||||
"""
|
"""
|
||||||
Convert a filesystem path to a docs-relative path.
|
Convert a filesystem path to a docs-relative path.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
from __future__ import annotations
|
"""
|
||||||
|
This module contains the logic for resolving a NavSpec against the physical
|
||||||
|
filesystem. It expands globs and validates that all referenced documents
|
||||||
|
actually exist on disk.
|
||||||
|
"""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict, Iterable, List
|
from typing import Dict, Iterable, List
|
||||||
@@ -9,17 +13,40 @@ from docforge.nav.spec import NavSpec
|
|||||||
|
|
||||||
|
|
||||||
class ResolvedNav:
|
class ResolvedNav:
|
||||||
|
"""
|
||||||
|
Represents a navigation structure where all patterns and paths have been
|
||||||
|
resolved against the actual filesystem contents.
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
home: Resolved relative path to the home page.
|
||||||
|
groups: Mapping of group titles to lists of absolute or relative Path objects.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
home: str | None,
|
home: str | None,
|
||||||
groups: Dict[str, List[Path]],
|
groups: Dict[str, List[Path]],
|
||||||
docs_root: Path | None = None,
|
docs_root: Path | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
"""
|
||||||
|
Initialize a ResolvedNav instance.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
home: The relative path to the project home page.
|
||||||
|
groups: A mapping of group names to their resolved filesystem paths.
|
||||||
|
docs_root: The root documentation directory.
|
||||||
|
"""
|
||||||
self.home = home
|
self.home = home
|
||||||
self.groups = groups
|
self.groups = groups
|
||||||
self._docs_root = docs_root
|
self._docs_root = docs_root
|
||||||
|
|
||||||
def all_files(self) -> Iterable[Path]:
|
def all_files(self) -> Iterable[Path]:
|
||||||
|
"""
|
||||||
|
Get an iterable of all resolved files in the navigation structure.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An iterable of Path objects.
|
||||||
|
"""
|
||||||
if self.home:
|
if self.home:
|
||||||
if self._docs_root is None:
|
if self._docs_root is None:
|
||||||
raise RuntimeError("docs_root is required to resolve home path")
|
raise RuntimeError("docs_root is required to resolve home path")
|
||||||
@@ -33,10 +60,36 @@ def resolve_nav(
|
|||||||
spec: NavSpec,
|
spec: NavSpec,
|
||||||
docs_root: Path,
|
docs_root: Path,
|
||||||
) -> ResolvedNav:
|
) -> ResolvedNav:
|
||||||
|
"""
|
||||||
|
Create a ResolvedNav by processing a NavSpec against the filesystem.
|
||||||
|
This expands globs and validates the existence of referenced files.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
spec: The navigation specification to resolve.
|
||||||
|
docs_root: The root directory for documentation files.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A ResolvedNav instance.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist.
|
||||||
|
"""
|
||||||
if not docs_root.exists():
|
if not docs_root.exists():
|
||||||
raise FileNotFoundError(docs_root)
|
raise FileNotFoundError(docs_root)
|
||||||
|
|
||||||
def resolve_pattern(pattern: str) -> List[Path]:
|
def resolve_pattern(pattern: str) -> List[Path]:
|
||||||
|
"""
|
||||||
|
Resolve a single glob pattern relative to the docs_root.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
pattern: The glob pattern to resolve.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A sorted list of matching Path objects.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
FileNotFoundError: If the pattern doesn't match any files.
|
||||||
|
"""
|
||||||
full = docs_root / pattern
|
full = docs_root / pattern
|
||||||
matches = sorted(
|
matches = sorted(
|
||||||
Path(p) for p in glob.glob(str(full), recursive=True)
|
Path(p) for p in glob.glob(str(full), recursive=True)
|
||||||
|
|||||||
@@ -15,15 +15,14 @@ class ResolvedNav:
|
|||||||
|
|
||||||
home: Optional[str]
|
home: Optional[str]
|
||||||
groups: Dict[str, List[Path]]
|
groups: Dict[str, List[Path]]
|
||||||
|
_docs_root: Optional[Path]
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
home: str | None,
|
home: str | None,
|
||||||
groups: Dict[str, List[Path]],
|
groups: Dict[str, List[Path]],
|
||||||
docs_root: Path | None = None,
|
docs_root: Path | None = ...,
|
||||||
) -> None:
|
) -> None: ...
|
||||||
self._docs_root = None
|
|
||||||
...
|
|
||||||
|
|
||||||
def all_files(self) -> Iterable[Path]:
|
def all_files(self) -> Iterable[Path]:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
from __future__ import annotations
|
"""
|
||||||
|
This module defines the NavSpec class, which represents the user's intent for
|
||||||
|
documentation navigation as defined in a YAML specification (usually
|
||||||
|
docforge.nav.yml).
|
||||||
|
"""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict, List, Optional
|
from typing import Dict, List, Optional
|
||||||
@@ -7,18 +11,44 @@ import yaml
|
|||||||
|
|
||||||
|
|
||||||
class NavSpec:
|
class NavSpec:
|
||||||
"""Parsed representation of docforge.nav.yml."""
|
"""
|
||||||
|
Parsed representation of the docforge navigation specification file.
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
home: Path to the home document (e.g., 'index.md').
|
||||||
|
groups: Mapping of group titles to lists of path patterns/globs.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
home: Optional[str],
|
home: Optional[str],
|
||||||
groups: Dict[str, List[str]],
|
groups: Dict[str, List[str]],
|
||||||
) -> None:
|
) -> None:
|
||||||
|
"""
|
||||||
|
Initialize a NavSpec.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
home: The path to the home document.
|
||||||
|
groups: A mapping of group names to lists of path patterns (globs).
|
||||||
|
"""
|
||||||
self.home = home
|
self.home = home
|
||||||
self.groups = groups
|
self.groups = groups
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, path: Path) -> "NavSpec":
|
def load(cls, path: Path) -> "NavSpec":
|
||||||
|
"""
|
||||||
|
Load a NavSpec from a YAML file.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
path: The filesystem path to the YAML file.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A NavSpec instance.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
FileNotFoundError: If the path does not exist.
|
||||||
|
ValueError: If the file content is not a valid NavSpec mapping.
|
||||||
|
"""
|
||||||
if not path.exists():
|
if not path.exists():
|
||||||
raise FileNotFoundError(path)
|
raise FileNotFoundError(path)
|
||||||
|
|
||||||
@@ -47,6 +77,12 @@ class NavSpec:
|
|||||||
return cls(home=home, groups=groups)
|
return cls(home=home, groups=groups)
|
||||||
|
|
||||||
def all_patterns(self) -> List[str]:
|
def all_patterns(self) -> List[str]:
|
||||||
|
"""
|
||||||
|
Get all path patterns referenced in the specification.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A list of all patterns (home plus all groups).
|
||||||
|
"""
|
||||||
patterns: List[str] = []
|
patterns: List[str] = []
|
||||||
if self.home:
|
if self.home:
|
||||||
patterns.append(self.home)
|
patterns.append(self.home)
|
||||||
@@ -56,6 +92,15 @@ class NavSpec:
|
|||||||
|
|
||||||
|
|
||||||
def load_nav_spec(path: Path) -> NavSpec:
|
def load_nav_spec(path: Path) -> NavSpec:
|
||||||
|
"""
|
||||||
|
Utility function to load a NavSpec from a file.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
path: Path to the navigation specification file.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A loaded NavSpec instance.
|
||||||
|
"""
|
||||||
if not path.exists():
|
if not path.exists():
|
||||||
raise FileNotFoundError(path)
|
raise FileNotFoundError(path)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
from .mkdocs import MkDocsRenderer
|
"""
|
||||||
|
# Renderers Layer
|
||||||
|
|
||||||
|
The `docforge.renderers` package handles the transformation of the internal
|
||||||
|
documentation models into physical files formatted for specific documentation
|
||||||
|
engines.
|
||||||
|
|
||||||
|
## Current Implementations
|
||||||
|
|
||||||
|
- **MkDocsRenderer**: Generates Markdown files utilizing the `mkdocstrings`
|
||||||
|
syntax. It automatically handles package/module hierarchy and generates
|
||||||
|
`index.md` files for packages.
|
||||||
|
|
||||||
|
## Extending
|
||||||
|
|
||||||
|
To add a new renderer, implement the `DocRenderer` protocol defined in
|
||||||
|
`docforge.renderers.base`.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from .mkdocs_renderer import MkDocsRenderer
|
||||||
|
from .mcp_renderer import MCPRenderer
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"MkDocsRenderer",
|
"MkDocsRenderer",
|
||||||
|
"MCPRenderer",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
from .mkdocs import MkDocsRenderer
|
from .mkdocs_renderer import MkDocsRenderer
|
||||||
|
from .mcp_renderer import MCPRenderer
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"MkDocsRenderer",
|
"MkDocsRenderer",
|
||||||
|
"MCPRenderer",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,13 +1,46 @@
|
|||||||
from __future__ import annotations
|
"""
|
||||||
|
This module defines the base interfaces and configuration containers for
|
||||||
|
doc-forge renderers. All renderer implementations should adhere to the
|
||||||
|
DocRenderer protocol.
|
||||||
|
"""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from typing import Protocol
|
||||||
|
|
||||||
from docforge.model import Project
|
from docforge.models import Project
|
||||||
|
|
||||||
|
|
||||||
class RendererConfig:
|
class RendererConfig:
|
||||||
"""Renderer configuration container."""
|
"""
|
||||||
|
Configuration container for documentation renderers.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
out_dir: The directory where documentation files should be written.
|
||||||
|
project: The introspected project models to be rendered.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, out_dir: Path, project: Project) -> None:
|
def __init__(self, out_dir: Path, project: Project) -> None:
|
||||||
self.out_dir = out_dir
|
self.out_dir = out_dir
|
||||||
self.project = project
|
self.project = project
|
||||||
|
|
||||||
|
|
||||||
|
class DocRenderer(Protocol):
|
||||||
|
"""
|
||||||
|
Protocol defining the interface for documentation renderers.
|
||||||
|
"""
|
||||||
|
|
||||||
|
name: str
|
||||||
|
|
||||||
|
def generate_sources(
|
||||||
|
self,
|
||||||
|
project: Project,
|
||||||
|
out_dir: Path,
|
||||||
|
) -> None:
|
||||||
|
"""
|
||||||
|
Generate renderer-specific source files for the given project.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
project: The project models containing modules and objects.
|
||||||
|
out_dir: Target directory for the generated files.
|
||||||
|
"""
|
||||||
|
...
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Protocol
|
from typing import Protocol
|
||||||
|
|
||||||
from docforge.model import Project
|
from docforge.models import Project
|
||||||
|
|
||||||
|
|
||||||
class RendererConfig:
|
class RendererConfig:
|
||||||
|
|||||||
122
docforge/renderers/mcp_renderer.py
Normal file
122
docforge/renderers/mcp_renderer.py
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import Dict, List
|
||||||
|
|
||||||
|
from docforge.models import Project, Module, DocObject
|
||||||
|
|
||||||
|
|
||||||
|
class MCPRenderer:
|
||||||
|
"""
|
||||||
|
Renderer that emits MCP-native JSON resources from docforge models.
|
||||||
|
"""
|
||||||
|
|
||||||
|
name = "mcp"
|
||||||
|
|
||||||
|
def generate_sources(self, project: Project, out_dir: Path) -> None:
|
||||||
|
"""
|
||||||
|
Generate MCP-compatible JSON resources and navigation for the project.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
project: The project model to render.
|
||||||
|
out_dir: Target directory for the generated JSON files.
|
||||||
|
"""
|
||||||
|
modules_dir = out_dir / "modules"
|
||||||
|
modules_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
nav: List[Dict[str, str]] = []
|
||||||
|
|
||||||
|
for module in project.get_all_modules():
|
||||||
|
self._write_module(module, modules_dir)
|
||||||
|
|
||||||
|
nav.append({
|
||||||
|
"module": module.path,
|
||||||
|
"resource": f"doc://modules/{module.path}",
|
||||||
|
})
|
||||||
|
|
||||||
|
# Write nav.json
|
||||||
|
(out_dir / "nav.json").write_text(
|
||||||
|
self._json(nav),
|
||||||
|
encoding="utf-8",
|
||||||
|
)
|
||||||
|
|
||||||
|
# Write index.json
|
||||||
|
index = {
|
||||||
|
"project": project.name,
|
||||||
|
"type": "docforge-model",
|
||||||
|
"modules_count": len(nav),
|
||||||
|
"source": "docforge",
|
||||||
|
}
|
||||||
|
|
||||||
|
(out_dir / "index.json").write_text(
|
||||||
|
self._json(index),
|
||||||
|
encoding="utf-8",
|
||||||
|
)
|
||||||
|
|
||||||
|
def _write_module(self, module: Module, modules_dir: Path) -> None:
|
||||||
|
"""
|
||||||
|
Serialize a module into an MCP JSON resource on disk.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
module: The module instance to serialize.
|
||||||
|
modules_dir: The directory where the module JSON file should be written.
|
||||||
|
"""
|
||||||
|
payload = {
|
||||||
|
"module": module.path,
|
||||||
|
"content": self._render_module(module),
|
||||||
|
}
|
||||||
|
|
||||||
|
out = modules_dir / f"{module.path}.json"
|
||||||
|
out.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
out.write_text(self._json(payload), encoding="utf-8")
|
||||||
|
|
||||||
|
def _render_module(self, module: Module) -> Dict:
|
||||||
|
"""
|
||||||
|
Render a Module into MCP-friendly structured data.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
module: The module instance to render.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A dictionary following the MCP documentation resource schema.
|
||||||
|
"""
|
||||||
|
data: Dict = {
|
||||||
|
"path": module.path,
|
||||||
|
"docstring": module.docstring,
|
||||||
|
"objects": {},
|
||||||
|
}
|
||||||
|
|
||||||
|
for obj in module.get_all_objects():
|
||||||
|
data["objects"][obj.name] = self._render_object(obj)
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
def _render_object(self, obj: DocObject) -> Dict:
|
||||||
|
"""
|
||||||
|
Recursively render a DocObject into structured MCP data.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
obj: The documented object (class, func, etc.) to render.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A dictionary representing the object and its members.
|
||||||
|
"""
|
||||||
|
data: Dict = {
|
||||||
|
"name": obj.name,
|
||||||
|
"kind": obj.kind,
|
||||||
|
"path": obj.path,
|
||||||
|
"signature": obj.signature,
|
||||||
|
"docstring": obj.docstring,
|
||||||
|
}
|
||||||
|
|
||||||
|
members = list(obj.get_all_members())
|
||||||
|
if members:
|
||||||
|
data["members"] = {
|
||||||
|
member.name: self._render_object(member)
|
||||||
|
for member in members
|
||||||
|
}
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _json(data: Dict) -> str:
|
||||||
|
return json.dumps(data, indent=2, ensure_ascii=False)
|
||||||
26
docforge/renderers/mcp_renderer.pyi
Normal file
26
docforge/renderers/mcp_renderer.pyi
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
from typing import Dict, List
|
||||||
|
|
||||||
|
from docforge.models import Project, Module, DocObject
|
||||||
|
|
||||||
|
|
||||||
|
class MCPRenderer:
|
||||||
|
"""Renderer that emits MCP-native JSON resources from docforge models."""
|
||||||
|
|
||||||
|
name: str
|
||||||
|
|
||||||
|
def generate_sources(self, project: Project, out_dir: Path) -> None:
|
||||||
|
"""Generate MCP-compatible JSON resources and navigation for the project."""
|
||||||
|
|
||||||
|
def _write_module(self, module: Module, modules_dir: Path) -> None:
|
||||||
|
"""Serialize a module into an MCP JSON resource."""
|
||||||
|
|
||||||
|
def _render_module(self, module: Module) -> Dict:
|
||||||
|
"""Render a Module into MCP-friendly structured data."""
|
||||||
|
|
||||||
|
def _render_object(self, obj: DocObject) -> Dict:
|
||||||
|
"""Recursively render a DocObject into structured MCP data."""
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _json(data: Dict) -> str:
|
||||||
|
"""Serialize structured data to formatted JSON."""
|
||||||
@@ -1,16 +1,30 @@
|
|||||||
from __future__ import annotations
|
"""
|
||||||
|
This module implements the MkDocsRenderer, which generates Markdown source files
|
||||||
|
compatible with the MkDocs 'material' theme and 'mkdocstrings' extension.
|
||||||
|
"""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from docforge.model import Project
|
from docforge.models import Project
|
||||||
|
|
||||||
|
|
||||||
class MkDocsRenderer:
|
class MkDocsRenderer:
|
||||||
"""MkDocs source generator using mkdocstrings."""
|
"""
|
||||||
|
Renderer that generates Markdown source files formatted for the MkDocs
|
||||||
|
'mkdocstrings' plugin.
|
||||||
|
"""
|
||||||
|
|
||||||
name = "mkdocs"
|
name = "mkdocs"
|
||||||
|
|
||||||
def generate_sources(self, project: Project, out_dir: Path) -> None:
|
def generate_sources(self, project: Project, out_dir: Path) -> None:
|
||||||
|
"""
|
||||||
|
Produce a set of Markdown files in the output directory based on the
|
||||||
|
provided Project models.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
project: The project models to render.
|
||||||
|
out_dir: Target directory for documentation files.
|
||||||
|
"""
|
||||||
modules = list(project.get_all_modules())
|
modules = list(project.get_all_modules())
|
||||||
paths = {m.path for m in modules}
|
paths = {m.path for m in modules}
|
||||||
|
|
||||||
@@ -27,6 +41,15 @@ class MkDocsRenderer:
|
|||||||
# Internal helpers
|
# Internal helpers
|
||||||
# -------------------------
|
# -------------------------
|
||||||
def _write_module(self, module, packages: set[str], out_dir: Path) -> None:
|
def _write_module(self, module, packages: set[str], out_dir: Path) -> None:
|
||||||
|
"""
|
||||||
|
Write a single module's documentation file. Packages are written as
|
||||||
|
'index.md' inside their respective directories.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
module: The module to write.
|
||||||
|
packages: A set of module paths that are identified as packages.
|
||||||
|
out_dir: The base output directory.
|
||||||
|
"""
|
||||||
parts = module.path.split(".")
|
parts = module.path.split(".")
|
||||||
|
|
||||||
if module.path in packages:
|
if module.path in packages:
|
||||||
@@ -52,6 +75,16 @@ class MkDocsRenderer:
|
|||||||
md_path.write_text(content, encoding="utf-8")
|
md_path.write_text(content, encoding="utf-8")
|
||||||
|
|
||||||
def _render_markdown(self, title: str, module_path: str) -> str:
|
def _render_markdown(self, title: str, module_path: str) -> str:
|
||||||
|
"""
|
||||||
|
Generate the Markdown content for a module file.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
title: The display title for the page.
|
||||||
|
module_path: The dotted path of the module to document.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A string containing the Markdown source.
|
||||||
|
"""
|
||||||
return (
|
return (
|
||||||
f"# {title}\n\n"
|
f"# {title}\n\n"
|
||||||
f"::: {module_path}\n"
|
f"::: {module_path}\n"
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Set
|
from typing import Set
|
||||||
|
|
||||||
from docforge.model import Project, Module
|
from docforge.models import Project, Module
|
||||||
|
|
||||||
|
|
||||||
class MkDocsRenderer:
|
class MkDocsRenderer:
|
||||||
5
docforge/servers/__init__.py
Normal file
5
docforge/servers/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
from .mcp_server import MCPServer
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"MCPServer",
|
||||||
|
]
|
||||||
5
docforge/servers/__init__.pyi
Normal file
5
docforge/servers/__init__.pyi
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
from .mcp_server import MCPServer
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"MCPServer",
|
||||||
|
]
|
||||||
95
docforge/servers/mcp_server.py
Normal file
95
docforge/servers/mcp_server.py
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import Any, Literal
|
||||||
|
|
||||||
|
from mcp.server.fastmcp import FastMCP
|
||||||
|
|
||||||
|
|
||||||
|
class MCPServer:
|
||||||
|
"""
|
||||||
|
MCP server for serving a pre-built MCP documentation bundle.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, mcp_root: Path, name: str) -> None:
|
||||||
|
"""
|
||||||
|
Initialize the MCPServer.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
mcp_root: Path to the directory containing pre-built MCP JSON resources.
|
||||||
|
name: Name of the MCP server.
|
||||||
|
"""
|
||||||
|
self.mcp_root = mcp_root
|
||||||
|
self.app = FastMCP(name)
|
||||||
|
|
||||||
|
self._register_resources()
|
||||||
|
self._register_tools()
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
# Internal helpers
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
|
||||||
|
def _read_json(self, path: Path) -> Any:
|
||||||
|
"""
|
||||||
|
Read and parse a JSON file, returning diagnostic errors if missing.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
path: Path to the JSON file.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The parsed JSON data or an error dictionary.
|
||||||
|
"""
|
||||||
|
if not path.exists():
|
||||||
|
return {
|
||||||
|
"error": "not_found",
|
||||||
|
"path": str(path),
|
||||||
|
}
|
||||||
|
return json.loads(path.read_text(encoding="utf-8"))
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
# MCP resources
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
|
||||||
|
def _register_resources(self) -> None:
|
||||||
|
"""
|
||||||
|
Register MCP resources for index, nav, and individual modules.
|
||||||
|
"""
|
||||||
|
@self.app.resource("docs://index")
|
||||||
|
def index():
|
||||||
|
return self._read_json(self.mcp_root / "index.json")
|
||||||
|
|
||||||
|
@self.app.resource("docs://nav")
|
||||||
|
def nav():
|
||||||
|
return self._read_json(self.mcp_root / "nav.json")
|
||||||
|
|
||||||
|
@self.app.resource("docs://modules/{module}")
|
||||||
|
def module(module: str):
|
||||||
|
return self._read_json(
|
||||||
|
self.mcp_root / "modules" / f"{module}.json"
|
||||||
|
)
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
# MCP tools (optional / diagnostic)
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
|
||||||
|
def _register_tools(self) -> None:
|
||||||
|
"""
|
||||||
|
Register high-level MCP tools for diagnostics.
|
||||||
|
"""
|
||||||
|
@self.app.tool()
|
||||||
|
def ping() -> str:
|
||||||
|
return "pong"
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
# Server lifecycle
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
|
||||||
|
def run(self, transport: Literal["stdio", "sse", "streamable-http"] = "streamable-http") -> None:
|
||||||
|
"""
|
||||||
|
Start the MCP server.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
transport: MCP transport (default: streamable-http)
|
||||||
|
"""
|
||||||
|
self.app.run(transport=transport)
|
||||||
22
docforge/servers/mcp_server.pyi
Normal file
22
docforge/servers/mcp_server.pyi
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
from typing import Literal, Any
|
||||||
|
|
||||||
|
from mcp.server.fastmcp import FastMCP
|
||||||
|
|
||||||
|
|
||||||
|
class MCPServer:
|
||||||
|
"""MCP server for serving documentation."""
|
||||||
|
|
||||||
|
mcp_root: Path
|
||||||
|
app: FastMCP
|
||||||
|
|
||||||
|
def __init__(self, mcp_root: Path, name: str) -> None: ...
|
||||||
|
|
||||||
|
def _read_json(self, path: Path) -> Any: ...
|
||||||
|
|
||||||
|
def _register_resources(self) -> None: ...
|
||||||
|
|
||||||
|
def _register_tools(self) -> None: ...
|
||||||
|
|
||||||
|
def run(self, transport: Literal["stdio", "sse", "streamable-http"] = ...) -> None:
|
||||||
|
"""Start the MCP server."""
|
||||||
3
docs/docforge/cli/commands.md
Normal file
3
docs/docforge/cli/commands.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Commands
|
||||||
|
|
||||||
|
::: docforge.cli.commands
|
||||||
3
docs/docforge/cli/index.md
Normal file
3
docs/docforge/cli/index.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Cli
|
||||||
|
|
||||||
|
::: docforge.cli
|
||||||
3
docs/docforge/cli/main.md
Normal file
3
docs/docforge/cli/main.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Main
|
||||||
|
|
||||||
|
::: docforge.cli.main
|
||||||
3
docs/docforge/cli/mcp_utils.md
Normal file
3
docs/docforge/cli/mcp_utils.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Mcp Utils
|
||||||
|
|
||||||
|
::: docforge.cli.mcp_utils
|
||||||
3
docs/docforge/cli/mkdocs_utils.md
Normal file
3
docs/docforge/cli/mkdocs_utils.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Mkdocs Utils
|
||||||
|
|
||||||
|
::: docforge.cli.mkdocs_utils
|
||||||
3
docs/docforge/index.md
Normal file
3
docs/docforge/index.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Docforge
|
||||||
|
|
||||||
|
::: docforge
|
||||||
3
docs/docforge/loaders/griffe_loader.md
Normal file
3
docs/docforge/loaders/griffe_loader.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Griffe Loader
|
||||||
|
|
||||||
|
::: docforge.loaders.griffe_loader
|
||||||
3
docs/docforge/loaders/index.md
Normal file
3
docs/docforge/loaders/index.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Loaders
|
||||||
|
|
||||||
|
::: docforge.loaders
|
||||||
3
docs/docforge/models/index.md
Normal file
3
docs/docforge/models/index.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Models
|
||||||
|
|
||||||
|
::: docforge.models
|
||||||
3
docs/docforge/models/module.md
Normal file
3
docs/docforge/models/module.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Module
|
||||||
|
|
||||||
|
::: docforge.models.module
|
||||||
3
docs/docforge/models/object.md
Normal file
3
docs/docforge/models/object.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Object
|
||||||
|
|
||||||
|
::: docforge.models.object
|
||||||
3
docs/docforge/models/project.md
Normal file
3
docs/docforge/models/project.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Project
|
||||||
|
|
||||||
|
::: docforge.models.project
|
||||||
3
docs/docforge/nav/index.md
Normal file
3
docs/docforge/nav/index.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Nav
|
||||||
|
|
||||||
|
::: docforge.nav
|
||||||
3
docs/docforge/nav/mkdocs.md
Normal file
3
docs/docforge/nav/mkdocs.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Mkdocs
|
||||||
|
|
||||||
|
::: docforge.nav.mkdocs
|
||||||
3
docs/docforge/nav/resolver.md
Normal file
3
docs/docforge/nav/resolver.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Resolver
|
||||||
|
|
||||||
|
::: docforge.nav.resolver
|
||||||
3
docs/docforge/nav/spec.md
Normal file
3
docs/docforge/nav/spec.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Spec
|
||||||
|
|
||||||
|
::: docforge.nav.spec
|
||||||
3
docs/docforge/renderers/base.md
Normal file
3
docs/docforge/renderers/base.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Base
|
||||||
|
|
||||||
|
::: docforge.renderers.base
|
||||||
3
docs/docforge/renderers/index.md
Normal file
3
docs/docforge/renderers/index.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Renderers
|
||||||
|
|
||||||
|
::: docforge.renderers
|
||||||
3
docs/docforge/renderers/mcp_renderer.md
Normal file
3
docs/docforge/renderers/mcp_renderer.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Mcp Renderer
|
||||||
|
|
||||||
|
::: docforge.renderers.mcp_renderer
|
||||||
3
docs/docforge/renderers/mkdocs_renderer.md
Normal file
3
docs/docforge/renderers/mkdocs_renderer.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Mkdocs Renderer
|
||||||
|
|
||||||
|
::: docforge.renderers.mkdocs_renderer
|
||||||
3
docs/docforge/servers/index.md
Normal file
3
docs/docforge/servers/index.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Servers
|
||||||
|
|
||||||
|
::: docforge.servers
|
||||||
3
docs/docforge/servers/mcp_server.md
Normal file
3
docs/docforge/servers/mcp_server.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Mcp Server
|
||||||
|
|
||||||
|
::: docforge.servers.mcp_server
|
||||||
6
mcp_docs/index.json
Normal file
6
mcp_docs/index.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"project": "docforge",
|
||||||
|
"type": "docforge-model",
|
||||||
|
"modules_count": 22,
|
||||||
|
"source": "docforge"
|
||||||
|
}
|
||||||
370
mcp_docs/modules/docforge.cli.commands.json
Normal file
370
mcp_docs/modules/docforge.cli.commands.json
Normal file
@@ -0,0 +1,370 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.cli.commands",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.cli.commands",
|
||||||
|
"docstring": null,
|
||||||
|
"objects": {
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Sequence": {
|
||||||
|
"name": "Sequence",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.Sequence",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Sequence', 'typing.Sequence')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Optional": {
|
||||||
|
"name": "Optional",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.Optional",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
|
||||||
|
"docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.",
|
||||||
|
"members": {
|
||||||
|
"load_project": {
|
||||||
|
"name": "load_project",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.GriffeLoader.load_project",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||||||
|
"docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules."
|
||||||
|
},
|
||||||
|
"load_module": {
|
||||||
|
"name": "load_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.GriffeLoader.load_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mkdocs_utils": {
|
||||||
|
"name": "mkdocs_utils",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('mkdocs_utils', 'docforge.cli.mkdocs_utils')>",
|
||||||
|
"docstring": null,
|
||||||
|
"members": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mkdocs_utils.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"resources": {
|
||||||
|
"name": "resources",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.resources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('resources', 'docforge.cli.mkdocs_utils.resources')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mkdocs_utils.click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"yaml": {
|
||||||
|
"name": "yaml",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.yaml",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('yaml', 'docforge.cli.mkdocs_utils.yaml')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mkdocs_utils.GriffeLoader')>",
|
||||||
|
"docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.",
|
||||||
|
"members": {
|
||||||
|
"load_project": {
|
||||||
|
"name": "load_project",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_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": {
|
||||||
|
"name": "load_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"discover_module_paths": {
|
||||||
|
"name": "discover_module_paths",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.discover_module_paths",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mkdocs_utils.discover_module_paths')>",
|
||||||
|
"docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths."
|
||||||
|
},
|
||||||
|
"MkDocsRenderer": {
|
||||||
|
"name": "MkDocsRenderer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MkDocsRenderer', 'docforge.cli.mkdocs_utils.MkDocsRenderer')>",
|
||||||
|
"docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_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.commands.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.commands.mkdocs_utils.load_nav_spec",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('load_nav_spec', 'docforge.cli.mkdocs_utils.load_nav_spec')>",
|
||||||
|
"docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance."
|
||||||
|
},
|
||||||
|
"resolve_nav": {
|
||||||
|
"name": "resolve_nav",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.resolve_nav",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('resolve_nav', 'docforge.cli.mkdocs_utils.resolve_nav')>",
|
||||||
|
"docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist."
|
||||||
|
},
|
||||||
|
"MkDocsNavEmitter": {
|
||||||
|
"name": "MkDocsNavEmitter",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.MkDocsNavEmitter",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MkDocsNavEmitter', 'docforge.cli.mkdocs_utils.MkDocsNavEmitter')>",
|
||||||
|
"docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.",
|
||||||
|
"members": {
|
||||||
|
"emit": {
|
||||||
|
"name": "emit",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_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.commands.mkdocs_utils.generate_sources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.cli.mkdocs_utils.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."
|
||||||
|
},
|
||||||
|
"generate_config": {
|
||||||
|
"name": "generate_config",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.generate_config",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_config', 'docforge.cli.mkdocs_utils.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."
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"name": "build",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.build",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('build', 'docforge.cli.mkdocs_utils.build')>",
|
||||||
|
"docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.serve",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mkdocs_utils.serve')>",
|
||||||
|
"docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mcp_utils": {
|
||||||
|
"name": "mcp_utils",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('mcp_utils', 'docforge.cli.mcp_utils')>",
|
||||||
|
"docstring": null,
|
||||||
|
"members": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mcp_utils.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mcp_utils.click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mcp_utils.GriffeLoader')>",
|
||||||
|
"docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.",
|
||||||
|
"members": {
|
||||||
|
"load_project": {
|
||||||
|
"name": "load_project",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_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": {
|
||||||
|
"name": "load_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"discover_module_paths": {
|
||||||
|
"name": "discover_module_paths",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.discover_module_paths",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mcp_utils.discover_module_paths')>",
|
||||||
|
"docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths."
|
||||||
|
},
|
||||||
|
"MCPRenderer": {
|
||||||
|
"name": "MCPRenderer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.MCPRenderer",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.cli.mcp_utils.MCPRenderer')>",
|
||||||
|
"docstring": "Renderer that emits MCP-native JSON resources from docforge models.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.MCPRenderer.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MCPServer": {
|
||||||
|
"name": "MCPServer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.MCPServer",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MCPServer', 'docforge.cli.mcp_utils.MCPServer')>",
|
||||||
|
"docstring": "MCP server for serving a pre-built MCP documentation bundle.",
|
||||||
|
"members": {
|
||||||
|
"mcp_root": {
|
||||||
|
"name": "mcp_root",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.MCPServer.mcp_root",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('mcp_root', 'docforge.servers.mcp_server.MCPServer.mcp_root')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"name": "app",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.MCPServer.app",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('app', 'docforge.servers.mcp_server.MCPServer.app')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"run": {
|
||||||
|
"name": "run",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.MCPServer.run",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>",
|
||||||
|
"docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"generate_resources": {
|
||||||
|
"name": "generate_resources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.generate_resources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_resources', 'docforge.cli.mcp_utils.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."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.serve",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp_utils.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/."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"cli": {
|
||||||
|
"name": "cli",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.commands.cli",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"name": "build",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.build",
|
||||||
|
"signature": "<bound method Function.signature of Function('build', 18, 89)>",
|
||||||
|
"docstring": "Build documentation (MkDocs site or MCP resources).\n\nThis command orchestrates the full build process:\n1. Introspects the code (Griffe)\n2. Renders sources (MkDocs Markdown or MCP JSON)\n3. (MkDocs only) Generates config and runs the final site build.\n\nArgs:\n mcp: Use the MCP documentation builder.\n mkdocs: Use the MkDocs documentation builder.\n module: The dotted path of the module to document.\n project_name: Optional override for the project name.\n site_name: (MkDocs) The site display name. Defaults to module name.\n docs_dir: (MkDocs) Target directory for Markdown sources.\n nav_file: (MkDocs) Path to the docforge.nav.yml specification.\n template: (MkDocs) Optional custom mkdocs.yml template.\n mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.\n out_dir: (MCP) Target directory for MCP JSON resources."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.serve",
|
||||||
|
"signature": "<bound method Function.signature of Function('serve', 92, 120)>",
|
||||||
|
"docstring": "Serve documentation (MkDocs or MCP).\n\nArgs:\n mcp: Serve MCP resources via an MCP server.\n mkdocs: Serve the MkDocs site using the built-in development server.\n mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.\n out_dir: (MCP) Path to the mcp_docs/ directory."
|
||||||
|
},
|
||||||
|
"tree": {
|
||||||
|
"name": "tree",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.tree",
|
||||||
|
"signature": "<bound method Function.signature of Function('tree', 123, 153)>",
|
||||||
|
"docstring": "Visualize the project structure in the terminal.\n\nArgs:\n modules: List of module import paths to recursively introspect.\n project_name: Optional override for the project name shown at the root."
|
||||||
|
},
|
||||||
|
"Group": {
|
||||||
|
"name": "Group",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.Group",
|
||||||
|
"signature": "<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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
670
mcp_docs/modules/docforge.cli.json
Normal file
670
mcp_docs/modules/docforge.cli.json
Normal file
@@ -0,0 +1,670 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.cli",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.cli",
|
||||||
|
"docstring": "# CLI Layer\n\nThe `docforge.cli` package provides the command-line interface for interacting\nwith doc-forge.\n\n## Available Commands\n\n- **build**: Build documentation (MkDocs site or MCP resources).\n- **serve**: Serve documentation (MkDocs or MCP).\n- **tree**: Visualize the introspected project structure.",
|
||||||
|
"objects": {
|
||||||
|
"main": {
|
||||||
|
"name": "main",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.cli.main",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": "Main entry point for the doc-forge CLI. This module delegates all command\nexecution to docforge.cli.commands.",
|
||||||
|
"members": {
|
||||||
|
"cli": {
|
||||||
|
"name": "cli",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.main.cli",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('cli', 'docforge.cli.commands.cli')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"main": {
|
||||||
|
"name": "main",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.main.main",
|
||||||
|
"signature": "<bound method Function.signature of Function('main', 7, 11)>",
|
||||||
|
"docstring": "CLI Entry point. Boots the click application."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commands": {
|
||||||
|
"name": "commands",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.cli.commands",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null,
|
||||||
|
"members": {
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Sequence": {
|
||||||
|
"name": "Sequence",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.Sequence",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Sequence', 'typing.Sequence')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Optional": {
|
||||||
|
"name": "Optional",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.Optional",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
|
||||||
|
"docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.",
|
||||||
|
"members": {
|
||||||
|
"load_project": {
|
||||||
|
"name": "load_project",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.GriffeLoader.load_project",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||||||
|
"docstring": "Load multiple modules and combine them into a single Project models.\n\nArgs:\n module_paths: A list of dotted paths to the modules to load.\n project_name: Optional name for the project. Defaults to the first module name.\n skip_import_errors: If True, modules that fail to import will be skipped.\n\nReturns:\n A Project instance containing the loaded modules."
|
||||||
|
},
|
||||||
|
"load_module": {
|
||||||
|
"name": "load_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.GriffeLoader.load_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mkdocs_utils": {
|
||||||
|
"name": "mkdocs_utils",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('mkdocs_utils', 'docforge.cli.mkdocs_utils')>",
|
||||||
|
"docstring": null,
|
||||||
|
"members": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mkdocs_utils.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"resources": {
|
||||||
|
"name": "resources",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.resources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('resources', 'docforge.cli.mkdocs_utils.resources')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mkdocs_utils.click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"yaml": {
|
||||||
|
"name": "yaml",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.yaml",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('yaml', 'docforge.cli.mkdocs_utils.yaml')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mkdocs_utils.GriffeLoader')>",
|
||||||
|
"docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.",
|
||||||
|
"members": {
|
||||||
|
"load_project": {
|
||||||
|
"name": "load_project",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_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": {
|
||||||
|
"name": "load_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"discover_module_paths": {
|
||||||
|
"name": "discover_module_paths",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.discover_module_paths",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mkdocs_utils.discover_module_paths')>",
|
||||||
|
"docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths."
|
||||||
|
},
|
||||||
|
"MkDocsRenderer": {
|
||||||
|
"name": "MkDocsRenderer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MkDocsRenderer', 'docforge.cli.mkdocs_utils.MkDocsRenderer')>",
|
||||||
|
"docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_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.commands.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.commands.mkdocs_utils.load_nav_spec",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('load_nav_spec', 'docforge.cli.mkdocs_utils.load_nav_spec')>",
|
||||||
|
"docstring": "Utility function to load a NavSpec from a file.\n\nArgs:\n path: Path to the navigation specification file.\n\nReturns:\n A loaded NavSpec instance."
|
||||||
|
},
|
||||||
|
"resolve_nav": {
|
||||||
|
"name": "resolve_nav",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.resolve_nav",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('resolve_nav', 'docforge.cli.mkdocs_utils.resolve_nav')>",
|
||||||
|
"docstring": "Create a ResolvedNav by processing a NavSpec against the filesystem.\nThis expands globs and validates the existence of referenced files.\n\nArgs:\n spec: The navigation specification to resolve.\n docs_root: The root directory for documentation files.\n\nReturns:\n A ResolvedNav instance.\n\nRaises:\n FileNotFoundError: If a pattern doesn't match any files or the docs_root doesn't exist."
|
||||||
|
},
|
||||||
|
"MkDocsNavEmitter": {
|
||||||
|
"name": "MkDocsNavEmitter",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.MkDocsNavEmitter",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MkDocsNavEmitter', 'docforge.cli.mkdocs_utils.MkDocsNavEmitter')>",
|
||||||
|
"docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.",
|
||||||
|
"members": {
|
||||||
|
"emit": {
|
||||||
|
"name": "emit",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_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.commands.mkdocs_utils.generate_sources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.cli.mkdocs_utils.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."
|
||||||
|
},
|
||||||
|
"generate_config": {
|
||||||
|
"name": "generate_config",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.generate_config",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_config', 'docforge.cli.mkdocs_utils.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."
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"name": "build",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.build",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('build', 'docforge.cli.mkdocs_utils.build')>",
|
||||||
|
"docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mkdocs_utils.serve",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mkdocs_utils.serve')>",
|
||||||
|
"docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mcp_utils": {
|
||||||
|
"name": "mcp_utils",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('mcp_utils', 'docforge.cli.mcp_utils')>",
|
||||||
|
"docstring": null,
|
||||||
|
"members": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'docforge.cli.mcp_utils.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"click": {
|
||||||
|
"name": "click",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.click",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('click', 'docforge.cli.mcp_utils.click')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mcp_utils.GriffeLoader')>",
|
||||||
|
"docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.",
|
||||||
|
"members": {
|
||||||
|
"load_project": {
|
||||||
|
"name": "load_project",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_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": {
|
||||||
|
"name": "load_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||||||
|
"docstring": "Load a single module and convert its introspection data into the docforge models.\n\nArgs:\n path: The dotted path of the module to load.\n\nReturns:\n A Module instance."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"discover_module_paths": {
|
||||||
|
"name": "discover_module_paths",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.discover_module_paths",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mcp_utils.discover_module_paths')>",
|
||||||
|
"docstring": "Discover all Python modules under a package via filesystem traversal.\n\nRules:\n- Directory with __init__.py is treated as a package.\n- Any .py file is treated as a module.\n- All paths are converted to dotted module paths.\n\nArgs:\n module_name: The name of the package to discover.\n project_root: The root directory of the project. Defaults to current working directory.\n\nReturns:\n A sorted list of dotted module paths."
|
||||||
|
},
|
||||||
|
"MCPRenderer": {
|
||||||
|
"name": "MCPRenderer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.MCPRenderer",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.cli.mcp_utils.MCPRenderer')>",
|
||||||
|
"docstring": "Renderer that emits MCP-native JSON resources from docforge models.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.MCPRenderer.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.renderers.mcp_renderer.MCPRenderer.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MCPServer": {
|
||||||
|
"name": "MCPServer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.MCPServer",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MCPServer', 'docforge.cli.mcp_utils.MCPServer')>",
|
||||||
|
"docstring": "MCP server for serving a pre-built MCP documentation bundle.",
|
||||||
|
"members": {
|
||||||
|
"mcp_root": {
|
||||||
|
"name": "mcp_root",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.MCPServer.mcp_root",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('mcp_root', 'docforge.servers.mcp_server.MCPServer.mcp_root')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"name": "app",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.MCPServer.app",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('app', 'docforge.servers.mcp_server.MCPServer.app')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"run": {
|
||||||
|
"name": "run",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.MCPServer.run",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>",
|
||||||
|
"docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"generate_resources": {
|
||||||
|
"name": "generate_resources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.generate_resources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_resources', 'docforge.cli.mcp_utils.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."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.mcp_utils.serve",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp_utils.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/."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"cli": {
|
||||||
|
"name": "cli",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.commands.cli",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"name": "build",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.build",
|
||||||
|
"signature": "<bound method Function.signature of Function('build', 18, 89)>",
|
||||||
|
"docstring": "Build documentation (MkDocs site or MCP resources).\n\nThis command orchestrates the full build process:\n1. Introspects the code (Griffe)\n2. Renders sources (MkDocs Markdown or MCP JSON)\n3. (MkDocs only) Generates config and runs the final site build.\n\nArgs:\n mcp: Use the MCP documentation builder.\n mkdocs: Use the MkDocs documentation builder.\n module: The dotted path of the module to document.\n project_name: Optional override for the project name.\n site_name: (MkDocs) The site display name. Defaults to module name.\n docs_dir: (MkDocs) Target directory for Markdown sources.\n nav_file: (MkDocs) Path to the docforge.nav.yml specification.\n template: (MkDocs) Optional custom mkdocs.yml template.\n mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.\n out_dir: (MCP) Target directory for MCP JSON resources."
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"name": "serve",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.serve",
|
||||||
|
"signature": "<bound method Function.signature of Function('serve', 92, 120)>",
|
||||||
|
"docstring": "Serve documentation (MkDocs or MCP).\n\nArgs:\n mcp: Serve MCP resources via an MCP server.\n mkdocs: Serve the MkDocs site using the built-in development server.\n mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.\n out_dir: (MCP) Path to the mcp_docs/ directory."
|
||||||
|
},
|
||||||
|
"tree": {
|
||||||
|
"name": "tree",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.commands.tree",
|
||||||
|
"signature": "<bound method Function.signature of Function('tree', 123, 153)>",
|
||||||
|
"docstring": "Visualize the project structure in the terminal.\n\nArgs:\n modules: List of module import paths to recursively introspect.\n project_name: Optional override for the project name shown at the root."
|
||||||
|
},
|
||||||
|
"Group": {
|
||||||
|
"name": "Group",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.commands.Group",
|
||||||
|
"signature": "<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": {
|
||||||
|
"name": "mcp_utils",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.cli.mcp_utils",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null,
|
||||||
|
"members": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mcp_utils.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"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": {
|
||||||
|
"load_project": {
|
||||||
|
"name": "load_project",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mcp_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": {
|
||||||
|
"name": "load_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mcp_utils.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_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."
|
||||||
|
},
|
||||||
|
"MCPRenderer": {
|
||||||
|
"name": "MCPRenderer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.mcp_utils.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_utils.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_utils.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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"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": {
|
||||||
|
"name": "app",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.mcp_utils.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_utils.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_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": {
|
||||||
|
"name": "load_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mkdocs_utils.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_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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
23
mcp_docs/modules/docforge.cli.main.json
Normal file
23
mcp_docs/modules/docforge.cli.main.json
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.cli.main",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.cli.main",
|
||||||
|
"docstring": "Main entry point for the doc-forge CLI. This module delegates all command\nexecution to docforge.cli.commands.",
|
||||||
|
"objects": {
|
||||||
|
"cli": {
|
||||||
|
"name": "cli",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.main.cli",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('cli', 'docforge.cli.commands.cli')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"main": {
|
||||||
|
"name": "main",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.main.main",
|
||||||
|
"signature": "<bound method Function.signature of Function('main', 7, 11)>",
|
||||||
|
"docstring": "CLI Entry point. Boots the click application."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
mcp_docs/modules/docforge.cli.mcp_utils.json
Normal file
120
mcp_docs/modules/docforge.cli.mcp_utils.json
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.cli.mcp_utils",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.cli.mcp_utils",
|
||||||
|
"docstring": null,
|
||||||
|
"objects": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.cli.mcp_utils.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"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": {
|
||||||
|
"load_project": {
|
||||||
|
"name": "load_project",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mcp_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": {
|
||||||
|
"name": "load_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mcp_utils.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_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."
|
||||||
|
},
|
||||||
|
"MCPRenderer": {
|
||||||
|
"name": "MCPRenderer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.cli.mcp_utils.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_utils.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_utils.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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"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": {
|
||||||
|
"name": "app",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.cli.mcp_utils.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_utils.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_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/."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
148
mcp_docs/modules/docforge.cli.mkdocs_utils.json
Normal file
148
mcp_docs/modules/docforge.cli.mkdocs_utils.json
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.cli.mkdocs_utils",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.cli.mkdocs_utils",
|
||||||
|
"docstring": null,
|
||||||
|
"objects": {
|
||||||
|
"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": {
|
||||||
|
"name": "load_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.cli.mkdocs_utils.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_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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2735
mcp_docs/modules/docforge.json
Normal file
2735
mcp_docs/modules/docforge.json
Normal file
File diff suppressed because it is too large
Load Diff
276
mcp_docs/modules/docforge.loaders.griffe_loader.json
Normal file
276
mcp_docs/modules/docforge.loaders.griffe_loader.json
Normal file
@@ -0,0 +1,276 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.loaders.griffe_loader",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.loaders.griffe_loader",
|
||||||
|
"docstring": "This module provides the GriffeLoader, which uses the 'griffe' library to\nintrospect Python source code and populate the doc-forge Project models.",
|
||||||
|
"objects": {
|
||||||
|
"logging": {
|
||||||
|
"name": "logging",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.logging",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('logging', 'logging')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"List": {
|
||||||
|
"name": "List",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.List",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('List', 'typing.List')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Optional": {
|
||||||
|
"name": "Optional",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Optional",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"ModulesCollection": {
|
||||||
|
"name": "ModulesCollection",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.ModulesCollection",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('ModulesCollection', 'griffe.ModulesCollection')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"LinesCollection": {
|
||||||
|
"name": "LinesCollection",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.LinesCollection",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('LinesCollection', 'griffe.LinesCollection')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Object": {
|
||||||
|
"name": "Object",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Object', 'griffe.Object')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"AliasResolutionError": {
|
||||||
|
"name": "AliasResolutionError",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.AliasResolutionError",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('AliasResolutionError', 'griffe.AliasResolutionError')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Module": {
|
||||||
|
"name": "Module",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>",
|
||||||
|
"docstring": "Represents a documented Python module or package.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level docstring content.\n members: Dictionary mapping object names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Module.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.module.Module.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Module.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.module.Module.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Module.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.module.Module.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_object": {
|
||||||
|
"name": "add_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Module.add_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.Module.add_object')>",
|
||||||
|
"docstring": "Add a documented object to the module.\n\nArgs:\n obj: The object to add."
|
||||||
|
},
|
||||||
|
"get_object": {
|
||||||
|
"name": "get_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Module.get_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
|
||||||
|
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: The name of the object.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_objects": {
|
||||||
|
"name": "get_all_objects",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Module.get_all_objects",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
|
||||||
|
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Project": {
|
||||||
|
"name": "Project",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Project",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
|
||||||
|
"docstring": "Represents a documentation project, serving as a container for modules.\n\nAttributes:\n name: Name of the project.\n modules: Dictionary mapping module paths to Module instances.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Project.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.project.Project.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"modules": {
|
||||||
|
"name": "modules",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Project.modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('modules', 'docforge.models.project.Project.modules')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_module": {
|
||||||
|
"name": "add_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Project.add_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
|
||||||
|
"docstring": "Add a module to the project.\n\nArgs:\n module: The module to add."
|
||||||
|
},
|
||||||
|
"get_module": {
|
||||||
|
"name": "get_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Project.get_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.Project.get_module')>",
|
||||||
|
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: The dotted path of the module (e.g., 'pkg.mod').\n\nReturns:\n The requested Module."
|
||||||
|
},
|
||||||
|
"get_all_modules": {
|
||||||
|
"name": "get_all_modules",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Project.get_all_modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
|
||||||
|
"docstring": "Get all modules in the project.\n\nReturns:\n An iterable of Module objects."
|
||||||
|
},
|
||||||
|
"get_module_list": {
|
||||||
|
"name": "get_module_list",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Project.get_module_list",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
|
||||||
|
"docstring": "Get the list of all module dotted paths.\n\nReturns:\n A list of module paths."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"DocObject": {
|
||||||
|
"name": "DocObject",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.DocObject')>",
|
||||||
|
"docstring": "Represents a documented Python object (class, function, method, etc.).\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (e.g., 'class', 'function', 'attribute').\n path: Full dotted import path to the object.\n signature: Callable signature, if applicable.\n docstring: Raw docstring content extracted from the source.\n members: Dictionary mapping member names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.object.DocObject.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"kind": {
|
||||||
|
"name": "kind",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.kind",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('kind', 'docforge.models.object.DocObject.kind')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.object.DocObject.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"signature": {
|
||||||
|
"name": "signature",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.signature",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('signature', 'docforge.models.object.DocObject.signature')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.object.DocObject.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.object.DocObject.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_member": {
|
||||||
|
"name": "add_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.add_member",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_member', 'docforge.models.object.DocObject.add_member')>",
|
||||||
|
"docstring": "Add a child member to this object (e.g., a method to a class).\n\nArgs:\n obj: The child DocObject to add."
|
||||||
|
},
|
||||||
|
"get_member": {
|
||||||
|
"name": "get_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.get_member",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
|
||||||
|
"docstring": "Retrieve a child member by name.\n\nArgs:\n name: The name of the member.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_members": {
|
||||||
|
"name": "get_all_members",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.get_all_members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
|
||||||
|
"docstring": "Get all members of this object.\n\nReturns:\n An iterable of child DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"logger": {
|
||||||
|
"name": "logger",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.logger",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"discover_module_paths": {
|
||||||
|
"name": "discover_module_paths",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.discover_module_paths",
|
||||||
|
"signature": "<bound method Function.signature of Function('discover_module_paths', 23, 62)>",
|
||||||
|
"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."
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.loaders.griffe_loader.GriffeLoader",
|
||||||
|
"signature": "<bound method Class.signature of Class('GriffeLoader', 65, 224)>",
|
||||||
|
"docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.",
|
||||||
|
"members": {
|
||||||
|
"load_project": {
|
||||||
|
"name": "load_project",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.GriffeLoader.load_project",
|
||||||
|
"signature": "<bound method Function.signature of Function('load_project', 79, 115)>",
|
||||||
|
"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.loaders.griffe_loader.GriffeLoader.load_module",
|
||||||
|
"signature": "<bound method Function.signature of Function('load_module', 117, 130)>",
|
||||||
|
"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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
315
mcp_docs/modules/docforge.loaders.json
Normal file
315
mcp_docs/modules/docforge.loaders.json
Normal file
@@ -0,0 +1,315 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.loaders",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.loaders",
|
||||||
|
"docstring": "# Loader Layer\n\nThe `docforge.loaders` package is responsible for discovering Python source files\nand extracting their documentation using static analysis.\n\n## Core Features\n\n- **Discovery**: Automatically find all modules and packages in a project\n directory.\n- **Introspection**: Uses `griffe` to parse docstrings, signatures, and\n hierarchical relationships without executing the code.\n- **Filtering**: Automatically excludes private members (prefixed with `_`) to\n ensure clean public documentation.",
|
||||||
|
"objects": {
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.loaders.GriffeLoader",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.griffe_loader.GriffeLoader')>",
|
||||||
|
"docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.",
|
||||||
|
"members": {
|
||||||
|
"load_project": {
|
||||||
|
"name": "load_project",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.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.loaders.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.loaders.discover_module_paths",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.griffe_loader.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."
|
||||||
|
},
|
||||||
|
"griffe_loader": {
|
||||||
|
"name": "griffe_loader",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.loaders.griffe_loader",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": "This module provides the GriffeLoader, which uses the 'griffe' library to\nintrospect Python source code and populate the doc-forge Project models.",
|
||||||
|
"members": {
|
||||||
|
"logging": {
|
||||||
|
"name": "logging",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.logging",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('logging', 'logging')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"List": {
|
||||||
|
"name": "List",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.List",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('List', 'typing.List')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Optional": {
|
||||||
|
"name": "Optional",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Optional",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"ModulesCollection": {
|
||||||
|
"name": "ModulesCollection",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.ModulesCollection",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('ModulesCollection', 'griffe.ModulesCollection')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"LinesCollection": {
|
||||||
|
"name": "LinesCollection",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.LinesCollection",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('LinesCollection', 'griffe.LinesCollection')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Object": {
|
||||||
|
"name": "Object",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Object', 'griffe.Object')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"AliasResolutionError": {
|
||||||
|
"name": "AliasResolutionError",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.loaders.griffe_loader.AliasResolutionError",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('AliasResolutionError', 'griffe.AliasResolutionError')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Module": {
|
||||||
|
"name": "Module",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>",
|
||||||
|
"docstring": "Represents a documented Python module or package.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level docstring content.\n members: Dictionary mapping object names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Module.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.module.Module.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Module.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.module.Module.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Module.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.module.Module.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_object": {
|
||||||
|
"name": "add_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Module.add_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.Module.add_object')>",
|
||||||
|
"docstring": "Add a documented object to the module.\n\nArgs:\n obj: The object to add."
|
||||||
|
},
|
||||||
|
"get_object": {
|
||||||
|
"name": "get_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Module.get_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
|
||||||
|
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: The name of the object.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_objects": {
|
||||||
|
"name": "get_all_objects",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Module.get_all_objects",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
|
||||||
|
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Project": {
|
||||||
|
"name": "Project",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Project",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
|
||||||
|
"docstring": "Represents a documentation project, serving as a container for modules.\n\nAttributes:\n name: Name of the project.\n modules: Dictionary mapping module paths to Module instances.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Project.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.project.Project.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"modules": {
|
||||||
|
"name": "modules",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Project.modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('modules', 'docforge.models.project.Project.modules')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_module": {
|
||||||
|
"name": "add_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Project.add_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
|
||||||
|
"docstring": "Add a module to the project.\n\nArgs:\n module: The module to add."
|
||||||
|
},
|
||||||
|
"get_module": {
|
||||||
|
"name": "get_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Project.get_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.Project.get_module')>",
|
||||||
|
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: The dotted path of the module (e.g., 'pkg.mod').\n\nReturns:\n The requested Module."
|
||||||
|
},
|
||||||
|
"get_all_modules": {
|
||||||
|
"name": "get_all_modules",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Project.get_all_modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
|
||||||
|
"docstring": "Get all modules in the project.\n\nReturns:\n An iterable of Module objects."
|
||||||
|
},
|
||||||
|
"get_module_list": {
|
||||||
|
"name": "get_module_list",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.Project.get_module_list",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
|
||||||
|
"docstring": "Get the list of all module dotted paths.\n\nReturns:\n A list of module paths."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"DocObject": {
|
||||||
|
"name": "DocObject",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.DocObject')>",
|
||||||
|
"docstring": "Represents a documented Python object (class, function, method, etc.).\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (e.g., 'class', 'function', 'attribute').\n path: Full dotted import path to the object.\n signature: Callable signature, if applicable.\n docstring: Raw docstring content extracted from the source.\n members: Dictionary mapping member names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.object.DocObject.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"kind": {
|
||||||
|
"name": "kind",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.kind",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('kind', 'docforge.models.object.DocObject.kind')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.object.DocObject.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"signature": {
|
||||||
|
"name": "signature",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.signature",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('signature', 'docforge.models.object.DocObject.signature')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.object.DocObject.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.object.DocObject.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_member": {
|
||||||
|
"name": "add_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.add_member",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_member', 'docforge.models.object.DocObject.add_member')>",
|
||||||
|
"docstring": "Add a child member to this object (e.g., a method to a class).\n\nArgs:\n obj: The child DocObject to add."
|
||||||
|
},
|
||||||
|
"get_member": {
|
||||||
|
"name": "get_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.get_member",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
|
||||||
|
"docstring": "Retrieve a child member by name.\n\nArgs:\n name: The name of the member.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_members": {
|
||||||
|
"name": "get_all_members",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.DocObject.get_all_members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
|
||||||
|
"docstring": "Get all members of this object.\n\nReturns:\n An iterable of child DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"logger": {
|
||||||
|
"name": "logger",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.loaders.griffe_loader.logger",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"discover_module_paths": {
|
||||||
|
"name": "discover_module_paths",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.discover_module_paths",
|
||||||
|
"signature": "<bound method Function.signature of Function('discover_module_paths', 23, 62)>",
|
||||||
|
"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."
|
||||||
|
},
|
||||||
|
"GriffeLoader": {
|
||||||
|
"name": "GriffeLoader",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.loaders.griffe_loader.GriffeLoader",
|
||||||
|
"signature": "<bound method Class.signature of Class('GriffeLoader', 65, 224)>",
|
||||||
|
"docstring": "Loads Python modules and extracts documentation using the Griffe introspection engine.",
|
||||||
|
"members": {
|
||||||
|
"load_project": {
|
||||||
|
"name": "load_project",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.loaders.griffe_loader.GriffeLoader.load_project",
|
||||||
|
"signature": "<bound method Function.signature of Function('load_project', 79, 115)>",
|
||||||
|
"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.loaders.griffe_loader.GriffeLoader.load_module",
|
||||||
|
"signature": "<bound method Function.signature of Function('load_module', 117, 130)>",
|
||||||
|
"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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
563
mcp_docs/modules/docforge.models.json
Normal file
563
mcp_docs/modules/docforge.models.json
Normal file
@@ -0,0 +1,563 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.models",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.models",
|
||||||
|
"docstring": "# Model Layer\n\nThe `docforge.models` package provides the core data structures used to represent\nPython source code in a documentation-focused hierarchy.\n\n## Key Components\n\n- **Project**: The root container for all documented modules.\n- **Module**: Represents a Python module or package, containing members.\n- **DocObject**: A recursive structure for classes, functions, and attributes.\n\nThese classes are designed to be renderer-agnostic, allowing the same internal\nrepresentation to be transformed into various output formats (currently MkDocs).",
|
||||||
|
"objects": {
|
||||||
|
"Project": {
|
||||||
|
"name": "Project",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.models.Project",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.project.Project')>",
|
||||||
|
"docstring": "Represents a documentation project, serving as a container for modules.\n\nAttributes:\n name: Name of the project.\n modules: Dictionary mapping module paths to Module instances.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.Project.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.project.Project.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"modules": {
|
||||||
|
"name": "modules",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.Project.modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('modules', 'docforge.models.project.Project.modules')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_module": {
|
||||||
|
"name": "add_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.Project.add_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
|
||||||
|
"docstring": "Add a module to the project.\n\nArgs:\n module: The module to add."
|
||||||
|
},
|
||||||
|
"get_module": {
|
||||||
|
"name": "get_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.Project.get_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.Project.get_module')>",
|
||||||
|
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: The dotted path of the module (e.g., 'pkg.mod').\n\nReturns:\n The requested Module."
|
||||||
|
},
|
||||||
|
"get_all_modules": {
|
||||||
|
"name": "get_all_modules",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.Project.get_all_modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
|
||||||
|
"docstring": "Get all modules in the project.\n\nReturns:\n An iterable of Module objects."
|
||||||
|
},
|
||||||
|
"get_module_list": {
|
||||||
|
"name": "get_module_list",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.Project.get_module_list",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
|
||||||
|
"docstring": "Get the list of all module dotted paths.\n\nReturns:\n A list of module paths."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Module": {
|
||||||
|
"name": "Module",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.models.Module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.module.Module')>",
|
||||||
|
"docstring": "Represents a documented Python module or package.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level docstring content.\n members: Dictionary mapping object names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.Module.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.module.Module.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.Module.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.module.Module.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.Module.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.module.Module.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_object": {
|
||||||
|
"name": "add_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.Module.add_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.Module.add_object')>",
|
||||||
|
"docstring": "Add a documented object to the module.\n\nArgs:\n obj: The object to add."
|
||||||
|
},
|
||||||
|
"get_object": {
|
||||||
|
"name": "get_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.Module.get_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
|
||||||
|
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: The name of the object.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_objects": {
|
||||||
|
"name": "get_all_objects",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.Module.get_all_objects",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
|
||||||
|
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"DocObject": {
|
||||||
|
"name": "DocObject",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.models.DocObject",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.object.DocObject')>",
|
||||||
|
"docstring": "Represents a documented Python object (class, function, method, etc.).\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (e.g., 'class', 'function', 'attribute').\n path: Full dotted import path to the object.\n signature: Callable signature, if applicable.\n docstring: Raw docstring content extracted from the source.\n members: Dictionary mapping member names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.DocObject.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.object.DocObject.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"kind": {
|
||||||
|
"name": "kind",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.DocObject.kind",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('kind', 'docforge.models.object.DocObject.kind')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.DocObject.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.object.DocObject.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"signature": {
|
||||||
|
"name": "signature",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.DocObject.signature",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('signature', 'docforge.models.object.DocObject.signature')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.DocObject.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.object.DocObject.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.DocObject.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.object.DocObject.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_member": {
|
||||||
|
"name": "add_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.DocObject.add_member",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_member', 'docforge.models.object.DocObject.add_member')>",
|
||||||
|
"docstring": "Add a child member to this object (e.g., a method to a class).\n\nArgs:\n obj: The child DocObject to add."
|
||||||
|
},
|
||||||
|
"get_member": {
|
||||||
|
"name": "get_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.DocObject.get_member",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
|
||||||
|
"docstring": "Retrieve a child member by name.\n\nArgs:\n name: The name of the member.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_members": {
|
||||||
|
"name": "get_all_members",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.DocObject.get_all_members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
|
||||||
|
"docstring": "Get all members of this object.\n\nReturns:\n An iterable of child DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"module": {
|
||||||
|
"name": "module",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.models.module",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": "This module defines the Module class, which represents a Python module or package\nin the doc-forge documentation models. It acts as a container for top-level\ndocumented objects.",
|
||||||
|
"members": {
|
||||||
|
"Dict": {
|
||||||
|
"name": "Dict",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.module.Dict",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Iterable": {
|
||||||
|
"name": "Iterable",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.module.Iterable",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Iterable', 'typing.Iterable')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Optional": {
|
||||||
|
"name": "Optional",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.module.Optional",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"DocObject": {
|
||||||
|
"name": "DocObject",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.models.module.DocObject",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.object.DocObject')>",
|
||||||
|
"docstring": "Represents a documented Python object (class, function, method, etc.).\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (e.g., 'class', 'function', 'attribute').\n path: Full dotted import path to the object.\n signature: Callable signature, if applicable.\n docstring: Raw docstring content extracted from the source.\n members: Dictionary mapping member names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.DocObject.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.object.DocObject.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"kind": {
|
||||||
|
"name": "kind",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.DocObject.kind",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('kind', 'docforge.models.object.DocObject.kind')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.DocObject.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.object.DocObject.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"signature": {
|
||||||
|
"name": "signature",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.DocObject.signature",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('signature', 'docforge.models.object.DocObject.signature')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.DocObject.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.object.DocObject.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.DocObject.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.object.DocObject.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_member": {
|
||||||
|
"name": "add_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.module.DocObject.add_member",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_member', 'docforge.models.object.DocObject.add_member')>",
|
||||||
|
"docstring": "Add a child member to this object (e.g., a method to a class).\n\nArgs:\n obj: The child DocObject to add."
|
||||||
|
},
|
||||||
|
"get_member": {
|
||||||
|
"name": "get_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.module.DocObject.get_member",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
|
||||||
|
"docstring": "Retrieve a child member by name.\n\nArgs:\n name: The name of the member.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_members": {
|
||||||
|
"name": "get_all_members",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.module.DocObject.get_all_members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
|
||||||
|
"docstring": "Get all members of this object.\n\nReturns:\n An iterable of child DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Module": {
|
||||||
|
"name": "Module",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.models.module.Module",
|
||||||
|
"signature": "<bound method Class.signature of Class('Module', 12, 66)>",
|
||||||
|
"docstring": "Represents a documented Python module or package.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level docstring content.\n members: Dictionary mapping object names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.Module.path",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.Module.docstring",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.Module.members",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_object": {
|
||||||
|
"name": "add_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.module.Module.add_object",
|
||||||
|
"signature": "<bound method Function.signature of Function('add_object', 38, 45)>",
|
||||||
|
"docstring": "Add a documented object to the module.\n\nArgs:\n obj: The object to add."
|
||||||
|
},
|
||||||
|
"get_object": {
|
||||||
|
"name": "get_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.module.Module.get_object",
|
||||||
|
"signature": "<bound method Function.signature of Function('get_object', 47, 57)>",
|
||||||
|
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: The name of the object.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_objects": {
|
||||||
|
"name": "get_all_objects",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.module.Module.get_all_objects",
|
||||||
|
"signature": "<bound method Function.signature of Function('get_all_objects', 59, 66)>",
|
||||||
|
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"object": {
|
||||||
|
"name": "object",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.models.object",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": "This module defines the DocObject class, the fundamental recursive unit of the\ndoc-forge documentation models. A DocObject represents a single Python entity\n(class, function, method, or attribute) and its nested members.",
|
||||||
|
"members": {
|
||||||
|
"Dict": {
|
||||||
|
"name": "Dict",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.object.Dict",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Iterable": {
|
||||||
|
"name": "Iterable",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.object.Iterable",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Iterable', 'typing.Iterable')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Optional": {
|
||||||
|
"name": "Optional",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.object.Optional",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"DocObject": {
|
||||||
|
"name": "DocObject",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.models.object.DocObject",
|
||||||
|
"signature": "<bound method Class.signature of Class('DocObject', 10, 76)>",
|
||||||
|
"docstring": "Represents a documented Python object (class, function, method, etc.).\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (e.g., 'class', 'function', 'attribute').\n path: Full dotted import path to the object.\n signature: Callable signature, if applicable.\n docstring: Raw docstring content extracted from the source.\n members: Dictionary mapping member names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.object.DocObject.name",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"kind": {
|
||||||
|
"name": "kind",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.object.DocObject.kind",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.object.DocObject.path",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"signature": {
|
||||||
|
"name": "signature",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.object.DocObject.signature",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.object.DocObject.docstring",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.object.DocObject.members",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_member": {
|
||||||
|
"name": "add_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.object.DocObject.add_member",
|
||||||
|
"signature": "<bound method Function.signature of Function('add_member', 48, 55)>",
|
||||||
|
"docstring": "Add a child member to this object (e.g., a method to a class).\n\nArgs:\n obj: The child DocObject to add."
|
||||||
|
},
|
||||||
|
"get_member": {
|
||||||
|
"name": "get_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.object.DocObject.get_member",
|
||||||
|
"signature": "<bound method Function.signature of Function('get_member', 57, 67)>",
|
||||||
|
"docstring": "Retrieve a child member by name.\n\nArgs:\n name: The name of the member.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_members": {
|
||||||
|
"name": "get_all_members",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.object.DocObject.get_all_members",
|
||||||
|
"signature": "<bound method Function.signature of Function('get_all_members', 69, 76)>",
|
||||||
|
"docstring": "Get all members of this object.\n\nReturns:\n An iterable of child DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"project": {
|
||||||
|
"name": "project",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.models.project",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": "This module defines the Project class, the top-level container for a documented\nproject. It aggregates multiple Module instances into a single named entity.",
|
||||||
|
"members": {
|
||||||
|
"Dict": {
|
||||||
|
"name": "Dict",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.project.Dict",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Iterable": {
|
||||||
|
"name": "Iterable",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.project.Iterable",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Iterable', 'typing.Iterable')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Module": {
|
||||||
|
"name": "Module",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.models.project.Module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.module.Module')>",
|
||||||
|
"docstring": "Represents a documented Python module or package.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level docstring content.\n members: Dictionary mapping object names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.project.Module.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.module.Module.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.project.Module.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.module.Module.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.project.Module.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.module.Module.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_object": {
|
||||||
|
"name": "add_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.project.Module.add_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.Module.add_object')>",
|
||||||
|
"docstring": "Add a documented object to the module.\n\nArgs:\n obj: The object to add."
|
||||||
|
},
|
||||||
|
"get_object": {
|
||||||
|
"name": "get_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.project.Module.get_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
|
||||||
|
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: The name of the object.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_objects": {
|
||||||
|
"name": "get_all_objects",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.project.Module.get_all_objects",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
|
||||||
|
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Project": {
|
||||||
|
"name": "Project",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.models.project.Project",
|
||||||
|
"signature": "<bound method Class.signature of Class('Project', 11, 67)>",
|
||||||
|
"docstring": "Represents a documentation project, serving as a container for modules.\n\nAttributes:\n name: Name of the project.\n modules: Dictionary mapping module paths to Module instances.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.project.Project.name",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"modules": {
|
||||||
|
"name": "modules",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.project.Project.modules",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_module": {
|
||||||
|
"name": "add_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.project.Project.add_module",
|
||||||
|
"signature": "<bound method Function.signature of Function('add_module', 30, 37)>",
|
||||||
|
"docstring": "Add a module to the project.\n\nArgs:\n module: The module to add."
|
||||||
|
},
|
||||||
|
"get_module": {
|
||||||
|
"name": "get_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.project.Project.get_module",
|
||||||
|
"signature": "<bound method Function.signature of Function('get_module', 39, 49)>",
|
||||||
|
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: The dotted path of the module (e.g., 'pkg.mod').\n\nReturns:\n The requested Module."
|
||||||
|
},
|
||||||
|
"get_all_modules": {
|
||||||
|
"name": "get_all_modules",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.project.Project.get_all_modules",
|
||||||
|
"signature": "<bound method Function.signature of Function('get_all_modules', 51, 58)>",
|
||||||
|
"docstring": "Get all modules in the project.\n\nReturns:\n An iterable of Module objects."
|
||||||
|
},
|
||||||
|
"get_module_list": {
|
||||||
|
"name": "get_module_list",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.project.Project.get_module_list",
|
||||||
|
"signature": "<bound method Function.signature of Function('get_module_list', 60, 67)>",
|
||||||
|
"docstring": "Get the list of all module dotted paths.\n\nReturns:\n A list of module paths."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
153
mcp_docs/modules/docforge.models.module.json
Normal file
153
mcp_docs/modules/docforge.models.module.json
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.models.module",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.models.module",
|
||||||
|
"docstring": "This module defines the Module class, which represents a Python module or package\nin the doc-forge documentation models. It acts as a container for top-level\ndocumented objects.",
|
||||||
|
"objects": {
|
||||||
|
"Dict": {
|
||||||
|
"name": "Dict",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.module.Dict",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Iterable": {
|
||||||
|
"name": "Iterable",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.module.Iterable",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Iterable', 'typing.Iterable')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Optional": {
|
||||||
|
"name": "Optional",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.module.Optional",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"DocObject": {
|
||||||
|
"name": "DocObject",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.models.module.DocObject",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.object.DocObject')>",
|
||||||
|
"docstring": "Represents a documented Python object (class, function, method, etc.).\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (e.g., 'class', 'function', 'attribute').\n path: Full dotted import path to the object.\n signature: Callable signature, if applicable.\n docstring: Raw docstring content extracted from the source.\n members: Dictionary mapping member names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.DocObject.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.object.DocObject.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"kind": {
|
||||||
|
"name": "kind",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.DocObject.kind",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('kind', 'docforge.models.object.DocObject.kind')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.DocObject.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.object.DocObject.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"signature": {
|
||||||
|
"name": "signature",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.DocObject.signature",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('signature', 'docforge.models.object.DocObject.signature')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.DocObject.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.object.DocObject.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.DocObject.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.object.DocObject.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_member": {
|
||||||
|
"name": "add_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.module.DocObject.add_member",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_member', 'docforge.models.object.DocObject.add_member')>",
|
||||||
|
"docstring": "Add a child member to this object (e.g., a method to a class).\n\nArgs:\n obj: The child DocObject to add."
|
||||||
|
},
|
||||||
|
"get_member": {
|
||||||
|
"name": "get_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.module.DocObject.get_member",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
|
||||||
|
"docstring": "Retrieve a child member by name.\n\nArgs:\n name: The name of the member.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_members": {
|
||||||
|
"name": "get_all_members",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.module.DocObject.get_all_members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
|
||||||
|
"docstring": "Get all members of this object.\n\nReturns:\n An iterable of child DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Module": {
|
||||||
|
"name": "Module",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.models.module.Module",
|
||||||
|
"signature": "<bound method Class.signature of Class('Module', 12, 66)>",
|
||||||
|
"docstring": "Represents a documented Python module or package.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level docstring content.\n members: Dictionary mapping object names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.Module.path",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.Module.docstring",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.module.Module.members",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_object": {
|
||||||
|
"name": "add_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.module.Module.add_object",
|
||||||
|
"signature": "<bound method Function.signature of Function('add_object', 38, 45)>",
|
||||||
|
"docstring": "Add a documented object to the module.\n\nArgs:\n obj: The object to add."
|
||||||
|
},
|
||||||
|
"get_object": {
|
||||||
|
"name": "get_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.module.Module.get_object",
|
||||||
|
"signature": "<bound method Function.signature of Function('get_object', 47, 57)>",
|
||||||
|
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: The name of the object.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_objects": {
|
||||||
|
"name": "get_all_objects",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.module.Module.get_all_objects",
|
||||||
|
"signature": "<bound method Function.signature of Function('get_all_objects', 59, 66)>",
|
||||||
|
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
102
mcp_docs/modules/docforge.models.object.json
Normal file
102
mcp_docs/modules/docforge.models.object.json
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.models.object",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.models.object",
|
||||||
|
"docstring": "This module defines the DocObject class, the fundamental recursive unit of the\ndoc-forge documentation models. A DocObject represents a single Python entity\n(class, function, method, or attribute) and its nested members.",
|
||||||
|
"objects": {
|
||||||
|
"Dict": {
|
||||||
|
"name": "Dict",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.object.Dict",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Iterable": {
|
||||||
|
"name": "Iterable",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.object.Iterable",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Iterable', 'typing.Iterable')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Optional": {
|
||||||
|
"name": "Optional",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.object.Optional",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"DocObject": {
|
||||||
|
"name": "DocObject",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.models.object.DocObject",
|
||||||
|
"signature": "<bound method Class.signature of Class('DocObject', 10, 76)>",
|
||||||
|
"docstring": "Represents a documented Python object (class, function, method, etc.).\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (e.g., 'class', 'function', 'attribute').\n path: Full dotted import path to the object.\n signature: Callable signature, if applicable.\n docstring: Raw docstring content extracted from the source.\n members: Dictionary mapping member names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.object.DocObject.name",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"kind": {
|
||||||
|
"name": "kind",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.object.DocObject.kind",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.object.DocObject.path",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"signature": {
|
||||||
|
"name": "signature",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.object.DocObject.signature",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.object.DocObject.docstring",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.object.DocObject.members",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_member": {
|
||||||
|
"name": "add_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.object.DocObject.add_member",
|
||||||
|
"signature": "<bound method Function.signature of Function('add_member', 48, 55)>",
|
||||||
|
"docstring": "Add a child member to this object (e.g., a method to a class).\n\nArgs:\n obj: The child DocObject to add."
|
||||||
|
},
|
||||||
|
"get_member": {
|
||||||
|
"name": "get_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.object.DocObject.get_member",
|
||||||
|
"signature": "<bound method Function.signature of Function('get_member', 57, 67)>",
|
||||||
|
"docstring": "Retrieve a child member by name.\n\nArgs:\n name: The name of the member.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_members": {
|
||||||
|
"name": "get_all_members",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.object.DocObject.get_all_members",
|
||||||
|
"signature": "<bound method Function.signature of Function('get_all_members', 69, 76)>",
|
||||||
|
"docstring": "Get all members of this object.\n\nReturns:\n An iterable of child DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
125
mcp_docs/modules/docforge.models.project.json
Normal file
125
mcp_docs/modules/docforge.models.project.json
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.models.project",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.models.project",
|
||||||
|
"docstring": "This module defines the Project class, the top-level container for a documented\nproject. It aggregates multiple Module instances into a single named entity.",
|
||||||
|
"objects": {
|
||||||
|
"Dict": {
|
||||||
|
"name": "Dict",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.project.Dict",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Iterable": {
|
||||||
|
"name": "Iterable",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.models.project.Iterable",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Iterable', 'typing.Iterable')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Module": {
|
||||||
|
"name": "Module",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.models.project.Module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.module.Module')>",
|
||||||
|
"docstring": "Represents a documented Python module or package.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level docstring content.\n members: Dictionary mapping object names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.project.Module.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.module.Module.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.project.Module.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.module.Module.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.project.Module.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.module.Module.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_object": {
|
||||||
|
"name": "add_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.project.Module.add_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.Module.add_object')>",
|
||||||
|
"docstring": "Add a documented object to the module.\n\nArgs:\n obj: The object to add."
|
||||||
|
},
|
||||||
|
"get_object": {
|
||||||
|
"name": "get_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.project.Module.get_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
|
||||||
|
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: The name of the object.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_objects": {
|
||||||
|
"name": "get_all_objects",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.project.Module.get_all_objects",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
|
||||||
|
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Project": {
|
||||||
|
"name": "Project",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.models.project.Project",
|
||||||
|
"signature": "<bound method Class.signature of Class('Project', 11, 67)>",
|
||||||
|
"docstring": "Represents a documentation project, serving as a container for modules.\n\nAttributes:\n name: Name of the project.\n modules: Dictionary mapping module paths to Module instances.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.project.Project.name",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"modules": {
|
||||||
|
"name": "modules",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.models.project.Project.modules",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_module": {
|
||||||
|
"name": "add_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.project.Project.add_module",
|
||||||
|
"signature": "<bound method Function.signature of Function('add_module', 30, 37)>",
|
||||||
|
"docstring": "Add a module to the project.\n\nArgs:\n module: The module to add."
|
||||||
|
},
|
||||||
|
"get_module": {
|
||||||
|
"name": "get_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.project.Project.get_module",
|
||||||
|
"signature": "<bound method Function.signature of Function('get_module', 39, 49)>",
|
||||||
|
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: The dotted path of the module (e.g., 'pkg.mod').\n\nReturns:\n The requested Module."
|
||||||
|
},
|
||||||
|
"get_all_modules": {
|
||||||
|
"name": "get_all_modules",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.project.Project.get_all_modules",
|
||||||
|
"signature": "<bound method Function.signature of Function('get_all_modules', 51, 58)>",
|
||||||
|
"docstring": "Get all modules in the project.\n\nReturns:\n An iterable of Module objects."
|
||||||
|
},
|
||||||
|
"get_module_list": {
|
||||||
|
"name": "get_module_list",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.models.project.Project.get_module_list",
|
||||||
|
"signature": "<bound method Function.signature of Function('get_module_list', 60, 67)>",
|
||||||
|
"docstring": "Get the list of all module dotted paths.\n\nReturns:\n A list of module paths."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
402
mcp_docs/modules/docforge.nav.json
Normal file
402
mcp_docs/modules/docforge.nav.json
Normal file
@@ -0,0 +1,402 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.nav",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.nav",
|
||||||
|
"docstring": "# Navigation Layer\n\nThe `docforge.nav` package manages the mapping between the logical documentation\nstructure and the physical files on disk.\n\n## Workflow\n\n1. **Spec Definition**: Users define navigation intent in `docforge.nav.yml`.\n2. **Resolution**: `resolve_nav` matches patterns in the spec to generated `.md` files.\n3. **Emission**: `MkDocsNavEmitter` produces the final YAML structure for `mkdocs.yml`.\n\nThis abstraction allows doc-forge to support complex grouping and ordering\nindependently of the source code's physical layout.",
|
||||||
|
"objects": {
|
||||||
|
"NavSpec": {
|
||||||
|
"name": "NavSpec",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.nav.NavSpec",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('NavSpec', 'docforge.nav.spec.NavSpec')>",
|
||||||
|
"docstring": "Parsed representation of the docforge navigation specification file.\n\nAttributes:\n home: Path to the home document (e.g., 'index.md').\n groups: Mapping of group titles to lists of path patterns/globs.",
|
||||||
|
"members": {
|
||||||
|
"home": {
|
||||||
|
"name": "home",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.NavSpec.home",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('home', 'docforge.nav.spec.NavSpec.home')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"groups": {
|
||||||
|
"name": "groups",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.NavSpec.groups",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('groups', 'docforge.nav.spec.NavSpec.groups')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"load": {
|
||||||
|
"name": "load",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.NavSpec.load",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('load', 'docforge.nav.spec.NavSpec.load')>",
|
||||||
|
"docstring": "Load a NavSpec from a YAML file.\n\nArgs:\n path: The filesystem path to the YAML file.\n\nReturns:\n A NavSpec instance.\n\nRaises:\n FileNotFoundError: If the path does not exist.\n ValueError: If the file content is not a valid NavSpec mapping."
|
||||||
|
},
|
||||||
|
"all_patterns": {
|
||||||
|
"name": "all_patterns",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.NavSpec.all_patterns",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('all_patterns', 'docforge.nav.spec.NavSpec.all_patterns')>",
|
||||||
|
"docstring": "Get all path patterns referenced in the specification.\n\nReturns:\n A list of all patterns (home plus all groups)."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"load_nav_spec": {
|
||||||
|
"name": "load_nav_spec",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.load_nav_spec",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('load_nav_spec', 'docforge.nav.spec.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."
|
||||||
|
},
|
||||||
|
"ResolvedNav": {
|
||||||
|
"name": "ResolvedNav",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.nav.ResolvedNav",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('ResolvedNav', 'docforge.nav.resolver.ResolvedNav')>",
|
||||||
|
"docstring": "Represents a navigation structure where all patterns and paths have been\nresolved against the actual filesystem contents.\n\nAttributes:\n home: Resolved relative path to the home page.\n groups: Mapping of group titles to lists of absolute or relative Path objects.",
|
||||||
|
"members": {
|
||||||
|
"home": {
|
||||||
|
"name": "home",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.ResolvedNav.home",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('home', 'docforge.nav.resolver.ResolvedNav.home')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"groups": {
|
||||||
|
"name": "groups",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.ResolvedNav.groups",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('groups', 'docforge.nav.resolver.ResolvedNav.groups')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"all_files": {
|
||||||
|
"name": "all_files",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.ResolvedNav.all_files",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('all_files', 'docforge.nav.resolver.ResolvedNav.all_files')>",
|
||||||
|
"docstring": "Get an iterable of all resolved files in the navigation structure.\n\nReturns:\n An iterable of Path objects."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resolve_nav": {
|
||||||
|
"name": "resolve_nav",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.resolve_nav",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('resolve_nav', 'docforge.nav.resolver.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.nav.MkDocsNavEmitter",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MkDocsNavEmitter', 'docforge.nav.mkdocs.MkDocsNavEmitter')>",
|
||||||
|
"docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.",
|
||||||
|
"members": {
|
||||||
|
"emit": {
|
||||||
|
"name": "emit",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mkdocs": {
|
||||||
|
"name": "mkdocs",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.nav.mkdocs",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": "This module provides the MkDocsNavEmitter, which converts a ResolvedNav instance\ninto the specific YAML-ready list structure expected by the MkDocs 'nav'\nconfiguration.",
|
||||||
|
"members": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.mkdocs.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"List": {
|
||||||
|
"name": "List",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.mkdocs.List",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('List', 'typing.List')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Dict": {
|
||||||
|
"name": "Dict",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.mkdocs.Dict",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Any": {
|
||||||
|
"name": "Any",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.mkdocs.Any",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Any', 'typing.Any')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"ResolvedNav": {
|
||||||
|
"name": "ResolvedNav",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.nav.mkdocs.ResolvedNav",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('ResolvedNav', 'docforge.nav.resolver.ResolvedNav')>",
|
||||||
|
"docstring": "Represents a navigation structure where all patterns and paths have been\nresolved against the actual filesystem contents.\n\nAttributes:\n home: Resolved relative path to the home page.\n groups: Mapping of group titles to lists of absolute or relative Path objects.",
|
||||||
|
"members": {
|
||||||
|
"home": {
|
||||||
|
"name": "home",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.mkdocs.ResolvedNav.home",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('home', 'docforge.nav.resolver.ResolvedNav.home')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"groups": {
|
||||||
|
"name": "groups",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.mkdocs.ResolvedNav.groups",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('groups', 'docforge.nav.resolver.ResolvedNav.groups')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"all_files": {
|
||||||
|
"name": "all_files",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.mkdocs.ResolvedNav.all_files",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('all_files', 'docforge.nav.resolver.ResolvedNav.all_files')>",
|
||||||
|
"docstring": "Get an iterable of all resolved files in the navigation structure.\n\nReturns:\n An iterable of Path objects."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MkDocsNavEmitter": {
|
||||||
|
"name": "MkDocsNavEmitter",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.nav.mkdocs.MkDocsNavEmitter",
|
||||||
|
"signature": "<bound method Class.signature of Class('MkDocsNavEmitter', 13, 72)>",
|
||||||
|
"docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.",
|
||||||
|
"members": {
|
||||||
|
"emit": {
|
||||||
|
"name": "emit",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.mkdocs.MkDocsNavEmitter.emit",
|
||||||
|
"signature": "<bound method Function.signature of Function('emit', 19, 44)>",
|
||||||
|
"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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resolver": {
|
||||||
|
"name": "resolver",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.nav.resolver",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": "This module contains the logic for resolving a NavSpec against the physical\nfilesystem. It expands globs and validates that all referenced documents\nactually exist on disk.",
|
||||||
|
"members": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.resolver.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Dict": {
|
||||||
|
"name": "Dict",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.resolver.Dict",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Iterable": {
|
||||||
|
"name": "Iterable",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.resolver.Iterable",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Iterable', 'typing.Iterable')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"List": {
|
||||||
|
"name": "List",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.resolver.List",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('List', 'typing.List')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"glob": {
|
||||||
|
"name": "glob",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.resolver.glob",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('glob', 'glob')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"NavSpec": {
|
||||||
|
"name": "NavSpec",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.nav.resolver.NavSpec",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('NavSpec', 'docforge.nav.spec.NavSpec')>",
|
||||||
|
"docstring": "Parsed representation of the docforge navigation specification file.\n\nAttributes:\n home: Path to the home document (e.g., 'index.md').\n groups: Mapping of group titles to lists of path patterns/globs.",
|
||||||
|
"members": {
|
||||||
|
"home": {
|
||||||
|
"name": "home",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.resolver.NavSpec.home",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('home', 'docforge.nav.spec.NavSpec.home')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"groups": {
|
||||||
|
"name": "groups",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.resolver.NavSpec.groups",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('groups', 'docforge.nav.spec.NavSpec.groups')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"load": {
|
||||||
|
"name": "load",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.resolver.NavSpec.load",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('load', 'docforge.nav.spec.NavSpec.load')>",
|
||||||
|
"docstring": "Load a NavSpec from a YAML file.\n\nArgs:\n path: The filesystem path to the YAML file.\n\nReturns:\n A NavSpec instance.\n\nRaises:\n FileNotFoundError: If the path does not exist.\n ValueError: If the file content is not a valid NavSpec mapping."
|
||||||
|
},
|
||||||
|
"all_patterns": {
|
||||||
|
"name": "all_patterns",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.resolver.NavSpec.all_patterns",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('all_patterns', 'docforge.nav.spec.NavSpec.all_patterns')>",
|
||||||
|
"docstring": "Get all path patterns referenced in the specification.\n\nReturns:\n A list of all patterns (home plus all groups)."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ResolvedNav": {
|
||||||
|
"name": "ResolvedNav",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.nav.resolver.ResolvedNav",
|
||||||
|
"signature": "<bound method Class.signature of Class('ResolvedNav', 15, 56)>",
|
||||||
|
"docstring": "Represents a navigation structure where all patterns and paths have been\nresolved against the actual filesystem contents.\n\nAttributes:\n home: Resolved relative path to the home page.\n groups: Mapping of group titles to lists of absolute or relative Path objects.",
|
||||||
|
"members": {
|
||||||
|
"home": {
|
||||||
|
"name": "home",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.resolver.ResolvedNav.home",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"groups": {
|
||||||
|
"name": "groups",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.resolver.ResolvedNav.groups",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"all_files": {
|
||||||
|
"name": "all_files",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.resolver.ResolvedNav.all_files",
|
||||||
|
"signature": "<bound method Function.signature of Function('all_files', 43, 56)>",
|
||||||
|
"docstring": "Get an iterable of all resolved files in the navigation structure.\n\nReturns:\n An iterable of Path objects."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resolve_nav": {
|
||||||
|
"name": "resolve_nav",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.resolver.resolve_nav",
|
||||||
|
"signature": "<bound method Function.signature of Function('resolve_nav', 59, 124)>",
|
||||||
|
"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."
|
||||||
|
},
|
||||||
|
"Optional": {
|
||||||
|
"name": "Optional",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.resolver.Optional",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||||||
|
"docstring": null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"name": "spec",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.nav.spec",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": "This module defines the NavSpec class, which represents the user's intent for\ndocumentation navigation as defined in a YAML specification (usually\ndocforge.nav.yml).",
|
||||||
|
"members": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.spec.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Dict": {
|
||||||
|
"name": "Dict",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.spec.Dict",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"List": {
|
||||||
|
"name": "List",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.spec.List",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('List', 'typing.List')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Optional": {
|
||||||
|
"name": "Optional",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.spec.Optional",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"yaml": {
|
||||||
|
"name": "yaml",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.spec.yaml",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('yaml', 'yaml')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"NavSpec": {
|
||||||
|
"name": "NavSpec",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.nav.spec.NavSpec",
|
||||||
|
"signature": "<bound method Class.signature of Class('NavSpec', 13, 91)>",
|
||||||
|
"docstring": "Parsed representation of the docforge navigation specification file.\n\nAttributes:\n home: Path to the home document (e.g., 'index.md').\n groups: Mapping of group titles to lists of path patterns/globs.",
|
||||||
|
"members": {
|
||||||
|
"home": {
|
||||||
|
"name": "home",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.spec.NavSpec.home",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"groups": {
|
||||||
|
"name": "groups",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.spec.NavSpec.groups",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"load": {
|
||||||
|
"name": "load",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.spec.NavSpec.load",
|
||||||
|
"signature": "<bound method Function.signature of Function('load', 37, 77)>",
|
||||||
|
"docstring": "Load a NavSpec from a YAML file.\n\nArgs:\n path: The filesystem path to the YAML file.\n\nReturns:\n A NavSpec instance.\n\nRaises:\n FileNotFoundError: If the path does not exist.\n ValueError: If the file content is not a valid NavSpec mapping."
|
||||||
|
},
|
||||||
|
"all_patterns": {
|
||||||
|
"name": "all_patterns",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.spec.NavSpec.all_patterns",
|
||||||
|
"signature": "<bound method Function.signature of Function('all_patterns', 79, 91)>",
|
||||||
|
"docstring": "Get all path patterns referenced in the specification.\n\nReturns:\n A list of all patterns (home plus all groups)."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"load_nav_spec": {
|
||||||
|
"name": "load_nav_spec",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.spec.load_nav_spec",
|
||||||
|
"signature": "<bound method Function.signature of Function('load_nav_spec', 94, 114)>",
|
||||||
|
"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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
83
mcp_docs/modules/docforge.nav.mkdocs.json
Normal file
83
mcp_docs/modules/docforge.nav.mkdocs.json
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.nav.mkdocs",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.nav.mkdocs",
|
||||||
|
"docstring": "This module provides the MkDocsNavEmitter, which converts a ResolvedNav instance\ninto the specific YAML-ready list structure expected by the MkDocs 'nav'\nconfiguration.",
|
||||||
|
"objects": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.mkdocs.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"List": {
|
||||||
|
"name": "List",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.mkdocs.List",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('List', 'typing.List')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Dict": {
|
||||||
|
"name": "Dict",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.mkdocs.Dict",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Any": {
|
||||||
|
"name": "Any",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.mkdocs.Any",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Any', 'typing.Any')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"ResolvedNav": {
|
||||||
|
"name": "ResolvedNav",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.nav.mkdocs.ResolvedNav",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('ResolvedNav', 'docforge.nav.resolver.ResolvedNav')>",
|
||||||
|
"docstring": "Represents a navigation structure where all patterns and paths have been\nresolved against the actual filesystem contents.\n\nAttributes:\n home: Resolved relative path to the home page.\n groups: Mapping of group titles to lists of absolute or relative Path objects.",
|
||||||
|
"members": {
|
||||||
|
"home": {
|
||||||
|
"name": "home",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.mkdocs.ResolvedNav.home",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('home', 'docforge.nav.resolver.ResolvedNav.home')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"groups": {
|
||||||
|
"name": "groups",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.mkdocs.ResolvedNav.groups",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('groups', 'docforge.nav.resolver.ResolvedNav.groups')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"all_files": {
|
||||||
|
"name": "all_files",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.mkdocs.ResolvedNav.all_files",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('all_files', 'docforge.nav.resolver.ResolvedNav.all_files')>",
|
||||||
|
"docstring": "Get an iterable of all resolved files in the navigation structure.\n\nReturns:\n An iterable of Path objects."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MkDocsNavEmitter": {
|
||||||
|
"name": "MkDocsNavEmitter",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.nav.mkdocs.MkDocsNavEmitter",
|
||||||
|
"signature": "<bound method Class.signature of Class('MkDocsNavEmitter', 13, 72)>",
|
||||||
|
"docstring": "Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible\nnavigation structure.",
|
||||||
|
"members": {
|
||||||
|
"emit": {
|
||||||
|
"name": "emit",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.mkdocs.MkDocsNavEmitter.emit",
|
||||||
|
"signature": "<bound method Function.signature of Function('emit', 19, 44)>",
|
||||||
|
"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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
125
mcp_docs/modules/docforge.nav.resolver.json
Normal file
125
mcp_docs/modules/docforge.nav.resolver.json
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.nav.resolver",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.nav.resolver",
|
||||||
|
"docstring": "This module contains the logic for resolving a NavSpec against the physical\nfilesystem. It expands globs and validates that all referenced documents\nactually exist on disk.",
|
||||||
|
"objects": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.resolver.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Dict": {
|
||||||
|
"name": "Dict",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.resolver.Dict",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Iterable": {
|
||||||
|
"name": "Iterable",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.resolver.Iterable",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Iterable', 'typing.Iterable')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"List": {
|
||||||
|
"name": "List",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.resolver.List",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('List', 'typing.List')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"glob": {
|
||||||
|
"name": "glob",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.resolver.glob",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('glob', 'glob')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"NavSpec": {
|
||||||
|
"name": "NavSpec",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.nav.resolver.NavSpec",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('NavSpec', 'docforge.nav.spec.NavSpec')>",
|
||||||
|
"docstring": "Parsed representation of the docforge navigation specification file.\n\nAttributes:\n home: Path to the home document (e.g., 'index.md').\n groups: Mapping of group titles to lists of path patterns/globs.",
|
||||||
|
"members": {
|
||||||
|
"home": {
|
||||||
|
"name": "home",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.resolver.NavSpec.home",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('home', 'docforge.nav.spec.NavSpec.home')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"groups": {
|
||||||
|
"name": "groups",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.resolver.NavSpec.groups",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('groups', 'docforge.nav.spec.NavSpec.groups')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"load": {
|
||||||
|
"name": "load",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.resolver.NavSpec.load",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('load', 'docforge.nav.spec.NavSpec.load')>",
|
||||||
|
"docstring": "Load a NavSpec from a YAML file.\n\nArgs:\n path: The filesystem path to the YAML file.\n\nReturns:\n A NavSpec instance.\n\nRaises:\n FileNotFoundError: If the path does not exist.\n ValueError: If the file content is not a valid NavSpec mapping."
|
||||||
|
},
|
||||||
|
"all_patterns": {
|
||||||
|
"name": "all_patterns",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.resolver.NavSpec.all_patterns",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('all_patterns', 'docforge.nav.spec.NavSpec.all_patterns')>",
|
||||||
|
"docstring": "Get all path patterns referenced in the specification.\n\nReturns:\n A list of all patterns (home plus all groups)."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ResolvedNav": {
|
||||||
|
"name": "ResolvedNav",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.nav.resolver.ResolvedNav",
|
||||||
|
"signature": "<bound method Class.signature of Class('ResolvedNav', 15, 56)>",
|
||||||
|
"docstring": "Represents a navigation structure where all patterns and paths have been\nresolved against the actual filesystem contents.\n\nAttributes:\n home: Resolved relative path to the home page.\n groups: Mapping of group titles to lists of absolute or relative Path objects.",
|
||||||
|
"members": {
|
||||||
|
"home": {
|
||||||
|
"name": "home",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.resolver.ResolvedNav.home",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"groups": {
|
||||||
|
"name": "groups",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.resolver.ResolvedNav.groups",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"all_files": {
|
||||||
|
"name": "all_files",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.resolver.ResolvedNav.all_files",
|
||||||
|
"signature": "<bound method Function.signature of Function('all_files', 43, 56)>",
|
||||||
|
"docstring": "Get an iterable of all resolved files in the navigation structure.\n\nReturns:\n An iterable of Path objects."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resolve_nav": {
|
||||||
|
"name": "resolve_nav",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.resolver.resolve_nav",
|
||||||
|
"signature": "<bound method Function.signature of Function('resolve_nav', 59, 124)>",
|
||||||
|
"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."
|
||||||
|
},
|
||||||
|
"Optional": {
|
||||||
|
"name": "Optional",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.resolver.Optional",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||||||
|
"docstring": null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
88
mcp_docs/modules/docforge.nav.spec.json
Normal file
88
mcp_docs/modules/docforge.nav.spec.json
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.nav.spec",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.nav.spec",
|
||||||
|
"docstring": "This module defines the NavSpec class, which represents the user's intent for\ndocumentation navigation as defined in a YAML specification (usually\ndocforge.nav.yml).",
|
||||||
|
"objects": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.spec.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Dict": {
|
||||||
|
"name": "Dict",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.spec.Dict",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"List": {
|
||||||
|
"name": "List",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.spec.List",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('List', 'typing.List')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Optional": {
|
||||||
|
"name": "Optional",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.spec.Optional",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"yaml": {
|
||||||
|
"name": "yaml",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.nav.spec.yaml",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('yaml', 'yaml')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"NavSpec": {
|
||||||
|
"name": "NavSpec",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.nav.spec.NavSpec",
|
||||||
|
"signature": "<bound method Class.signature of Class('NavSpec', 13, 91)>",
|
||||||
|
"docstring": "Parsed representation of the docforge navigation specification file.\n\nAttributes:\n home: Path to the home document (e.g., 'index.md').\n groups: Mapping of group titles to lists of path patterns/globs.",
|
||||||
|
"members": {
|
||||||
|
"home": {
|
||||||
|
"name": "home",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.spec.NavSpec.home",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"groups": {
|
||||||
|
"name": "groups",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.nav.spec.NavSpec.groups",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"load": {
|
||||||
|
"name": "load",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.spec.NavSpec.load",
|
||||||
|
"signature": "<bound method Function.signature of Function('load', 37, 77)>",
|
||||||
|
"docstring": "Load a NavSpec from a YAML file.\n\nArgs:\n path: The filesystem path to the YAML file.\n\nReturns:\n A NavSpec instance.\n\nRaises:\n FileNotFoundError: If the path does not exist.\n ValueError: If the file content is not a valid NavSpec mapping."
|
||||||
|
},
|
||||||
|
"all_patterns": {
|
||||||
|
"name": "all_patterns",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.spec.NavSpec.all_patterns",
|
||||||
|
"signature": "<bound method Function.signature of Function('all_patterns', 79, 91)>",
|
||||||
|
"docstring": "Get all path patterns referenced in the specification.\n\nReturns:\n A list of all patterns (home plus all groups)."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"load_nav_spec": {
|
||||||
|
"name": "load_nav_spec",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.nav.spec.load_nav_spec",
|
||||||
|
"signature": "<bound method Function.signature of Function('load_nav_spec', 94, 114)>",
|
||||||
|
"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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
mcp_docs/modules/docforge.renderers.base.json
Normal file
120
mcp_docs/modules/docforge.renderers.base.json
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.renderers.base",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.renderers.base",
|
||||||
|
"docstring": "This module defines the base interfaces and configuration containers for\ndoc-forge renderers. All renderer implementations should adhere to the\nDocRenderer protocol.",
|
||||||
|
"objects": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.base.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Protocol": {
|
||||||
|
"name": "Protocol",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.base.Protocol",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Protocol', 'typing.Protocol')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Project": {
|
||||||
|
"name": "Project",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.base.Project",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
|
||||||
|
"docstring": "Represents a documentation project, serving as a container for modules.\n\nAttributes:\n name: Name of the project.\n modules: Dictionary mapping module paths to Module instances.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.base.Project.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.project.Project.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"modules": {
|
||||||
|
"name": "modules",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.base.Project.modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('modules', 'docforge.models.project.Project.modules')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_module": {
|
||||||
|
"name": "add_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.base.Project.add_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
|
||||||
|
"docstring": "Add a module to the project.\n\nArgs:\n module: The module to add."
|
||||||
|
},
|
||||||
|
"get_module": {
|
||||||
|
"name": "get_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.base.Project.get_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.Project.get_module')>",
|
||||||
|
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: The dotted path of the module (e.g., 'pkg.mod').\n\nReturns:\n The requested Module."
|
||||||
|
},
|
||||||
|
"get_all_modules": {
|
||||||
|
"name": "get_all_modules",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.base.Project.get_all_modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
|
||||||
|
"docstring": "Get all modules in the project.\n\nReturns:\n An iterable of Module objects."
|
||||||
|
},
|
||||||
|
"get_module_list": {
|
||||||
|
"name": "get_module_list",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.base.Project.get_module_list",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
|
||||||
|
"docstring": "Get the list of all module dotted paths.\n\nReturns:\n A list of module paths."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"RendererConfig": {
|
||||||
|
"name": "RendererConfig",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.base.RendererConfig",
|
||||||
|
"signature": "<bound method Class.signature of Class('RendererConfig', 13, 24)>",
|
||||||
|
"docstring": "Configuration container for documentation renderers.\n\nArgs:\n out_dir: The directory where documentation files should be written.\n project: The introspected project models to be rendered.",
|
||||||
|
"members": {
|
||||||
|
"out_dir": {
|
||||||
|
"name": "out_dir",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.base.RendererConfig.out_dir",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"project": {
|
||||||
|
"name": "project",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.base.RendererConfig.project",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"DocRenderer": {
|
||||||
|
"name": "DocRenderer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.base.DocRenderer",
|
||||||
|
"signature": "<bound method Class.signature of Class('DocRenderer', 27, 46)>",
|
||||||
|
"docstring": "Protocol defining the interface for documentation renderers.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.base.DocRenderer.name",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.base.DocRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Function.signature of Function('generate_sources', 34, 46)>",
|
||||||
|
"docstring": "Generate renderer-specific source files for the given project.\n\nArgs:\n project: The project models containing modules and objects.\n out_dir: Target directory for the generated files."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
557
mcp_docs/modules/docforge.renderers.json
Normal file
557
mcp_docs/modules/docforge.renderers.json
Normal file
@@ -0,0 +1,557 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.renderers",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.renderers",
|
||||||
|
"docstring": "# Renderers Layer\n\nThe `docforge.renderers` package handles the transformation of the internal\ndocumentation models into physical files formatted for specific documentation\nengines.\n\n## Current Implementations\n\n- **MkDocsRenderer**: Generates Markdown files utilizing the `mkdocstrings`\n syntax. It automatically handles package/module hierarchy and generates\n `index.md` files for packages.\n\n## Extending\n\nTo add a new renderer, implement the `DocRenderer` protocol defined in\n`docforge.renderers.base`.",
|
||||||
|
"objects": {
|
||||||
|
"MkDocsRenderer": {
|
||||||
|
"name": "MkDocsRenderer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.MkDocsRenderer",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MkDocsRenderer', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer')>",
|
||||||
|
"docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.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.renderers.MkDocsRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||||
|
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MCPRenderer": {
|
||||||
|
"name": "MCPRenderer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.MCPRenderer",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MCPRenderer', 'docforge.renderers.mcp_renderer.MCPRenderer')>",
|
||||||
|
"docstring": "Renderer that emits MCP-native JSON resources from docforge models.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.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.renderers.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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"base": {
|
||||||
|
"name": "base",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.renderers.base",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": "This module defines the base interfaces and configuration containers for\ndoc-forge renderers. All renderer implementations should adhere to the\nDocRenderer protocol.",
|
||||||
|
"members": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.base.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Protocol": {
|
||||||
|
"name": "Protocol",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.base.Protocol",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Protocol', 'typing.Protocol')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Project": {
|
||||||
|
"name": "Project",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.base.Project",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
|
||||||
|
"docstring": "Represents a documentation project, serving as a container for modules.\n\nAttributes:\n name: Name of the project.\n modules: Dictionary mapping module paths to Module instances.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.base.Project.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.project.Project.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"modules": {
|
||||||
|
"name": "modules",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.base.Project.modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('modules', 'docforge.models.project.Project.modules')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_module": {
|
||||||
|
"name": "add_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.base.Project.add_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
|
||||||
|
"docstring": "Add a module to the project.\n\nArgs:\n module: The module to add."
|
||||||
|
},
|
||||||
|
"get_module": {
|
||||||
|
"name": "get_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.base.Project.get_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.Project.get_module')>",
|
||||||
|
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: The dotted path of the module (e.g., 'pkg.mod').\n\nReturns:\n The requested Module."
|
||||||
|
},
|
||||||
|
"get_all_modules": {
|
||||||
|
"name": "get_all_modules",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.base.Project.get_all_modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
|
||||||
|
"docstring": "Get all modules in the project.\n\nReturns:\n An iterable of Module objects."
|
||||||
|
},
|
||||||
|
"get_module_list": {
|
||||||
|
"name": "get_module_list",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.base.Project.get_module_list",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
|
||||||
|
"docstring": "Get the list of all module dotted paths.\n\nReturns:\n A list of module paths."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"RendererConfig": {
|
||||||
|
"name": "RendererConfig",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.base.RendererConfig",
|
||||||
|
"signature": "<bound method Class.signature of Class('RendererConfig', 13, 24)>",
|
||||||
|
"docstring": "Configuration container for documentation renderers.\n\nArgs:\n out_dir: The directory where documentation files should be written.\n project: The introspected project models to be rendered.",
|
||||||
|
"members": {
|
||||||
|
"out_dir": {
|
||||||
|
"name": "out_dir",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.base.RendererConfig.out_dir",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"project": {
|
||||||
|
"name": "project",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.base.RendererConfig.project",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"DocRenderer": {
|
||||||
|
"name": "DocRenderer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.base.DocRenderer",
|
||||||
|
"signature": "<bound method Class.signature of Class('DocRenderer', 27, 46)>",
|
||||||
|
"docstring": "Protocol defining the interface for documentation renderers.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.base.DocRenderer.name",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.base.DocRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Function.signature of Function('generate_sources', 34, 46)>",
|
||||||
|
"docstring": "Generate renderer-specific source files for the given project.\n\nArgs:\n project: The project models containing modules and objects.\n out_dir: Target directory for the generated files."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mcp_renderer": {
|
||||||
|
"name": "mcp_renderer",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.renderers.mcp_renderer",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null,
|
||||||
|
"members": {
|
||||||
|
"json": {
|
||||||
|
"name": "json",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.json",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('json', 'json')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Dict": {
|
||||||
|
"name": "Dict",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Dict",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"List": {
|
||||||
|
"name": "List",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.List",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('List', 'typing.List')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Project": {
|
||||||
|
"name": "Project",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Project",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
|
||||||
|
"docstring": "Represents a documentation project, serving as a container for modules.\n\nAttributes:\n name: Name of the project.\n modules: Dictionary mapping module paths to Module instances.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Project.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.project.Project.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"modules": {
|
||||||
|
"name": "modules",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Project.modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('modules', 'docforge.models.project.Project.modules')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_module": {
|
||||||
|
"name": "add_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Project.add_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
|
||||||
|
"docstring": "Add a module to the project.\n\nArgs:\n module: The module to add."
|
||||||
|
},
|
||||||
|
"get_module": {
|
||||||
|
"name": "get_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Project.get_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.Project.get_module')>",
|
||||||
|
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: The dotted path of the module (e.g., 'pkg.mod').\n\nReturns:\n The requested Module."
|
||||||
|
},
|
||||||
|
"get_all_modules": {
|
||||||
|
"name": "get_all_modules",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Project.get_all_modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
|
||||||
|
"docstring": "Get all modules in the project.\n\nReturns:\n An iterable of Module objects."
|
||||||
|
},
|
||||||
|
"get_module_list": {
|
||||||
|
"name": "get_module_list",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Project.get_module_list",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
|
||||||
|
"docstring": "Get the list of all module dotted paths.\n\nReturns:\n A list of module paths."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Module": {
|
||||||
|
"name": "Module",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>",
|
||||||
|
"docstring": "Represents a documented Python module or package.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level docstring content.\n members: Dictionary mapping object names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Module.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.module.Module.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Module.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.module.Module.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Module.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.module.Module.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_object": {
|
||||||
|
"name": "add_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Module.add_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.Module.add_object')>",
|
||||||
|
"docstring": "Add a documented object to the module.\n\nArgs:\n obj: The object to add."
|
||||||
|
},
|
||||||
|
"get_object": {
|
||||||
|
"name": "get_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Module.get_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
|
||||||
|
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: The name of the object.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_objects": {
|
||||||
|
"name": "get_all_objects",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Module.get_all_objects",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
|
||||||
|
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"DocObject": {
|
||||||
|
"name": "DocObject",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.DocObject')>",
|
||||||
|
"docstring": "Represents a documented Python object (class, function, method, etc.).\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (e.g., 'class', 'function', 'attribute').\n path: Full dotted import path to the object.\n signature: Callable signature, if applicable.\n docstring: Raw docstring content extracted from the source.\n members: Dictionary mapping member names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.object.DocObject.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"kind": {
|
||||||
|
"name": "kind",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.kind",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('kind', 'docforge.models.object.DocObject.kind')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.object.DocObject.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"signature": {
|
||||||
|
"name": "signature",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.signature",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('signature', 'docforge.models.object.DocObject.signature')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.object.DocObject.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.object.DocObject.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_member": {
|
||||||
|
"name": "add_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.add_member",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_member', 'docforge.models.object.DocObject.add_member')>",
|
||||||
|
"docstring": "Add a child member to this object (e.g., a method to a class).\n\nArgs:\n obj: The child DocObject to add."
|
||||||
|
},
|
||||||
|
"get_member": {
|
||||||
|
"name": "get_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.get_member",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
|
||||||
|
"docstring": "Retrieve a child member by name.\n\nArgs:\n name: The name of the member.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_members": {
|
||||||
|
"name": "get_all_members",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.get_all_members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
|
||||||
|
"docstring": "Get all members of this object.\n\nReturns:\n An iterable of child DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MCPRenderer": {
|
||||||
|
"name": "MCPRenderer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.MCPRenderer",
|
||||||
|
"signature": "<bound method Class.signature of Class('MCPRenderer', 8, 122)>",
|
||||||
|
"docstring": "Renderer that emits MCP-native JSON resources from docforge models.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.MCPRenderer.name",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.MCPRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Function.signature of Function('generate_sources', 15, 53)>",
|
||||||
|
"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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mkdocs_renderer": {
|
||||||
|
"name": "mkdocs_renderer",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": "This module implements the MkDocsRenderer, which generates Markdown source files\ncompatible with the MkDocs 'material' theme and 'mkdocstrings' extension.",
|
||||||
|
"members": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Project": {
|
||||||
|
"name": "Project",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Project",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
|
||||||
|
"docstring": "Represents a documentation project, serving as a container for modules.\n\nAttributes:\n name: Name of the project.\n modules: Dictionary mapping module paths to Module instances.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Project.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.project.Project.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"modules": {
|
||||||
|
"name": "modules",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Project.modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('modules', 'docforge.models.project.Project.modules')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_module": {
|
||||||
|
"name": "add_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Project.add_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
|
||||||
|
"docstring": "Add a module to the project.\n\nArgs:\n module: The module to add."
|
||||||
|
},
|
||||||
|
"get_module": {
|
||||||
|
"name": "get_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Project.get_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.Project.get_module')>",
|
||||||
|
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: The dotted path of the module (e.g., 'pkg.mod').\n\nReturns:\n The requested Module."
|
||||||
|
},
|
||||||
|
"get_all_modules": {
|
||||||
|
"name": "get_all_modules",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Project.get_all_modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
|
||||||
|
"docstring": "Get all modules in the project.\n\nReturns:\n An iterable of Module objects."
|
||||||
|
},
|
||||||
|
"get_module_list": {
|
||||||
|
"name": "get_module_list",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Project.get_module_list",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
|
||||||
|
"docstring": "Get the list of all module dotted paths.\n\nReturns:\n A list of module paths."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MkDocsRenderer": {
|
||||||
|
"name": "MkDocsRenderer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer",
|
||||||
|
"signature": "<bound method Class.signature of Class('MkDocsRenderer', 11, 91)>",
|
||||||
|
"docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.name",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Function.signature of Function('generate_sources', 19, 38)>",
|
||||||
|
"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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Set": {
|
||||||
|
"name": "Set",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Set",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Set', 'typing.Set')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Module": {
|
||||||
|
"name": "Module",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>",
|
||||||
|
"docstring": "Represents a documented Python module or package.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level docstring content.\n members: Dictionary mapping object names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Module.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.module.Module.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Module.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.module.Module.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Module.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.module.Module.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_object": {
|
||||||
|
"name": "add_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Module.add_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.Module.add_object')>",
|
||||||
|
"docstring": "Add a documented object to the module.\n\nArgs:\n obj: The object to add."
|
||||||
|
},
|
||||||
|
"get_object": {
|
||||||
|
"name": "get_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Module.get_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
|
||||||
|
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: The name of the object.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_objects": {
|
||||||
|
"name": "get_all_objects",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Module.get_all_objects",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
|
||||||
|
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
234
mcp_docs/modules/docforge.renderers.mcp_renderer.json
Normal file
234
mcp_docs/modules/docforge.renderers.mcp_renderer.json
Normal file
@@ -0,0 +1,234 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.renderers.mcp_renderer",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.renderers.mcp_renderer",
|
||||||
|
"docstring": null,
|
||||||
|
"objects": {
|
||||||
|
"json": {
|
||||||
|
"name": "json",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.json",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('json', 'json')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Dict": {
|
||||||
|
"name": "Dict",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Dict",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"List": {
|
||||||
|
"name": "List",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.List",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('List', 'typing.List')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Project": {
|
||||||
|
"name": "Project",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Project",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
|
||||||
|
"docstring": "Represents a documentation project, serving as a container for modules.\n\nAttributes:\n name: Name of the project.\n modules: Dictionary mapping module paths to Module instances.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Project.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.project.Project.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"modules": {
|
||||||
|
"name": "modules",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Project.modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('modules', 'docforge.models.project.Project.modules')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_module": {
|
||||||
|
"name": "add_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Project.add_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
|
||||||
|
"docstring": "Add a module to the project.\n\nArgs:\n module: The module to add."
|
||||||
|
},
|
||||||
|
"get_module": {
|
||||||
|
"name": "get_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Project.get_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.Project.get_module')>",
|
||||||
|
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: The dotted path of the module (e.g., 'pkg.mod').\n\nReturns:\n The requested Module."
|
||||||
|
},
|
||||||
|
"get_all_modules": {
|
||||||
|
"name": "get_all_modules",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Project.get_all_modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
|
||||||
|
"docstring": "Get all modules in the project.\n\nReturns:\n An iterable of Module objects."
|
||||||
|
},
|
||||||
|
"get_module_list": {
|
||||||
|
"name": "get_module_list",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Project.get_module_list",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
|
||||||
|
"docstring": "Get the list of all module dotted paths.\n\nReturns:\n A list of module paths."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Module": {
|
||||||
|
"name": "Module",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>",
|
||||||
|
"docstring": "Represents a documented Python module or package.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level docstring content.\n members: Dictionary mapping object names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Module.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.module.Module.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Module.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.module.Module.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Module.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.module.Module.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_object": {
|
||||||
|
"name": "add_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Module.add_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.Module.add_object')>",
|
||||||
|
"docstring": "Add a documented object to the module.\n\nArgs:\n obj: The object to add."
|
||||||
|
},
|
||||||
|
"get_object": {
|
||||||
|
"name": "get_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Module.get_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
|
||||||
|
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: The name of the object.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_objects": {
|
||||||
|
"name": "get_all_objects",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.Module.get_all_objects",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
|
||||||
|
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"DocObject": {
|
||||||
|
"name": "DocObject",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.DocObject')>",
|
||||||
|
"docstring": "Represents a documented Python object (class, function, method, etc.).\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (e.g., 'class', 'function', 'attribute').\n path: Full dotted import path to the object.\n signature: Callable signature, if applicable.\n docstring: Raw docstring content extracted from the source.\n members: Dictionary mapping member names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.object.DocObject.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"kind": {
|
||||||
|
"name": "kind",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.kind",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('kind', 'docforge.models.object.DocObject.kind')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.object.DocObject.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"signature": {
|
||||||
|
"name": "signature",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.signature",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('signature', 'docforge.models.object.DocObject.signature')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.object.DocObject.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.object.DocObject.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_member": {
|
||||||
|
"name": "add_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.add_member",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_member', 'docforge.models.object.DocObject.add_member')>",
|
||||||
|
"docstring": "Add a child member to this object (e.g., a method to a class).\n\nArgs:\n obj: The child DocObject to add."
|
||||||
|
},
|
||||||
|
"get_member": {
|
||||||
|
"name": "get_member",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.get_member",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
|
||||||
|
"docstring": "Retrieve a child member by name.\n\nArgs:\n name: The name of the member.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_members": {
|
||||||
|
"name": "get_all_members",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.DocObject.get_all_members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
|
||||||
|
"docstring": "Get all members of this object.\n\nReturns:\n An iterable of child DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MCPRenderer": {
|
||||||
|
"name": "MCPRenderer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.MCPRenderer",
|
||||||
|
"signature": "<bound method Class.signature of Class('MCPRenderer', 8, 122)>",
|
||||||
|
"docstring": "Renderer that emits MCP-native JSON resources from docforge models.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.MCPRenderer.name",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mcp_renderer.MCPRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Function.signature of Function('generate_sources', 15, 53)>",
|
||||||
|
"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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
148
mcp_docs/modules/docforge.renderers.mkdocs_renderer.json
Normal file
148
mcp_docs/modules/docforge.renderers.mkdocs_renderer.json
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.renderers.mkdocs_renderer",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer",
|
||||||
|
"docstring": "This module implements the MkDocsRenderer, which generates Markdown source files\ncompatible with the MkDocs 'material' theme and 'mkdocstrings' extension.",
|
||||||
|
"objects": {
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Project": {
|
||||||
|
"name": "Project",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Project",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
|
||||||
|
"docstring": "Represents a documentation project, serving as a container for modules.\n\nAttributes:\n name: Name of the project.\n modules: Dictionary mapping module paths to Module instances.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Project.name",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.project.Project.name')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"modules": {
|
||||||
|
"name": "modules",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Project.modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('modules', 'docforge.models.project.Project.modules')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_module": {
|
||||||
|
"name": "add_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Project.add_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
|
||||||
|
"docstring": "Add a module to the project.\n\nArgs:\n module: The module to add."
|
||||||
|
},
|
||||||
|
"get_module": {
|
||||||
|
"name": "get_module",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Project.get_module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.Project.get_module')>",
|
||||||
|
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: The dotted path of the module (e.g., 'pkg.mod').\n\nReturns:\n The requested Module."
|
||||||
|
},
|
||||||
|
"get_all_modules": {
|
||||||
|
"name": "get_all_modules",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Project.get_all_modules",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
|
||||||
|
"docstring": "Get all modules in the project.\n\nReturns:\n An iterable of Module objects."
|
||||||
|
},
|
||||||
|
"get_module_list": {
|
||||||
|
"name": "get_module_list",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Project.get_module_list",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
|
||||||
|
"docstring": "Get the list of all module dotted paths.\n\nReturns:\n A list of module paths."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MkDocsRenderer": {
|
||||||
|
"name": "MkDocsRenderer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer",
|
||||||
|
"signature": "<bound method Class.signature of Class('MkDocsRenderer', 11, 91)>",
|
||||||
|
"docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
|
||||||
|
"members": {
|
||||||
|
"name": {
|
||||||
|
"name": "name",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.name",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"generate_sources": {
|
||||||
|
"name": "generate_sources",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources",
|
||||||
|
"signature": "<bound method Function.signature of Function('generate_sources', 19, 38)>",
|
||||||
|
"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."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Set": {
|
||||||
|
"name": "Set",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Set",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Set', 'typing.Set')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Module": {
|
||||||
|
"name": "Module",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Module",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>",
|
||||||
|
"docstring": "Represents a documented Python module or package.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level docstring content.\n members: Dictionary mapping object names to their DocObject representations.",
|
||||||
|
"members": {
|
||||||
|
"path": {
|
||||||
|
"name": "path",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Module.path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.module.Module.path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"docstring": {
|
||||||
|
"name": "docstring",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Module.docstring",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.module.Module.docstring')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"members": {
|
||||||
|
"name": "members",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Module.members",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.module.Module.members')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"add_object": {
|
||||||
|
"name": "add_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Module.add_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.Module.add_object')>",
|
||||||
|
"docstring": "Add a documented object to the module.\n\nArgs:\n obj: The object to add."
|
||||||
|
},
|
||||||
|
"get_object": {
|
||||||
|
"name": "get_object",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Module.get_object",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
|
||||||
|
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: The name of the object.\n\nReturns:\n The requested DocObject."
|
||||||
|
},
|
||||||
|
"get_all_objects": {
|
||||||
|
"name": "get_all_objects",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.renderers.mkdocs_renderer.Module.get_all_objects",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
|
||||||
|
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
mcp_docs/modules/docforge.servers.json
Normal file
120
mcp_docs/modules/docforge.servers.json
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.servers",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.servers",
|
||||||
|
"docstring": null,
|
||||||
|
"objects": {
|
||||||
|
"MCPServer": {
|
||||||
|
"name": "MCPServer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.servers.MCPServer",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('MCPServer', 'docforge.servers.mcp_server.MCPServer')>",
|
||||||
|
"docstring": "MCP server for serving a pre-built MCP documentation bundle.",
|
||||||
|
"members": {
|
||||||
|
"mcp_root": {
|
||||||
|
"name": "mcp_root",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.servers.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.servers.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.servers.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)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mcp_server": {
|
||||||
|
"name": "mcp_server",
|
||||||
|
"kind": "module",
|
||||||
|
"path": "docforge.servers.mcp_server",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null,
|
||||||
|
"members": {
|
||||||
|
"annotations": {
|
||||||
|
"name": "annotations",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.servers.mcp_server.annotations",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('annotations', '__future__.annotations')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"json": {
|
||||||
|
"name": "json",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.servers.mcp_server.json",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('json', 'json')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.servers.mcp_server.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Any": {
|
||||||
|
"name": "Any",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.servers.mcp_server.Any",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Any', 'typing.Any')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Literal": {
|
||||||
|
"name": "Literal",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.servers.mcp_server.Literal",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Literal', 'typing.Literal')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"FastMCP": {
|
||||||
|
"name": "FastMCP",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.servers.mcp_server.FastMCP",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('FastMCP', 'mcp.server.fastmcp.FastMCP')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"MCPServer": {
|
||||||
|
"name": "MCPServer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.servers.mcp_server.MCPServer",
|
||||||
|
"signature": "<bound method Class.signature of Class('MCPServer', 10, 95)>",
|
||||||
|
"docstring": "MCP server for serving a pre-built MCP documentation bundle.",
|
||||||
|
"members": {
|
||||||
|
"mcp_root": {
|
||||||
|
"name": "mcp_root",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.servers.mcp_server.MCPServer.mcp_root",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"name": "app",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.servers.mcp_server.MCPServer.app",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"run": {
|
||||||
|
"name": "run",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.servers.mcp_server.MCPServer.run",
|
||||||
|
"signature": "<bound method Function.signature of Function('run', 88, 95)>",
|
||||||
|
"docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
81
mcp_docs/modules/docforge.servers.mcp_server.json
Normal file
81
mcp_docs/modules/docforge.servers.mcp_server.json
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
{
|
||||||
|
"module": "docforge.servers.mcp_server",
|
||||||
|
"content": {
|
||||||
|
"path": "docforge.servers.mcp_server",
|
||||||
|
"docstring": null,
|
||||||
|
"objects": {
|
||||||
|
"annotations": {
|
||||||
|
"name": "annotations",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.servers.mcp_server.annotations",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('annotations', '__future__.annotations')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"json": {
|
||||||
|
"name": "json",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.servers.mcp_server.json",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('json', 'json')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Path": {
|
||||||
|
"name": "Path",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.servers.mcp_server.Path",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Any": {
|
||||||
|
"name": "Any",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.servers.mcp_server.Any",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Any', 'typing.Any')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"Literal": {
|
||||||
|
"name": "Literal",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.servers.mcp_server.Literal",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('Literal', 'typing.Literal')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"FastMCP": {
|
||||||
|
"name": "FastMCP",
|
||||||
|
"kind": "alias",
|
||||||
|
"path": "docforge.servers.mcp_server.FastMCP",
|
||||||
|
"signature": "<bound method Alias.signature of Alias('FastMCP', 'mcp.server.fastmcp.FastMCP')>",
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"MCPServer": {
|
||||||
|
"name": "MCPServer",
|
||||||
|
"kind": "class",
|
||||||
|
"path": "docforge.servers.mcp_server.MCPServer",
|
||||||
|
"signature": "<bound method Class.signature of Class('MCPServer', 10, 95)>",
|
||||||
|
"docstring": "MCP server for serving a pre-built MCP documentation bundle.",
|
||||||
|
"members": {
|
||||||
|
"mcp_root": {
|
||||||
|
"name": "mcp_root",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.servers.mcp_server.MCPServer.mcp_root",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"name": "app",
|
||||||
|
"kind": "attribute",
|
||||||
|
"path": "docforge.servers.mcp_server.MCPServer.app",
|
||||||
|
"signature": null,
|
||||||
|
"docstring": null
|
||||||
|
},
|
||||||
|
"run": {
|
||||||
|
"name": "run",
|
||||||
|
"kind": "function",
|
||||||
|
"path": "docforge.servers.mcp_server.MCPServer.run",
|
||||||
|
"signature": "<bound method Function.signature of Function('run', 88, 95)>",
|
||||||
|
"docstring": "Start the MCP server.\n\nArgs:\n transport: MCP transport (default: streamable-http)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
90
mcp_docs/nav.json
Normal file
90
mcp_docs/nav.json
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"module": "docforge",
|
||||||
|
"resource": "doc://modules/docforge"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.cli",
|
||||||
|
"resource": "doc://modules/docforge.cli"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.cli.commands",
|
||||||
|
"resource": "doc://modules/docforge.cli.commands"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.cli.main",
|
||||||
|
"resource": "doc://modules/docforge.cli.main"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.cli.mcp_utils",
|
||||||
|
"resource": "doc://modules/docforge.cli.mcp_utils"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.cli.mkdocs_utils",
|
||||||
|
"resource": "doc://modules/docforge.cli.mkdocs_utils"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.loaders",
|
||||||
|
"resource": "doc://modules/docforge.loaders"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.loaders.griffe_loader",
|
||||||
|
"resource": "doc://modules/docforge.loaders.griffe_loader"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.models",
|
||||||
|
"resource": "doc://modules/docforge.models"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.models.module",
|
||||||
|
"resource": "doc://modules/docforge.models.module"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.models.object",
|
||||||
|
"resource": "doc://modules/docforge.models.object"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.models.project",
|
||||||
|
"resource": "doc://modules/docforge.models.project"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.nav",
|
||||||
|
"resource": "doc://modules/docforge.nav"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.nav.mkdocs",
|
||||||
|
"resource": "doc://modules/docforge.nav.mkdocs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.nav.resolver",
|
||||||
|
"resource": "doc://modules/docforge.nav.resolver"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.nav.spec",
|
||||||
|
"resource": "doc://modules/docforge.nav.spec"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.renderers",
|
||||||
|
"resource": "doc://modules/docforge.renderers"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.renderers.base",
|
||||||
|
"resource": "doc://modules/docforge.renderers.base"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.renderers.mcp_renderer",
|
||||||
|
"resource": "doc://modules/docforge.renderers.mcp_renderer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.renderers.mkdocs_renderer",
|
||||||
|
"resource": "doc://modules/docforge.renderers.mkdocs_renderer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.servers",
|
||||||
|
"resource": "doc://modules/docforge.servers"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "docforge.servers.mcp_server",
|
||||||
|
"resource": "doc://modules/docforge.servers.mcp_server"
|
||||||
|
}
|
||||||
|
]
|
||||||
62
mkdocs.yml
Normal file
62
mkdocs.yml
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
site_name: docforge
|
||||||
|
|
||||||
|
theme:
|
||||||
|
name: material
|
||||||
|
palette:
|
||||||
|
- scheme: slate
|
||||||
|
primary: deep purple
|
||||||
|
accent: cyan
|
||||||
|
font:
|
||||||
|
text: Inter
|
||||||
|
code: JetBrains Mono
|
||||||
|
features:
|
||||||
|
- navigation.tabs
|
||||||
|
- navigation.expand
|
||||||
|
- navigation.top
|
||||||
|
- navigation.instant
|
||||||
|
- content.code.copy
|
||||||
|
- content.code.annotate
|
||||||
|
plugins:
|
||||||
|
- search
|
||||||
|
- mkdocstrings:
|
||||||
|
handlers:
|
||||||
|
python:
|
||||||
|
paths:
|
||||||
|
- .
|
||||||
|
options:
|
||||||
|
docstring_style: google
|
||||||
|
show_source: false
|
||||||
|
show_signature_annotations: true
|
||||||
|
separate_signature: true
|
||||||
|
merge_init_into_class: true
|
||||||
|
inherited_members: true
|
||||||
|
annotations_path: brief
|
||||||
|
show_root_heading: true
|
||||||
|
group_by_category: true
|
||||||
|
|
||||||
|
nav:
|
||||||
|
- Home: docforge/index.md
|
||||||
|
- Loaders:
|
||||||
|
- docforge/loaders/index.md
|
||||||
|
- docforge/loaders/griffe_loader.md
|
||||||
|
- Models:
|
||||||
|
- docforge/models/index.md
|
||||||
|
- docforge/models/module.md
|
||||||
|
- docforge/models/object.md
|
||||||
|
- docforge/models/project.md
|
||||||
|
- Navigation:
|
||||||
|
- docforge/nav/index.md
|
||||||
|
- docforge/nav/spec.md
|
||||||
|
- docforge/nav/resolver.md
|
||||||
|
- docforge/nav/mkdocs.md
|
||||||
|
- Renderers:
|
||||||
|
- docforge/renderers/index.md
|
||||||
|
- docforge/renderers/base.md
|
||||||
|
- docforge/renderers/mkdocs_renderer.md
|
||||||
|
- docforge/renderers/mcp_renderer.md
|
||||||
|
- CLI:
|
||||||
|
- docforge/cli/index.md
|
||||||
|
- docforge/cli/main.md
|
||||||
|
- docforge/cli/commands.md
|
||||||
|
- docforge/cli/mcp_utils.md
|
||||||
|
- docforge/cli/mkdocs_utils.md
|
||||||
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "doc-forge"
|
name = "doc-forge"
|
||||||
version = "0.0.1"
|
version = "0.0.4"
|
||||||
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"
|
||||||
@@ -42,8 +42,15 @@ doc-forge = "docforge.cli.main:main"
|
|||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
mkdocs = [
|
mkdocs = [
|
||||||
"mkdocs>=1.5.0",
|
"mkdocs==1.6.1",
|
||||||
"mkdocstrings[python]>=0.20.0",
|
"mkdocs-material==9.6.23",
|
||||||
|
|
||||||
|
"mkdocstrings==0.25.2",
|
||||||
|
"mkdocstrings-python==1.10.8",
|
||||||
|
"mkdocs-autorefs==0.5.0",
|
||||||
|
|
||||||
|
"pymdown-extensions==10.16.1",
|
||||||
|
"neoteroi-mkdocs==1.1.3",
|
||||||
]
|
]
|
||||||
sphinx = [
|
sphinx = [
|
||||||
"sphinx>=5.0.0",
|
"sphinx>=5.0.0",
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user