5 Commits

87 changed files with 2001 additions and 1569 deletions

View File

@@ -32,6 +32,26 @@ steps:
echo "🆕 New version detected: $PACKAGE_NAME==$VERSION" echo "🆕 New version detected: $PACKAGE_NAME==$VERSION"
fi fi
- name: quality-gate
image: python:3.13-slim
environment:
PIP_REPO_URL:
from_secret: PIP_REPO_URL
PIP_USERNAME:
from_secret: PIP_USERNAME
PIP_PASSWORD:
from_secret: PIP_PASSWORD
commands:
- pip install --upgrade pip build
- |
AUTH_URL="https://${PIP_USERNAME}:${PIP_PASSWORD}@$(echo "${PIP_REPO_URL#*://}" | sed 's:/*$::')/simple"
pip install --index-url "$AUTH_URL" --extra-index-url https://pypi.org/simple/ -U ".[dev]"
- echo "🛡️ Running quality gate..."
- python -m black --check .
- python -m ruff check .
- python -m mypy
- python -m pytest
- name: build-package - name: build-package
image: python:3.13-slim image: python:3.13-slim
commands: commands:

5
.gitignore vendored
View File

@@ -87,3 +87,8 @@ Thumbs.db
# ========================= # =========================
.env .env
.env.* .env.*
# =========================
# Testing artifacts
# =========================
coverage.xml

21
CHANGELOG.md Normal file
View File

@@ -0,0 +1,21 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- `py.typed` marker for PEP 561 type information.
- `.drone.yml` CI with a quality-gate step (black, ruff, mypy, pytest).
- MIT `LICENSE`.
### Changed
- Standardized `pyproject.toml` (canonical packaging, lint tool config, extras).
- Pinned the `mcp` extra to `mcp>=1.0.0,<2.0.0` to restore compatibility with
the current MCP server API used by doc-forge.
### Fixed
- Stub fixes for typed API surfaces.

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 Aetoskia Platform
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

539
README.md
View File

@@ -1,5 +1,7 @@
# docforge # docforge
# Summary
Renderer-agnostic Python documentation compiler that converts Python docstrings Renderer-agnostic Python documentation compiler that converts Python docstrings
into structured documentation for both humans (MkDocs) and machines (MCP / AI agents). into structured documentation for both humans (MkDocs) and machines (MCP / AI agents).
@@ -9,137 +11,116 @@ outputs without executing user code.
--- ---
## Installation # Installation
Install using pip: Install using pip:
pip install doc-forge ```bash
pip install doc-forge
```
--- ---
## Quick start # CLI usage
Generate a MkDocs site from a Python package: ## Generate an MkDocs site from a Python package:
doc-forge build --mkdocs --module my_package ```bash
doc-forge build --mkdocs --module my_package
```
Generate MCP JSON documentation: ## Generate MCP JSON documentation:
doc-forge build --mcp --module my_package ```bash
doc-forge build --mcp --module my_package
```
Serve documentation locally:
doc-forge serve --mkdocs --module my_package ## Generate MkDocs site and MCP JSON documentation:
```bash
doc-forge build --mcp --mkdocs --module my_package
```
## Serve MkDocs locally:
```bash
doc-forge serve --mkdocs --module my_package
```
## Serve MCP locally:
```bash
doc-forge serve --mcp --module my_package
```
--- ---
## Core concepts # Core concepts
**Loader**
## Loader
Extracts symbols, signatures, and docstrings using static analysis. Extracts symbols, signatures, and docstrings using static analysis.
**Semantic model** ## Semantic model
Structured, renderer-agnostic representation of the API. Structured, renderer-agnostic representation of the API.
**Renderer** ## Renderer
Converts the semantic model into output formats such as MkDocs or MCP JSON. Converts the semantic model into output formats such as MkDocs or MCP JSON.
**Symbol** ## Symbol
Any documentable object
Any documentable object: - module
- class
- module - function
- class - method
- function - property
- method - attribute
- property
- attribute
--- ---
## Architecture # Architecture
`doc-forge` follows a compiler architecture: `doc-forge` follows a compiler architecture:
Front-end: ## Front-end:
Static analysis of modules, classes, functions, type hints, and docstrings. Static analysis of modules, classes, functions, type hints, and docstrings.
Middle-end: ## Middle-end:
Builds a semantic model describing symbols and relationships. Builds a semantic model describing symbols and relationships.
Back-end: ## Back-end:
Renders documentation using interchangeable renderers. Renders documentation using interchangeable renderers.
This architecture ensures deterministic documentation generation. This architecture ensures deterministic documentation generation.
--- ---
## Rendering pipeline # Rendering pipeline
Typical flow: Typical flow:
Python package Python package
↓ |
Loader (static analysis) Loader (static analysis)
↓ |
Semantic model Semantic model
↓ |
Renderer Renderer
↓ |
MkDocs site or MCP JSON MkDocs site or MCP JSON
--- ---
## CLI usage
Build MkDocs documentation:
doc-forge build --mkdocs --module my_package
Build MCP documentation:
doc-forge build --mcp --module my_package
Serve MkDocs locally:
doc-forge serve --module my_package
---
## Public API
Loaders:
GriffeLoader
discover_module_paths
Renderers:
MkDocsRenderer
MCPRenderer
CLI:
main
Models:
models
---
# Google-Styled Doc-Forge Convention (GSDFC) # Google-Styled Doc-Forge Convention (GSDFC)
GSDFC defines how docstrings must be written so they render correctly in MkDocs and remain machine-parsable by doc-forge and AI tooling. GSDFC defines how docstrings must be written so they render correctly in MkDocs and remain machine-parsable by doc-forge and AI tooling.
- Docstrings are the single source of truth. - Docstrings are the single source of truth.
- doc-forge compiles docstrings but does not generate documentation content. - `doc-forge` compiles docstrings but does not generate documentation content.
- Documentation follows the Python import hierarchy. - Documentation follows the Python import hierarchy.
- Every public symbol should have a complete and accurate docstring. - Every public symbol should have a complete and accurate docstring.
@@ -149,34 +130,110 @@ GSDFC defines how docstrings must be written so they render correctly in MkDocs
- Use **Markdown headings** at package and module level. - Use **Markdown headings** at package and module level.
- Use **Google-style structured sections** at class, function, and method level. - Use **Google-style structured sections** at class, function, and method level.
- Indent section contents using four spaces.
- Use type hints in signatures instead of duplicating types in prose. - Use type hints in signatures instead of duplicating types in prose.
- Write summaries in imperative form. - Write summaries in imperative form.
- Sections are separated by ```---``` - Sections are separated by `---`
--- ---
## Package docstrings # Notes subsection grouping
- Package docstrings act as the documentation home page. Group related information using labeled subsections.
Example:
Notes:
**Guarantees:**
- deterministic behavior
**Lifecycle:**
- created during initialization
- reused across executions
**Thread safety:**
- safe for concurrent reads
---
# Example formatting
- Use indentation for examples.
- Indent section contents using four spaces.
- Use code blocks for example code.
Example:
Single example:
Example:
```python
foo = Foo("example")
process(foo, multiplier=2)
```
Multiple examples:
Example:
Create foo:
```python
foo = Foo("example")
```
Run engine:
```python
engine = BarEngine([foo])
engine.run()
```
Avoid fenced code blocks inside structured sections.
---
# Separator rules
Use horizontal separators only at docstring root level to separate sections:
```markdown
---
```
Allowed locations:
- package docstrings
- module docstrings
- major documentation sections
Do not use separators inside code sections.
---
# Package docstrings
Package docstrings act as the documentation home page.
Recommended sections: Recommended sections:
## Summary # Summary
## Installation # Installation
## Quick start # Quick start
## Core concepts # CLI usage
## Architecture # Core concepts
## Rendering pipeline # Architecture
## CLI usage # Rendering pipeline
## Public API # Examples
## Examples # Notes
## Notes
Example: Example:
Package Doc String: Package Doc String:
''' '''
# Summary
Foo-bar processing framework. Foo-bar processing framework.
Provides tools for defining Foo objects and executing Bar pipelines. Provides tools for defining Foo objects and executing Bar pipelines.
@@ -185,47 +242,44 @@ Example:
# Installation # Installation
pip install foo-bar ```bash
pip install foo-bar
```
--- ---
# Quick start # Quick start
from foobar import Foo, BarEngine ```python
from foobar import Foo, BarEngine
foo = Foo("example") foo = Foo("example")
engine = BarEngine([foo]) engine = BarEngine([foo])
result = engine.run() result = engine.run()
```
---
# Public API
Foo
Bar
BarEngine
--- ---
''' '''
--- ---
## Module docstrings # Module docstrings
- Module docstrings describe a subsystem. Module docstrings describe a subsystem.
Recommended sections: Recommended sections:
## Summary # Summary
## Examples # Examples
## Notes # Notes
## Public API
Example: Example:
Module Doc String: Module Doc String:
''' '''
# Summary
Foo execution subsystem. Foo execution subsystem.
Provides utilities for executing Foo objects through Bar stages. Provides utilities for executing Foo objects through Bar stages.
@@ -234,6 +288,7 @@ Example:
Example: Example:
```python
from foobar.engine import BarEngine from foobar.engine import BarEngine
from foobar.foo import Foo from foobar.foo import Foo
@@ -241,15 +296,16 @@ Example:
engine = BarEngine([foo]) engine = BarEngine([foo])
engine.run() engine.run()
```
--- ---
''' '''
--- ---
## Class docstrings # Class docstrings
- Class docstrings define object responsibility, lifecycle, and attributes. Class docstrings define object responsibility, lifecycle, and attributes.
Recommended sections: Recommended sections:
@@ -261,64 +317,72 @@ Recommended sections:
Example: Example:
Simple Foo: Simple Foo:
class Foo: ```python
''' class Foo:
Represents a unit of work. '''
Represents a unit of work.
Attributes: Attributes:
name (str): name (str):
Identifier of the foo instance. Identifier of the foo instance.
value (int): value (int):
Numeric value associated with foo. Numeric value associated with foo.
Notes: Notes:
Guarantees: Guarantees:
- instances are immutable after creation - instances are immutable after creation
Lifecycle: Lifecycle:
- create instance - create instance
- pass to processing engine - pass to processing engine
Example: Example:
Create and inspect a Foo: Create and inspect a Foo:
foo = Foo("example", value=42) ```python
print(foo.name) foo = Foo("example", value=42)
''' print(foo.name)
```
'''
```
Complex Bar: Complex Bar:
class BarEngine: ```python
''' class BarEngine:
Executes Foo objects through Bar stages. '''
Executes Foo objects through Bar stages.
Attributes: Attributes:
foos (tuple[Foo, ...]): foos (tuple[Foo, ...]):
Foo instances managed by the engine. Foo instances managed by the engine.
Notes: Notes:
Guarantees: Guarantees:
- deterministic execution order - deterministic execution order
Example: Example:
Run engine: Run engine:
foo1 = Foo("a") ```python
foo2 = Foo("b") foo1 = Foo("a")
foo2 = Foo("b")
engine = BarEngine([foo1, foo2]) engine = BarEngine([foo1, foo2])
engine.run() engine.run()
''' ```
'''
```
--- ---
## Function and method docstrings # Function and method docstrings
- Function docstrings define API contracts. Function docstrings define API contracts.
Recommended sections: Recommended sections:
@@ -332,79 +396,90 @@ Recommended sections:
Example: Example:
Simple process method: Simple process method:
def process(foo: Foo, multiplier: int) -> int: ```python
''' def process(foo: Foo, multiplier: int) -> int:
Process a Foo instance. '''
Process a Foo instance.
Args: Args:
foo (Foo): foo (Foo):
Foo instance to process. Foo instance to process.
multiplier (int): multiplier (int):
Value used to scale foo. Value used to scale foo.
Returns: Returns:
int: int:
Processed result. Processed result.
Raises: Raises:
ValueError: ValueError:
If multiplier is negative. If multiplier is negative.
Notes: Notes:
Guarantees: Guarantees:
- foo is not modified - foo is not modified
Example: Example:
Process foo: Process foo:
foo = Foo("example", value=10) ```python
foo = Foo("example", value=10)
result = process(foo, multiplier=2) result = process(foo, multiplier=2)
print(result) print(result)
''' ```
'''
```
Multiple Examples: Multiple Examples:
def combine(foo_a: Foo, foo_b: Foo) -> Foo: ```python
''' def combine(foo_a: Foo, foo_b: Foo) -> Foo:
Combine two Foo instances. '''
Combine two Foo instances.
Args: Args:
foo_a (Foo): foo_a (Foo):
First foo. First foo.
foo_b (Foo): foo_b (Foo):
Second foo. Second foo.
Returns: Returns:
Foo: Foo:
Combined foo. Combined foo.
Example: Example:
Basic usage: Basic usage:
foo1 = Foo("a") ```python
foo2 = Foo("b") foo1 = Foo("a")
foo2 = Foo("b")
combined = combine(foo1, foo2) combined = combine(foo1, foo2)
```
Pipeline usage: Pipeline usage:
engine = BarEngine([foo1, foo2]) ```python
engine.run() engine = BarEngine([foo1, foo2])
''' engine.run()
```
'''
```
--- ---
## Property docstrings # Property docstrings
- Properties must document return values. Properties must document return values.
Example: Example:
Property Doc String: Property Doc String:
```python
@property @property
def foos(self) -> tuple[Foo, ...]: def foos(self) -> tuple[Foo, ...]:
''' '''
@@ -415,20 +490,24 @@ Example:
Stored foo objects. Stored foo objects.
Example: Example:
```python
container = FooContainer() container = FooContainer()
foos = container.foos foos = container.foos
```
''' '''
```
--- ---
## Attribute documentation # Attribute documentation
- Document attributes in class docstrings using Attributes:. Document attributes in class docstrings using `Attributes:`.
Example: Example:
Attribute Doc String: Attribute Doc String:
```python
''' '''
Represents a processing stage. Represents a processing stage.
@@ -439,77 +518,11 @@ Example:
enabled (bool): enabled (bool):
Whether the stage is active. Whether the stage is active.
''' '''
```
--- ---
## Notes subsection grouping # Parsing guarantees
- Group related information using labeled subsections.
Example:
Notes Example:
Notes:
**Guarantees:**
- deterministic behavior
**Lifecycle:**
- created during initialization
- reused across executions
**Thread safety:**
- safe for concurrent reads
---
## Example formatting
- Use indentation for examples.
Example:
Single example:
Example:
foo = Foo("example")
process(foo, multiplier=2)
Multiple examples:
Example:
Create foo:
foo = Foo("example")
Run engine:
engine = BarEngine([foo])
engine.run()
Avoid fenced code blocks inside structured sections.
---
## Separator rules
Use horizontal separators only at docstring root level to separate sections:
---
Allowed locations:
- package docstrings
- module docstrings
- major documentation sections
Do not use separators inside code sections.
---
## Parsing guarantees
GSDFC ensures doc-forge can deterministically extract: GSDFC ensures doc-forge can deterministically extract:

View File

@@ -1,4 +1,6 @@
""" """
# Summary
Renderer-agnostic Python documentation compiler that converts Python docstrings Renderer-agnostic Python documentation compiler that converts Python docstrings
into structured documentation for both humans (MkDocs) and machines (MCP / AI agents). into structured documentation for both humans (MkDocs) and machines (MCP / AI agents).
@@ -8,137 +10,116 @@ outputs without executing user code.
--- ---
## Installation # Installation
Install using pip: Install using pip:
pip install doc-forge ```bash
pip install doc-forge
```
--- ---
## Quick start # CLI usage
Generate a MkDocs site from a Python package: ## Generate an MkDocs site from a Python package:
doc-forge build --mkdocs --module my_package ```bash
doc-forge build --mkdocs --module my_package
```
Generate MCP JSON documentation: ## Generate MCP JSON documentation:
doc-forge build --mcp --module my_package ```bash
doc-forge build --mcp --module my_package
```
Serve documentation locally:
doc-forge serve --mkdocs --module my_package ## Generate MkDocs site and MCP JSON documentation:
```bash
doc-forge build --mcp --mkdocs --module my_package
```
## Serve MkDocs locally:
```bash
doc-forge serve --mkdocs --module my_package
```
## Serve MCP locally:
```bash
doc-forge serve --mcp --module my_package
```
--- ---
## Core concepts # Core concepts
**Loader**
## Loader
Extracts symbols, signatures, and docstrings using static analysis. Extracts symbols, signatures, and docstrings using static analysis.
**Semantic model** ## Semantic model
Structured, renderer-agnostic representation of the API. Structured, renderer-agnostic representation of the API.
**Renderer** ## Renderer
Converts the semantic model into output formats such as MkDocs or MCP JSON. Converts the semantic model into output formats such as MkDocs or MCP JSON.
**Symbol** ## Symbol
Any documentable object
Any documentable object: - module
- class
- module - function
- class - method
- function - property
- method - attribute
- property
- attribute
--- ---
## Architecture # Architecture
`doc-forge` follows a compiler architecture: `doc-forge` follows a compiler architecture:
Front-end: ## Front-end:
Static analysis of modules, classes, functions, type hints, and docstrings. Static analysis of modules, classes, functions, type hints, and docstrings.
Middle-end: ## Middle-end:
Builds a semantic model describing symbols and relationships. Builds a semantic model describing symbols and relationships.
Back-end: ## Back-end:
Renders documentation using interchangeable renderers. Renders documentation using interchangeable renderers.
This architecture ensures deterministic documentation generation. This architecture ensures deterministic documentation generation.
--- ---
## Rendering pipeline # Rendering pipeline
Typical flow: Typical flow:
Python package Python package
↓ |
Loader (static analysis) Loader (static analysis)
↓ |
Semantic model Semantic model
↓ |
Renderer Renderer
↓ |
MkDocs site or MCP JSON MkDocs site or MCP JSON
--- ---
## CLI usage
Build MkDocs documentation:
doc-forge build --mkdocs --module my_package
Build MCP documentation:
doc-forge build --mcp --module my_package
Serve MkDocs locally:
doc-forge serve --module my_package
---
## Public API
Loaders:
GriffeLoader
discover_module_paths
Renderers:
MkDocsRenderer
MCPRenderer
CLI:
main
Models:
models
---
# Google-Styled Doc-Forge Convention (GSDFC) # Google-Styled Doc-Forge Convention (GSDFC)
GSDFC defines how docstrings must be written so they render correctly in MkDocs and remain machine-parsable by doc-forge and AI tooling. GSDFC defines how docstrings must be written so they render correctly in MkDocs and remain machine-parsable by doc-forge and AI tooling.
- Docstrings are the single source of truth. - Docstrings are the single source of truth.
- doc-forge compiles docstrings but does not generate documentation content. - `doc-forge` compiles docstrings but does not generate documentation content.
- Documentation follows the Python import hierarchy. - Documentation follows the Python import hierarchy.
- Every public symbol should have a complete and accurate docstring. - Every public symbol should have a complete and accurate docstring.
@@ -148,34 +129,110 @@ GSDFC defines how docstrings must be written so they render correctly in MkDocs
- Use **Markdown headings** at package and module level. - Use **Markdown headings** at package and module level.
- Use **Google-style structured sections** at class, function, and method level. - Use **Google-style structured sections** at class, function, and method level.
- Indent section contents using four spaces.
- Use type hints in signatures instead of duplicating types in prose. - Use type hints in signatures instead of duplicating types in prose.
- Write summaries in imperative form. - Write summaries in imperative form.
- Sections are separated by ```---``` - Sections are separated by `---`
--- ---
## Package docstrings # Notes subsection grouping
- Package docstrings act as the documentation home page. Group related information using labeled subsections.
Example:
Notes:
**Guarantees:**
- deterministic behavior
**Lifecycle:**
- created during initialization
- reused across executions
**Thread safety:**
- safe for concurrent reads
---
# Example formatting
- Use indentation for examples.
- Indent section contents using four spaces.
- Use code blocks for example code.
Example:
Single example:
Example:
```python
foo = Foo("example")
process(foo, multiplier=2)
```
Multiple examples:
Example:
Create foo:
```python
foo = Foo("example")
```
Run engine:
```python
engine = BarEngine([foo])
engine.run()
```
Avoid fenced code blocks inside structured sections.
---
# Separator rules
Use horizontal separators only at docstring root level to separate sections:
```markdown
---
```
Allowed locations:
- package docstrings
- module docstrings
- major documentation sections
Do not use separators inside code sections.
---
# Package docstrings
Package docstrings act as the documentation home page.
Recommended sections: Recommended sections:
## Summary # Summary
## Installation # Installation
## Quick start # Quick start
## Core concepts # CLI usage
## Architecture # Core concepts
## Rendering pipeline # Architecture
## CLI usage # Rendering pipeline
## Public API # Examples
## Examples # Notes
## Notes
Example: Example:
Package Doc String: Package Doc String:
''' '''
# Summary
Foo-bar processing framework. Foo-bar processing framework.
Provides tools for defining Foo objects and executing Bar pipelines. Provides tools for defining Foo objects and executing Bar pipelines.
@@ -184,47 +241,44 @@ Example:
# Installation # Installation
pip install foo-bar ```bash
pip install foo-bar
```
--- ---
# Quick start # Quick start
from foobar import Foo, BarEngine ```python
from foobar import Foo, BarEngine
foo = Foo("example") foo = Foo("example")
engine = BarEngine([foo]) engine = BarEngine([foo])
result = engine.run() result = engine.run()
```
---
# Public API
Foo
Bar
BarEngine
--- ---
''' '''
--- ---
## Module docstrings # Module docstrings
- Module docstrings describe a subsystem. Module docstrings describe a subsystem.
Recommended sections: Recommended sections:
## Summary # Summary
## Examples # Examples
## Notes # Notes
## Public API
Example: Example:
Module Doc String: Module Doc String:
''' '''
# Summary
Foo execution subsystem. Foo execution subsystem.
Provides utilities for executing Foo objects through Bar stages. Provides utilities for executing Foo objects through Bar stages.
@@ -233,6 +287,7 @@ Example:
Example: Example:
```python
from foobar.engine import BarEngine from foobar.engine import BarEngine
from foobar.foo import Foo from foobar.foo import Foo
@@ -240,15 +295,16 @@ Example:
engine = BarEngine([foo]) engine = BarEngine([foo])
engine.run() engine.run()
```
--- ---
''' '''
--- ---
## Class docstrings # Class docstrings
- Class docstrings define object responsibility, lifecycle, and attributes. Class docstrings define object responsibility, lifecycle, and attributes.
Recommended sections: Recommended sections:
@@ -260,64 +316,72 @@ Recommended sections:
Example: Example:
Simple Foo: Simple Foo:
class Foo: ```python
''' class Foo:
Represents a unit of work. '''
Represents a unit of work.
Attributes: Attributes:
name (str): name (str):
Identifier of the foo instance. Identifier of the foo instance.
value (int): value (int):
Numeric value associated with foo. Numeric value associated with foo.
Notes: Notes:
Guarantees: Guarantees:
- instances are immutable after creation - instances are immutable after creation
Lifecycle: Lifecycle:
- create instance - create instance
- pass to processing engine - pass to processing engine
Example: Example:
Create and inspect a Foo: Create and inspect a Foo:
foo = Foo("example", value=42) ```python
print(foo.name) foo = Foo("example", value=42)
''' print(foo.name)
```
'''
```
Complex Bar: Complex Bar:
class BarEngine: ```python
''' class BarEngine:
Executes Foo objects through Bar stages. '''
Executes Foo objects through Bar stages.
Attributes: Attributes:
foos (tuple[Foo, ...]): foos (tuple[Foo, ...]):
Foo instances managed by the engine. Foo instances managed by the engine.
Notes: Notes:
Guarantees: Guarantees:
- deterministic execution order - deterministic execution order
Example: Example:
Run engine: Run engine:
foo1 = Foo("a") ```python
foo2 = Foo("b") foo1 = Foo("a")
foo2 = Foo("b")
engine = BarEngine([foo1, foo2]) engine = BarEngine([foo1, foo2])
engine.run() engine.run()
''' ```
'''
```
--- ---
## Function and method docstrings # Function and method docstrings
- Function docstrings define API contracts. Function docstrings define API contracts.
Recommended sections: Recommended sections:
@@ -331,79 +395,90 @@ Recommended sections:
Example: Example:
Simple process method: Simple process method:
def process(foo: Foo, multiplier: int) -> int: ```python
''' def process(foo: Foo, multiplier: int) -> int:
Process a Foo instance. '''
Process a Foo instance.
Args: Args:
foo (Foo): foo (Foo):
Foo instance to process. Foo instance to process.
multiplier (int): multiplier (int):
Value used to scale foo. Value used to scale foo.
Returns: Returns:
int: int:
Processed result. Processed result.
Raises: Raises:
ValueError: ValueError:
If multiplier is negative. If multiplier is negative.
Notes: Notes:
Guarantees: Guarantees:
- foo is not modified - foo is not modified
Example: Example:
Process foo: Process foo:
foo = Foo("example", value=10) ```python
foo = Foo("example", value=10)
result = process(foo, multiplier=2) result = process(foo, multiplier=2)
print(result) print(result)
''' ```
'''
```
Multiple Examples: Multiple Examples:
def combine(foo_a: Foo, foo_b: Foo) -> Foo: ```python
''' def combine(foo_a: Foo, foo_b: Foo) -> Foo:
Combine two Foo instances. '''
Combine two Foo instances.
Args: Args:
foo_a (Foo): foo_a (Foo):
First foo. First foo.
foo_b (Foo): foo_b (Foo):
Second foo. Second foo.
Returns: Returns:
Foo: Foo:
Combined foo. Combined foo.
Example: Example:
Basic usage: Basic usage:
foo1 = Foo("a") ```python
foo2 = Foo("b") foo1 = Foo("a")
foo2 = Foo("b")
combined = combine(foo1, foo2) combined = combine(foo1, foo2)
```
Pipeline usage: Pipeline usage:
engine = BarEngine([foo1, foo2]) ```python
engine.run() engine = BarEngine([foo1, foo2])
''' engine.run()
```
'''
```
--- ---
## Property docstrings # Property docstrings
- Properties must document return values. Properties must document return values.
Example: Example:
Property Doc String: Property Doc String:
```python
@property @property
def foos(self) -> tuple[Foo, ...]: def foos(self) -> tuple[Foo, ...]:
''' '''
@@ -414,20 +489,24 @@ Example:
Stored foo objects. Stored foo objects.
Example: Example:
```python
container = FooContainer() container = FooContainer()
foos = container.foos foos = container.foos
```
''' '''
```
--- ---
## Attribute documentation # Attribute documentation
- Document attributes in class docstrings using Attributes:. Document attributes in class docstrings using `Attributes:`.
Example: Example:
Attribute Doc String: Attribute Doc String:
```python
''' '''
Represents a processing stage. Represents a processing stage.
@@ -438,77 +517,11 @@ Example:
enabled (bool): enabled (bool):
Whether the stage is active. Whether the stage is active.
''' '''
```
--- ---
## Notes subsection grouping # Parsing guarantees
- Group related information using labeled subsections.
Example:
Notes Example:
Notes:
**Guarantees:**
- deterministic behavior
**Lifecycle:**
- created during initialization
- reused across executions
**Thread safety:**
- safe for concurrent reads
---
## Example formatting
- Use indentation for examples.
Example:
Single example:
Example:
foo = Foo("example")
process(foo, multiplier=2)
Multiple examples:
Example:
Create foo:
foo = Foo("example")
Run engine:
engine = BarEngine([foo])
engine.run()
Avoid fenced code blocks inside structured sections.
---
## Separator rules
Use horizontal separators only at docstring root level to separate sections:
---
Allowed locations:
- package docstrings
- module docstrings
- major documentation sections
Do not use separators inside code sections.
---
## Parsing guarantees
GSDFC ensures doc-forge can deterministically extract: GSDFC ensures doc-forge can deterministically extract:

View File

@@ -1,7 +1,7 @@
from .loaders import GriffeLoader, discover_module_paths
from .renderers import MkDocsRenderer, MCPRenderer
from .cli import main
from . import models from . import models
from .cli import main
from .loaders import GriffeLoader, discover_module_paths
from .renderers import MCPRenderer, MkDocsRenderer
__all__ = [ __all__ = [
"GriffeLoader", "GriffeLoader",

View File

@@ -1,9 +1,11 @@
""" """
# Summary
Command line interface entry point for doc-forge. Command line interface entry point for doc-forge.
This module exposes the primary CLI entry function used by the This module exposes the primary CLI entry function used by the
``doc-forge`` command. The actual command implementation resides in `doc-forge` command. The actual command implementation resides in
``docforge.cli.main``, while this module provides a stable import path `docforge.cli.main`, while this module provides a stable import path
for external tools and the package entry point configuration. for external tools and the package entry point configuration.
The CLI is responsible for orchestrating documentation workflows such as The CLI is responsible for orchestrating documentation workflows such as
@@ -13,23 +15,26 @@ servers.
--- ---
Typical usage # Typical usage
-------------
The CLI is normally invoked through the installed command: The CLI is normally invoked through the installed command:
doc-forge <command> [options] ```bash
doc-forge <command> [options]
```
Programmatic invocation is also possible: Programmatic invocation is also possible:
Example:
```python
from docforge.cli import main from docforge.cli import main
main() main()
```
--- ---
""" """
from .main import main from .main import main
__all__ = [ __all__ = ["main"]
"main"
]

View File

@@ -1,5 +1,3 @@
from .main import main from .main import main
__all__ = [ __all__ = ["main"]
"main"
]

View File

@@ -1,9 +1,17 @@
import click """
# Summary
Command definitions for the doc-forge CLI.
Provides the CLI structure using Click, including build, serve, and tree commands.
"""
from pathlib import Path from pathlib import Path
from typing import Sequence, Optional
import click
from docforge.cli import mcp_utils, mkdocs_utils
from docforge.loaders import GriffeLoader from docforge.loaders import GriffeLoader
from docforge.cli import mkdocs_utils
from docforge.cli import mcp_utils
@click.group() @click.group()
@@ -20,26 +28,52 @@ def cli() -> None:
@cli.command() @cli.command()
@click.option("--mcp", is_flag=True, help="Build MCP resources") @click.option("--mcp", is_flag=True, help="Build MCP resources")
@click.option("--mkdocs", is_flag=True, help="Build MkDocs site") @click.option("--mkdocs", is_flag=True, help="Build MkDocs site")
@click.option("--module-is-source", is_flag=True, help="Module is source folder and to be treated as root folder") @click.option(
"--module-is-source",
is_flag=True,
help="Module is source folder and to be treated as root folder",
)
@click.option("--module", help="Python module to document") @click.option("--module", help="Python module to document")
@click.option("--project-name", help="Project name override") @click.option("--project-name", help="Project name override")
@click.option("--site-name", help="MkDocs site name") @click.option("--site-name", help="MkDocs site name")
@click.option("--docs-dir", type=click.Path(path_type=Path), default=Path("docs"), help="Directory for MD sources") @click.option(
@click.option("--nav", "nav_file", type=click.Path(path_type=Path), default=Path("docforge.nav.yml"), "--docs-dir",
help="Nav spec path") type=click.Path(path_type=Path),
@click.option("--template", type=click.Path(path_type=Path), help="MkDocs template path") default=Path("docs"),
@click.option("--mkdocs-yml", type=click.Path(path_type=Path), default=Path("mkdocs.yml"), help="Output config path") help="Directory for MD sources",
@click.option("--out-dir", type=click.Path(path_type=Path), default=Path("mcp_docs"), help="MCP output directory") )
@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",
)
@click.option(
"--out-dir",
type=click.Path(path_type=Path),
default=Path("mcp_docs"),
help="MCP output directory",
)
def build( def build(
mcp: bool, mcp: bool,
mkdocs: bool, mkdocs: bool,
module_is_source: bool, module_is_source: bool,
module: Optional[str], module: str | None,
project_name: Optional[str], project_name: str | None,
site_name: Optional[str], site_name: str | None,
docs_dir: Path, docs_dir: Path,
nav_file: Path, nav_file: Path,
template: Optional[Path], template: Path | None,
mkdocs_yml: Path, mkdocs_yml: Path,
out_dir: Path, out_dir: Path,
) -> None: ) -> None:
@@ -58,22 +92,42 @@ def build(
- MCP structured documentation resources - MCP structured documentation resources
Args: Args:
mcp: Enable MCP documentation generation. mcp (bool):
mkdocs: Enable MkDocs documentation generation. Enable MCP documentation generation.
module_is_source: Treat the specified module directory as the
project root. mkdocs (bool):
module: Python module import path to document. Enable MkDocs documentation generation.
project_name: Optional override for the project name.
site_name: Display name for the MkDocs site. module_is_source (bool):
docs_dir: Directory where Markdown documentation sources Treat the specified module directory as the project root.
will be generated.
nav_file: Path to the navigation specification file. module (Optional[str]):
template: Optional custom MkDocs configuration template. Python module import path to document.
mkdocs_yml: Output path for the generated MkDocs configuration.
out_dir: Output directory for generated MCP resources. project_name (Optional[str]):
Optional override for the project name.
site_name (Optional[str]):
Display name for the MkDocs site.
docs_dir (Path):
Directory where Markdown documentation sources will be generated.
nav_file (Path):
Path to the navigation specification file.
template (Optional[Path]):
Optional custom MkDocs configuration template.
mkdocs_yml (Path):
Output path for the generated MkDocs configuration.
out_dir (Path):
Output directory for generated MCP resources.
Raises: Raises:
click.UsageError: If required options are missing or conflicting. click.UsageError:
If required options are missing or conflicting.
""" """
if not mcp and not mkdocs: if not mcp and not mkdocs:
raise click.UsageError("Must specify either --mcp or --mkdocs") raise click.UsageError("Must specify either --mcp or --mkdocs")
@@ -93,7 +147,9 @@ def build(
) )
click.echo(f"Generating MkDocs config {mkdocs_yml}...") click.echo(f"Generating MkDocs config {mkdocs_yml}...")
mkdocs_utils.generate_config(docs_dir, nav_file, template, mkdocs_yml, site_name) mkdocs_utils.generate_config(
docs_dir, nav_file, template, mkdocs_yml, site_name
)
click.echo("Running MkDocs build...") click.echo("Running MkDocs build...")
mkdocs_utils.build(mkdocs_yml) mkdocs_utils.build(mkdocs_yml)
@@ -112,12 +168,22 @@ def build(
@click.option("--mcp", is_flag=True, help="Serve MCP documentation") @click.option("--mcp", is_flag=True, help="Serve MCP documentation")
@click.option("--mkdocs", is_flag=True, help="Serve MkDocs site") @click.option("--mkdocs", is_flag=True, help="Serve MkDocs site")
@click.option("--module", help="Python module to serve") @click.option("--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(
@click.option("--out-dir", type=click.Path(path_type=Path), default=Path("mcp_docs"), help="MCP root directory") "--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( def serve(
mcp: bool, mcp: bool,
mkdocs: bool, mkdocs: bool,
module: Optional[str], module: str | None,
mkdocs_yml: Path, mkdocs_yml: Path,
out_dir: Path, out_dir: Path,
) -> None: ) -> None:
@@ -130,14 +196,24 @@ def serve(
- An MCP server exposing structured documentation resources - An MCP server exposing structured documentation resources
Args: Args:
mcp: Serve documentation using the MCP server. mcp (bool):
mkdocs: Serve the MkDocs development site. Serve documentation using the MCP server.
module: Python module import path to serve via MCP.
mkdocs_yml: Path to the MkDocs configuration file. mkdocs (bool):
out_dir: Root directory containing MCP documentation resources. Serve the MkDocs development site.
module (Optional[str]):
Python module import path to serve via MCP.
mkdocs_yml (Path):
Path to the MkDocs configuration file.
out_dir (Path):
Root directory containing MCP documentation resources.
Raises: Raises:
click.UsageError: If invalid or conflicting options are provided. click.UsageError:
If invalid or conflicting options are provided.
""" """
if mcp and mkdocs: if mcp and mkdocs:
raise click.UsageError("Cannot specify both --mcp and --mkdocs") raise click.UsageError("Cannot specify both --mcp and --mkdocs")
@@ -164,7 +240,7 @@ def serve(
) )
def tree( def tree(
module: str, module: str,
project_name: Optional[str], project_name: str | None,
) -> None: ) -> None:
""" """
Display the documentation object tree for a module. Display the documentation object tree for a module.
@@ -174,8 +250,11 @@ def tree(
objects, including modules, classes, functions, and members. objects, including modules, classes, functions, and members.
Args: Args:
module: Python module import path to introspect. module (str):
project_name: Optional name to display as the project root. Python module import path to introspect.
project_name (Optional[str]):
Optional name to display as the project root.
""" """
loader = GriffeLoader() loader = GriffeLoader()
project = loader.load_project([module], project_name) project = loader.load_project([module], project_name)
@@ -196,8 +275,11 @@ def _print_object(obj, indent: str) -> None:
and prints each object with indentation to represent hierarchy. and prints each object with indentation to represent hierarchy.
Args: Args:
obj: Documentation object to print. obj:
indent: Current indentation prefix used for nested members. Documentation object to print.
indent (str):
Current indentation prefix used for nested members.
""" """
click.echo(f"{indent}├── {obj.name}") click.echo(f"{indent}├── {obj.name}")
for member in obj.get_all_members(): for member in obj.get_all_members():

View File

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

View File

@@ -1,8 +1,10 @@
""" """
# Summary
Command-line entry point for the doc-forge CLI. Command-line entry point for the doc-forge CLI.
This module exposes the executable entry point that initializes the This module exposes the executable entry point that initializes the
Click command group defined in ``docforge.cli.commands``. Click command group defined in `docforge.cli.commands`.
""" """
from docforge.cli.commands import cli from docforge.cli.commands import cli
@@ -13,7 +15,7 @@ def main() -> None:
Run the doc-forge command-line interface. Run the doc-forge command-line interface.
This function initializes and executes the Click CLI application. This function initializes and executes the Click CLI application.
It is used as the console entry point when invoking ``doc-forge`` It is used as the console entry point when invoking `doc-forge`
from the command line. from the command line.
""" """
cli() cli()

View File

@@ -1,5 +1,13 @@
"""
# Summary
Utilities for working with MCP in the doc-forge CLI.
"""
from pathlib import Path from pathlib import Path
import click import click
from docforge.loaders import GriffeLoader, discover_module_paths from docforge.loaders import GriffeLoader, discover_module_paths
from docforge.renderers import MCPRenderer from docforge.renderers import MCPRenderer
from docforge.servers import MCPServer from docforge.servers import MCPServer
@@ -14,12 +22,17 @@ def generate_resources(module: str, project_name: str | None, out_dir: Path) ->
to the specified output directory. to the specified output directory.
Args: Args:
module: Python module import path used as the entry point for module (str):
Python module import path used as the entry point for
documentation generation. documentation generation.
project_name: Optional override for the project name used in
generated documentation metadata. project_name (Optional[str]):
out_dir: Directory where MCP resources (index.json, nav.json, Optional override for the project name used in generated
and module data) will be written. documentation metadata.
out_dir (Path):
Directory where MCP resources (index.json, nav.json, and module data)
will be written.
""" """
loader = GriffeLoader() loader = GriffeLoader()
discovered_paths = discover_module_paths(module) discovered_paths = discover_module_paths(module)
@@ -37,14 +50,17 @@ def serve(module: str, mcp_root: Path) -> None:
navigation structure, and module documentation through MCP endpoints. navigation structure, and module documentation through MCP endpoints.
Args: Args:
module: Python module import path used to identify the served module (str):
Python module import path used to identify the served
documentation instance. documentation instance.
mcp_root: Path to the directory containing the MCP documentation
mcp_root (Path):
Path to the directory containing the MCP documentation
bundle (index.json, nav.json, and modules/). bundle (index.json, nav.json, and modules/).
Raises: Raises:
click.ClickException: If the MCP documentation bundle is missing click.ClickException:
required files or directories. If the MCP documentation bundle is missing required files or directories.
""" """
if not mcp_root.exists(): if not mcp_root.exists():
raise click.ClickException(f"mcp_docs directory not found: {mcp_root}") raise click.ClickException(f"mcp_docs directory not found: {mcp_root}")

View File

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

View File

@@ -1,10 +1,18 @@
from pathlib import Path """
# Summary
Utilities for working with MkDocs in the doc-forge CLI.
"""
from importlib import resources from importlib import resources
from pathlib import Path
import click import click
import yaml import yaml
from docforge.loaders import GriffeLoader, discover_module_paths from docforge.loaders import GriffeLoader, discover_module_paths
from docforge.nav import MkDocsNavEmitter, load_nav_spec, resolve_nav
from docforge.renderers import MkDocsRenderer from docforge.renderers import MkDocsRenderer
from docforge.nav import load_nav_spec, resolve_nav, MkDocsNavEmitter
def generate_sources( def generate_sources(
@@ -21,13 +29,19 @@ def generate_sources(
use with MkDocs. use with MkDocs.
Args: Args:
module: Python module import path used as the entry point for module (str):
Python module import path used as the entry point for
documentation generation. documentation generation.
docs_dir: Directory where the generated Markdown files will be written.
project_name: Optional override for the project name used in docs_dir (Path):
documentation metadata. Directory where the generated Markdown files will be written.
module_is_source: If True, treat the specified module directory as
the project root rather than a nested module. project_name (Optional[str]):
Optional override for the project name used in documentation metadata.
module_is_source (Optional[bool]):
If True, treat the specified module directory as the project root
rather than a nested module.
""" """
loader = GriffeLoader() loader = GriffeLoader()
discovered_paths = discover_module_paths(module) discovered_paths = discover_module_paths(module)
@@ -55,24 +69,32 @@ def generate_config(
site_name: str, site_name: str,
) -> None: ) -> None:
""" """
Generate an ``mkdocs.yml`` configuration file. Generate an `mkdocs.yml` configuration file.
The configuration is created by combining a template configuration The configuration is created by combining a template configuration
with a navigation structure derived from the docforge navigation with a navigation structure derived from the docforge navigation
specification. specification.
Args: Args:
docs_dir: Directory containing generated documentation Markdown files. docs_dir (Path):
nav_file: Path to the ``docforge.nav.yml`` navigation specification. Directory containing generated documentation Markdown files.
template: Optional path to a custom MkDocs configuration template.
If not provided, a built-in template will be used. nav_file (Path):
out: Destination path where the generated ``mkdocs.yml`` file Path to the `docforge.nav.yml` navigation specification.
will be written.
site_name: Display name for the generated documentation site. template (Optional[Path]):
Optional path to a custom MkDocs configuration template. If not
provided, a built-in template will be used.
out (Path):
Destination path where the generated `mkdocs.yml` file will be written.
site_name (str):
Display name for the generated documentation site.
Raises: Raises:
click.FileError: If the navigation specification or template click.FileError:
file cannot be found. If the navigation specification or template file cannot be found.
""" """
if not nav_file.exists(): if not nav_file.exists():
raise click.FileError(str(nav_file), hint="Nav spec not found") raise click.FileError(str(nav_file), hint="Nav spec not found")
@@ -108,16 +130,18 @@ def build(mkdocs_yml: Path) -> None:
build command to generate the final static documentation site. build command to generate the final static documentation site.
Args: Args:
mkdocs_yml: Path to the ``mkdocs.yml`` configuration file. mkdocs_yml (Path):
Path to the `mkdocs.yml` configuration file.
Raises: Raises:
click.ClickException: If the configuration file does not exist. click.ClickException:
If the configuration file does not exist.
""" """
if not mkdocs_yml.exists(): if not mkdocs_yml.exists():
raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}") raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}")
from mkdocs.config import load_config
from mkdocs.commands.build import build as mkdocs_build from mkdocs.commands.build import build as mkdocs_build
from mkdocs.config import load_config
mkdocs_build(load_config(str(mkdocs_yml))) mkdocs_build(load_config(str(mkdocs_yml)))
@@ -130,13 +154,16 @@ def serve(mkdocs_yml: Path) -> None:
the site when changes are detected. the site when changes are detected.
Args: Args:
mkdocs_yml: Path to the ``mkdocs.yml`` configuration file. mkdocs_yml (Path):
Path to the `mkdocs.yml` configuration file.
Raises: Raises:
click.ClickException: If the configuration file does not exist. click.ClickException:
If the configuration file does not exist.
""" """
if not mkdocs_yml.exists(): if not mkdocs_yml.exists():
raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}") raise click.ClickException(f"mkdocs.yml not found: {mkdocs_yml}")
from mkdocs.commands.serve import serve as mkdocs_serve from mkdocs.commands.serve import serve as mkdocs_serve
mkdocs_serve(config_file=str(mkdocs_yml)) mkdocs_serve(config_file=str(mkdocs_yml))

View File

@@ -6,6 +6,8 @@ def generate_sources(
project_name: str | None = None, project_name: str | None = None,
module_is_source: bool | None = None, module_is_source: bool | None = None,
) -> None: ... ) -> None: ...
def generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None: ... def generate_config(
docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str
) -> None: ...
def build(mkdocs_yml: Path) -> None: ... def build(mkdocs_yml: Path) -> None: ...
def serve(mkdocs_yml: Path) -> None: ... def serve(mkdocs_yml: Path) -> None: ...

View File

@@ -1,13 +1,14 @@
""" """
# Summary
Loader layer for doc-forge. Loader layer for doc-forge.
The ``docforge.loaders`` package is responsible for discovering Python modules The `docforge.loaders` package is responsible for discovering Python modules
and extracting documentation data using static analysis. and extracting documentation data using static analysis.
--- ---
Overview # Overview
--------
This layer converts Python source code into an intermediate documentation This layer converts Python source code into an intermediate documentation
model used by doc-forge. It performs module discovery, introspection, and model used by doc-forge. It performs module discovery, introspection, and
@@ -17,9 +18,9 @@ Core capabilities include:
- **Module discovery** – Locate Python modules and packages within a project. - **Module discovery** – Locate Python modules and packages within a project.
- **Static introspection** – Parse docstrings, signatures, and object - **Static introspection** – Parse docstrings, signatures, and object
hierarchies using the ``griffe`` library without executing the code. hierarchies using the `griffe` library without executing the code.
- **Public API filtering** – Exclude private members (names prefixed with - **Public API filtering** – Exclude private members (names prefixed with
``_``) to produce clean public documentation structures. `_`) to produce clean public documentation structures.
--- ---
""" """

View File

@@ -1,24 +1,27 @@
""" """
# Summary
Utilities for loading and introspecting Python modules using Griffe. Utilities for loading and introspecting Python modules using Griffe.
This module provides the ``GriffeLoader`` class and helper utilities used to This module provides the `GriffeLoader` class and helper utilities used to
discover Python modules, introspect their structure, and convert the results discover Python modules, introspect their structure, and convert the results
into doc-forge documentation models. into doc-forge documentation models.
""" """
import logging import logging
from pathlib import Path from pathlib import Path
from typing import List, Optional
from griffe import ( from griffe import (
GriffeLoader as _GriffeLoader,
ModulesCollection,
LinesCollection,
Object,
AliasResolutionError, AliasResolutionError,
LinesCollection,
ModulesCollection,
Object,
)
from griffe import (
GriffeLoader as _GriffeLoader,
) )
from docforge.models import Module, Project, DocObject from docforge.models import DocObject, Module, Project
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@@ -26,29 +29,34 @@ logger = logging.getLogger(__name__)
def discover_module_paths( def discover_module_paths(
module_name: str, module_name: str,
project_root: Path | None = None, project_root: Path | None = None,
) -> List[str]: ) -> list[str]:
""" """
Discover Python modules within a package directory. Discover Python modules within a package directory.
The function scans the filesystem for ``.py`` files inside the specified The function scans the filesystem for `.py` files inside the specified
package and converts them into dotted module import paths. package and converts them into dotted module import paths.
Discovery rules: Discovery rules:
- Directories containing ``__init__.py`` are treated as packages. - Directories containing `__init__.py` are treated as packages.
- Each ``.py`` file is treated as a module. - Each `.py` file is treated as a module.
- Results are returned as dotted import paths. - Results are returned as dotted import paths.
Args: Args:
module_name: Top-level package name to discover modules from. module_name (str):
project_root: Root directory used to resolve module paths. If not Top-level package name to discover modules from.
provided, the current working directory is used.
project_root (Path, optional):
Root directory used to resolve module paths. If not provided, the
current working directory is used.
Returns: Returns:
A sorted list of unique dotted module import paths. List[str]:
A sorted list of unique dotted module import paths.
Raises: Raises:
FileNotFoundError: If the specified package directory does not exist. FileNotFoundError:
If the specified package directory does not exist.
""" """
if project_root is None: if project_root is None:
@@ -58,7 +66,7 @@ def discover_module_paths(
if not pkg_dir.exists(): if not pkg_dir.exists():
raise FileNotFoundError(f"Package not found: {pkg_dir}") raise FileNotFoundError(f"Package not found: {pkg_dir}")
module_paths: List[str] = [] module_paths: list[str] = []
for path in pkg_dir.rglob("*.py"): for path in pkg_dir.rglob("*.py"):
if path.name == "__init__.py": if path.name == "__init__.py":
@@ -78,8 +86,8 @@ class GriffeLoader:
Load Python modules using Griffe and convert them into doc-forge models. Load Python modules using Griffe and convert them into doc-forge models.
This loader uses the Griffe introspection engine to analyze Python source This loader uses the Griffe introspection engine to analyze Python source
code and transform the extracted information into ``Project``, ``Module``, code and transform the extracted information into `Project`, `Module`,
and ``DocObject`` instances used by doc-forge. and `DocObject` instances used by doc-forge.
""" """
def __init__(self) -> None: def __init__(self) -> None:
@@ -95,32 +103,39 @@ class GriffeLoader:
) )
def load_project( def load_project(
self, self,
module_paths: List[str], module_paths: list[str],
project_name: Optional[str] = None, project_name: str | None = None,
skip_import_errors: bool = None, skip_import_errors: bool = None,
) -> Project: ) -> Project:
""" """
Load multiple modules and assemble them into a Project model. Load multiple modules and assemble them into a Project model.
Each module path is introspected and converted into a ``Module`` Each module path is introspected and converted into a `Module`
instance. All modules are then aggregated into a single ``Project`` instance. All modules are then aggregated into a single `Project`
object. object.
Args: Args:
module_paths: List of dotted module import paths to load. module_paths (List[str]):
project_name: Optional override for the project name. Defaults List of dotted module import paths to load.
to the top-level name of the first module.
skip_import_errors: If True, modules that fail to load will be project_name (str, optional):
skipped instead of raising an error. Optional override for the project name. Defaults to the top-level
name of the first module.
skip_import_errors (bool, optional):
If True, modules that fail to load will be skipped instead of raising an error.
Returns: Returns:
A populated ``Project`` instance containing the loaded modules. Project:
A populated `Project` instance containing the loaded modules.
Raises: Raises:
ValueError: If no module paths are provided. ValueError:
ImportError: If a module fails to load and If no module paths are provided.
``skip_import_errors`` is False.
ImportError:
If a module fails to load and `skip_import_errors` is False.
""" """
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")
@@ -148,13 +163,15 @@ class GriffeLoader:
Load and convert a single Python module. Load and convert a single Python module.
The module is introspected using Griffe and then transformed into The module is introspected using Griffe and then transformed into
a doc-forge ``Module`` model. a doc-forge `Module` model.
Args: Args:
path: Dotted import path of the module. path (str):
Dotted import path of the module.
Returns: Returns:
A populated ``Module`` instance. Module:
A populated `Module` instance.
""" """
self._loader.load(path) self._loader.load(path)
griffe_module = self._loader.modules_collection[path] griffe_module = self._loader.modules_collection[path]
@@ -170,13 +187,15 @@ class GriffeLoader:
Convert a Griffe module object into a doc-forge Module. Convert a Griffe module object into a doc-forge Module.
All public members of the module are recursively converted into All public members of the module are recursively converted into
``DocObject`` instances. `DocObject` instances.
Args: Args:
obj: Griffe object representing the module. obj (Object):
Griffe object representing the module.
Returns: Returns:
A populated ``Module`` model. Module:
A populated `Module` model.
""" """
module = Module( module = Module(
path=obj.path, path=obj.path,
@@ -200,10 +219,12 @@ class GriffeLoader:
recursively. recursively.
Args: Args:
obj: Griffe object representing a documented Python object. obj (Object):
Griffe object representing a documented Python object.
Returns: Returns:
A ``DocObject`` instance representing the converted object. DocObject:
A `DocObject` instance representing the converted object.
""" """
kind = obj.kind.value kind = obj.kind.value
signature = self._safe_signature(obj) signature = self._safe_signature(obj)
@@ -230,31 +251,34 @@ class GriffeLoader:
# Safe extractors # Safe extractors
# ------------------------- # -------------------------
def _safe_docstring(self, obj: Object) -> Optional[str]: def _safe_docstring(self, obj: Object) -> str | None:
""" """
Safely extract a docstring from a Griffe object. Safely extract a docstring from a Griffe object.
Args: Args:
obj: Griffe object to inspect. obj (Object):
Griffe object to inspect.
Returns: Returns:
The raw docstring text if available, otherwise ``None``. Optional[str]:
The raw docstring text if available, otherwise `None`.
""" """
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) -> str | None:
""" """
Safely extract the signature of a Griffe object. Safely extract the signature of a Griffe object.
Args: Args:
obj: Griffe object to inspect. obj (Object):
Griffe object to inspect.
Returns: Returns:
String representation of the object's signature if available, Optional[str]:
otherwise ``None``. String representation of the object's signature if available, otherwise `None`.
""" """
try: try:
if hasattr(obj, "signature") and obj.signature: if hasattr(obj, "signature") and obj.signature:

View File

@@ -1,15 +1,11 @@
from typing import List, Optional
from pathlib import Path from pathlib import Path
from docforge.models import Module, Project from docforge.models import Module, Project
def discover_module_paths( def discover_module_paths(
module_name: str, module_name: str,
project_root: Path | None = None, project_root: Path | None = None,
) -> List[str]: ) -> list[str]: ...
...
class GriffeLoader: class GriffeLoader:
"""Griffe-based introspection loaders. """Griffe-based introspection loaders.
@@ -18,11 +14,10 @@ class GriffeLoader:
""" """
def __init__(self) -> None: ... def __init__(self) -> None: ...
def load_project( def load_project(
self, self,
module_paths: List[str], module_paths: list[str],
project_name: Optional[str] = ..., project_name: str | None = ...,
skip_import_errors: bool = ..., skip_import_errors: bool = ...,
) -> Project: ) -> Project:
"""Load a documentation project from Python modules.""" """Load a documentation project from Python modules."""

View File

@@ -1,13 +1,14 @@
""" """
# Summary
Model layer for doc-forge. Model layer for doc-forge.
The ``docforge.models`` package defines the core data structures used to The `docforge.models` package defines the core data structures used to
represent Python source code as a structured documentation model. represent Python source code as a structured documentation model.
--- ---
Overview # Overview
--------
The model layer forms the central intermediate representation used throughout The model layer forms the central intermediate representation used throughout
doc-forge. Python modules and objects discovered during introspection are doc-forge. Python modules and objects discovered during introspection are

View File

@@ -1,6 +1,6 @@
from .project import Project
from .module import Module from .module import Module
from .object import DocObject from .object import DocObject
from .project import Project
__all__ = [ __all__ = [
"Project", "Project",

View File

@@ -1,13 +1,15 @@
""" """
# Summary
Documentation model representing a Python module or package. Documentation model representing a Python module or package.
This module defines the ``Module`` class used in the doc-forge documentation This module defines the `Module` class used in the doc-forge documentation
model. A ``Module`` acts as a container for top-level documented objects model. A `Module` acts as a container for top-level documented objects
(classes, functions, variables, and other members) discovered during (classes, functions, variables, and other members) discovered during
introspection. introspection.
""" """
from typing import Dict, Iterable, Optional from collections.abc import Iterable
from docforge.models.object import DocObject from docforge.models.object import DocObject
@@ -16,40 +18,47 @@ class Module:
""" """
Representation of a documented Python module or package. Representation of a documented Python module or package.
A ``Module`` stores metadata about the module itself and maintains a A `Module` stores metadata about the module itself and maintains a
collection of top-level documentation objects discovered during collection of top-level documentation objects discovered during
introspection. introspection.
Attributes: Attributes:
path: Dotted import path of the module. path (str):
docstring: Module-level documentation string, if present. Dotted import path of the module.
members: Mapping of object names to their corresponding
``DocObject`` representations. docstring (Optional[str]):
Module-level documentation string, if present.
members (Dict[str, DocObject]):
Mapping of object names to their corresponding `DocObject` representations.
""" """
def __init__( def __init__(
self, self,
path: str, path: str,
docstring: Optional[str] = None, docstring: str | None = None,
) -> None: ) -> None:
""" """
Initialize a Module instance. Initialize a Module instance.
Args: Args:
path: Dotted import path identifying the module. path (str):
docstring: Module-level documentation text, if available. Dotted import path identifying the module.
docstring (Optional[str]):
Module-level documentation text, if available.
""" """
self.path = path self.path = path
self.docstring = docstring self.docstring = docstring
self.members: Dict[str, DocObject] = {} self.members: dict[str, DocObject] = {}
def add_object(self, obj: DocObject) -> None: def add_object(self, obj: DocObject) -> None:
""" """
Add a documented object to the module. Add a documented object to the module.
Args: Args:
obj: Documentation object to register as a top-level obj (DocObject):
member of the module. Documentation object to register as a top-level member of the module.
""" """
self.members[obj.name] = obj self.members[obj.name] = obj
@@ -58,13 +67,16 @@ class Module:
Retrieve a documented object by name. Retrieve a documented object by name.
Args: Args:
name: Name of the object to retrieve. name (str):
Name of the object to retrieve.
Returns: Returns:
The corresponding ``DocObject`` instance. DocObject:
The corresponding `DocObject` instance.
Raises: Raises:
KeyError: If no object with the given name exists. KeyError:
If no object with the given name exists.
""" """
return self.members[name] return self.members[name]
@@ -73,7 +85,7 @@ class Module:
Return all top-level documentation objects in the module. Return all top-level documentation objects in the module.
Returns: Returns:
An iterable of ``DocObject`` instances representing the Iterable[DocObject]:
module's public members. An iterable of `DocObject` instances representing the module's public members.
""" """
return self.members.values() return self.members.values()

View File

@@ -1,23 +1,19 @@
from typing import Dict, Iterable, Optional from collections.abc import Iterable
from docforge.models.object import DocObject from docforge.models.object import DocObject
class Module: class Module:
"""Represents a documented Python module.""" """Represents a documented Python module."""
path: str path: str
docstring: Optional[str] docstring: str | None
members: Dict[str, DocObject] members: dict[str, DocObject]
def __init__( def __init__(
self, self,
path: str, path: str,
docstring: Optional[str] = ..., docstring: str | None = ...,
) -> None: ... ) -> None: ...
def add_object(self, obj: DocObject) -> None: ... def add_object(self, obj: DocObject) -> None: ...
def get_object(self, name: str) -> DocObject: ... def get_object(self, name: str) -> DocObject: ...
def get_all_objects(self) -> Iterable[DocObject]: ... def get_all_objects(self) -> Iterable[DocObject]: ...

View File

@@ -1,31 +1,43 @@
""" """
# Summary
Documentation model representing individual Python objects. Documentation model representing individual Python objects.
This module defines the ``DocObject`` class, the fundamental recursive unit of This module defines the `DocObject` class, the fundamental recursive unit of
the doc-forge documentation model. Each ``DocObject`` represents a Python the doc-forge documentation model. Each `DocObject` represents a Python
entity such as a class, function, method, or attribute, and may contain nested entity such as a class, function, method, or attribute, and may contain nested
members that form a hierarchical documentation structure. members that form a hierarchical documentation structure.
""" """
from typing import Dict, Iterable, Optional from collections.abc import Iterable
class DocObject: class DocObject:
""" """
Representation of a documented Python object. Representation of a documented Python object.
A ``DocObject`` models a single Python entity discovered during A `DocObject` models a single Python entity discovered during
introspection. Objects may contain nested members, allowing the structure introspection. Objects may contain nested members, allowing the structure
of modules, classes, and other containers to be represented recursively. of modules, classes, and other containers to be represented recursively.
Attributes: Attributes:
name: Local name of the object. name (str):
kind: Type of object (for example ``class``, ``function``, Local name of the object.
``method``, or ``attribute``).
path: Fully qualified dotted path to the object. kind (str):
signature: Callable signature if the object represents a callable. Type of object (for example `class`, `function`, `method`, or `attribute`).
docstring: Raw docstring text extracted from the source code.
members: Mapping of member names to child ``DocObject`` instances. path (str):
Fully qualified dotted path to the object.
signature (Optional[str]):
Callable signature if the object represents a callable.
docstring (Optional[str]):
Raw docstring text extracted from the source code.
members (Dict[str, DocObject]):
Mapping of member names to child `DocObject` instances.
""" """
def __init__( def __init__(
@@ -33,25 +45,34 @@ class DocObject:
name: str, name: str,
kind: str, kind: str,
path: str, path: str,
signature: Optional[str] = None, signature: str | None = None,
docstring: Optional[str] = None, docstring: str | None = None,
) -> None: ) -> None:
""" """
Initialize a DocObject instance. Initialize a DocObject instance.
Args: Args:
name: Local name of the object. name (str):
kind: Object type identifier (for example ``class`` or ``function``). Local name of the object.
path: Fully qualified dotted path of the object.
signature: Callable signature if applicable. kind (str):
docstring: Documentation string associated with the object. Object type identifier (for example `class` or `function`).
path (str):
Fully qualified dotted path of the object.
signature (Optional[str]):
Callable signature if applicable.
docstring (Optional[str]):
Documentation string associated with the object.
""" """
self.name = name self.name = name
self.kind = kind self.kind = kind
self.path = path self.path = path
self.signature = signature self.signature = signature
self.docstring = docstring self.docstring = docstring
self.members: Dict[str, "DocObject"] = {} self.members: dict[str, DocObject] = {}
def add_member(self, obj: "DocObject") -> None: def add_member(self, obj: "DocObject") -> None:
""" """
@@ -70,13 +91,16 @@ class DocObject:
Retrieve a member object by name. Retrieve a member object by name.
Args: Args:
name: Name of the member to retrieve. name (str):
Name of the member to retrieve.
Returns: Returns:
The corresponding ``DocObject`` instance. DocObject:
The corresponding `DocObject` instance.
Raises: Raises:
KeyError: If the member does not exist. KeyError:
If the member does not exist.
""" """
return self.members[name] return self.members[name]
@@ -85,6 +109,7 @@ class DocObject:
Return all child members of the object. Return all child members of the object.
Returns: Returns:
An iterable of ``DocObject`` instances representing nested members. Iterable[DocObject]:
An iterable of `DocObject` instances representing nested members.
""" """
return self.members.values() return self.members.values()

View File

@@ -1,5 +1,4 @@
from typing import Dict, Iterable, Optional from collections.abc import Iterable
class DocObject: class DocObject:
"""Represents a documented Python object.""" """Represents a documented Python object."""
@@ -7,21 +6,18 @@ class DocObject:
name: str name: str
kind: str kind: str
path: str path: str
signature: Optional[str] signature: str | None
docstring: Optional[str] docstring: str | None
members: Dict[str, "DocObject"] members: dict[str, DocObject]
def __init__( def __init__(
self, self,
name: str, name: str,
kind: str, kind: str,
path: str, path: str,
signature: Optional[str] = ..., signature: str | None = ...,
docstring: Optional[str] = ..., docstring: str | None = ...,
) -> None: ... ) -> None: ...
def add_member(self, obj: DocObject) -> None: ...
def add_member(self, obj: "DocObject") -> None: ... def get_member(self, name: str) -> DocObject: ...
def get_all_members(self) -> Iterable[DocObject]: ...
def get_member(self, name: str) -> "DocObject": ...
def get_all_members(self) -> Iterable["DocObject"]: ...

View File

@@ -1,12 +1,14 @@
""" """
# Summary
Documentation model representing a project. Documentation model representing a project.
This module defines the ``Project`` class, the top-level container used by This module defines the `Project` class, the top-level container used by
doc-forge to represent a documented codebase. A ``Project`` aggregates multiple doc-forge to represent a documented codebase. A `Project` aggregates multiple
modules and provides access to them through a unified interface. modules and provides access to them through a unified interface.
""" """
from typing import Dict, Iterable from collections.abc import Iterable
from docforge.models.module import Module from docforge.models.module import Module
@@ -15,12 +17,15 @@ class Project:
""" """
Representation of a documentation project. Representation of a documentation project.
A ``Project`` serves as the root container for all modules discovered during A `Project` serves as the root container for all modules discovered during
introspection. Each module is stored by its dotted import path. introspection. Each module is stored by its dotted import path.
Attributes: Attributes:
name: Name of the project. name (str):
modules: Mapping of module paths to ``Module`` instances. Name of the project.
modules (Dict[str, Module]):
Mapping of module paths to `Module` instances.
""" """
def __init__(self, name: str) -> None: def __init__(self, name: str) -> None:
@@ -28,17 +33,19 @@ class Project:
Initialize a Project instance. Initialize a Project instance.
Args: Args:
name: Name used to identify the documentation project. name (str):
Name used to identify the documentation project.
""" """
self.name = name self.name = name
self.modules: Dict[str, Module] = {} self.modules: dict[str, Module] = {}
def add_module(self, module: Module) -> None: def add_module(self, module: Module) -> None:
""" """
Register a module in the project. Register a module in the project.
Args: Args:
module: Module instance to add to the project. module (Module):
Module instance to add to the project.
""" """
self.modules[module.path] = module self.modules[module.path] = module
@@ -47,13 +54,16 @@ class Project:
Retrieve a module by its dotted path. Retrieve a module by its dotted path.
Args: Args:
path: Fully qualified dotted module path (for example ``pkg.module``). path (str):
Fully qualified dotted module path (for example `pkg.module`).
Returns: Returns:
The corresponding ``Module`` instance. Module:
The corresponding `Module` instance.
Raises: Raises:
KeyError: If the module does not exist in the project. KeyError:
If the module does not exist in the project.
""" """
return self.modules[path] return self.modules[path]
@@ -62,7 +72,8 @@ class Project:
Return all modules contained in the project. Return all modules contained in the project.
Returns: Returns:
An iterable of ``Module`` instances. Iterable[Module]:
An iterable of `Module` instances.
""" """
return self.modules.values() return self.modules.values()
@@ -71,6 +82,7 @@ class Project:
Return the list of module import paths. Return the list of module import paths.
Returns: Returns:
A list containing the dotted paths of all modules in the project. list[str]:
A list containing the dotted paths of all modules in the project.
""" """
return list(self.modules.keys()) return list(self.modules.keys())

View File

@@ -1,20 +1,15 @@
from typing import Dict, Iterable from collections.abc import Iterable
from docforge.models.module import Module from docforge.models.module import Module
class Project: class Project:
"""Represents a documentation project.""" """Represents a documentation project."""
name: str name: str
modules: Dict[str, Module] modules: dict[str, Module]
def __init__(self, name: str) -> None: ... def __init__(self, name: str) -> None: ...
def add_module(self, module: Module) -> None: ... def add_module(self, module: Module) -> None: ...
def get_module(self, path: str) -> Module: ... def get_module(self, path: str) -> Module: ...
def get_all_modules(self) -> Iterable[Module]: ... def get_all_modules(self) -> Iterable[Module]: ...
def get_module_list(self) -> list[str]: ... def get_module_list(self) -> list[str]: ...

View File

@@ -1,6 +1,6 @@
from .spec import NavSpec, load_nav_spec
from .resolver import ResolvedNav, resolve_nav
from .mkdocs import MkDocsNavEmitter from .mkdocs import MkDocsNavEmitter
from .resolver import ResolvedNav, resolve_nav
from .spec import NavSpec, load_nav_spec
__all__ = [ __all__ = [
"NavSpec", "NavSpec",

View File

@@ -7,7 +7,7 @@ MkDocs ``nav`` configuration.
""" """
from pathlib import Path from pathlib import Path
from typing import List, Dict, Any from typing import Any
from docforge.nav.resolver import ResolvedNav from docforge.nav.resolver import ResolvedNav
@@ -20,7 +20,7 @@ class MkDocsNavEmitter:
list structure expected by the MkDocs ``nav`` configuration field. list structure expected by the MkDocs ``nav`` configuration field.
""" """
def emit(self, nav: ResolvedNav) -> List[Dict[str, Any]]: def emit(self, nav: ResolvedNav) -> list[dict[str, Any]]:
""" """
Generate a navigation structure for ``mkdocs.yml``. Generate a navigation structure for ``mkdocs.yml``.
@@ -33,7 +33,7 @@ class MkDocsNavEmitter:
Each dictionary maps a navigation label to a page or a list of Each dictionary maps a navigation label to a page or a list of
pages. pages.
""" """
result: List[Dict[str, Any]] = [] result: list[dict[str, Any]] = []
# Home entry (semantic path) # Home entry (semantic path)
if nav.home: if nav.home:
@@ -41,7 +41,7 @@ class MkDocsNavEmitter:
# Group entries # Group entries
for group, paths in nav.groups.items(): for group, paths in nav.groups.items():
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
rel_path = self._to_relative(p, nav._docs_root) rel_path = self._to_relative(p, nav._docs_root)
@@ -75,7 +75,7 @@ class MkDocsNavEmitter:
path_str = path.as_posix() path_str = path.as_posix()
docs_root_str = docs_root.as_posix() docs_root_str = docs_root.as_posix()
if path_str.startswith(docs_root_str + "/"): if path_str.startswith(docs_root_str + "/"):
return path_str[len(docs_root_str) + 1:] return path_str[len(docs_root_str) + 1 :]
# Fallback for other cases # Fallback for other cases
return path.as_posix().split("/docs/", 1)[-1] return path.as_posix().split("/docs/", 1)[-1]

View File

@@ -1,15 +1,14 @@
from typing import Dict, List, Any
from pathlib import Path from pathlib import Path
from typing import Any
from docforge.nav.resolver import ResolvedNav from docforge.nav.resolver import ResolvedNav
class MkDocsNavEmitter: class MkDocsNavEmitter:
""" """
Converts a ResolvedNav into MkDocs-compatible `nav` data. Converts a ResolvedNav into MkDocs-compatible `nav` data.
""" """
def emit(self, nav: ResolvedNav) -> List[Dict[str, Any]]: def emit(self, nav: ResolvedNav) -> list[dict[str, Any]]:
""" """
Emit a structure suitable for insertion into mkdocs.yml. Emit a structure suitable for insertion into mkdocs.yml.

View File

@@ -5,10 +5,9 @@ This module resolves a ``NavSpec`` against the filesystem by expanding glob
patterns and validating that referenced documentation files exist. patterns and validating that referenced documentation files exist.
""" """
from pathlib import Path
from typing import Dict, Iterable, List
import glob import glob
from collections.abc import Iterable
from pathlib import Path
from docforge.nav.spec import NavSpec from docforge.nav.spec import NavSpec
@@ -29,7 +28,7 @@ class ResolvedNav:
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:
""" """
@@ -61,8 +60,7 @@ class ResolvedNav:
yield self._docs_root / self.home yield self._docs_root / self.home
for paths in self.groups.values(): for paths in self.groups.values():
for p in paths: yield from paths
yield p
def resolve_nav( def resolve_nav(
@@ -89,7 +87,7 @@ def resolve_nav(
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 glob pattern relative to the documentation root. Resolve a glob pattern relative to the documentation root.
@@ -103,9 +101,7 @@ def resolve_nav(
FileNotFoundError: If the pattern does not match any files. FileNotFoundError: If the pattern does not 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)
)
if not matches: if not matches:
raise FileNotFoundError(pattern) raise FileNotFoundError(pattern)
@@ -121,10 +117,10 @@ def resolve_nav(
home = spec.home home = spec.home
# Resolve navigation groups # Resolve navigation groups
resolved_groups: Dict[str, List[Path]] = {} resolved_groups: dict[str, list[Path]] = {}
for group, patterns in spec.groups.items(): for group, patterns in spec.groups.items():
files: List[Path] = [] files: list[Path] = []
for pattern in patterns: for pattern in patterns:
files.extend(resolve_pattern(pattern)) files.extend(resolve_pattern(pattern))
resolved_groups[group] = files resolved_groups[group] = files

View File

@@ -1,9 +1,8 @@
from collections.abc import Iterable
from pathlib import Path from pathlib import Path
from typing import Dict, List, Iterable, Optional
from docforge.nav.spec import NavSpec from docforge.nav.spec import NavSpec
class ResolvedNav: class ResolvedNav:
""" """
Fully-resolved navigation tree. Fully-resolved navigation tree.
@@ -13,17 +12,16 @@ class ResolvedNav:
- Order is preserved - Order is preserved
""" """
home: Optional[str] home: str | None
groups: Dict[str, List[Path]] groups: dict[str, list[Path]]
_docs_root: Optional[Path] _docs_root: Path | None
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 = ..., docs_root: Path | None = ...,
) -> None: ... ) -> None: ...
def all_files(self) -> Iterable[Path]: def all_files(self) -> Iterable[Path]:
""" """
Return all resolved documentation files in nav order. Return all resolved documentation files in nav order.
@@ -33,7 +31,6 @@ class ResolvedNav:
""" """
... ...
def resolve_nav( def resolve_nav(
spec: NavSpec, spec: NavSpec,
docs_root: Path, docs_root: Path,

View File

@@ -7,7 +7,6 @@ structure defined by the user in the doc-forge navigation specification
""" """
from pathlib import Path from pathlib import Path
from typing import Dict, List, Optional
import yaml import yaml
@@ -28,8 +27,8 @@ class NavSpec:
def __init__( def __init__(
self, self,
home: Optional[str], home: str | None,
groups: Dict[str, List[str]], groups: dict[str, list[str]],
) -> None: ) -> None:
""" """
Initialize a NavSpec instance. Initialize a NavSpec instance.
@@ -85,7 +84,7 @@ 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]:
""" """
Return all path patterns referenced by the specification. Return all path patterns referenced by the specification.
@@ -93,7 +92,7 @@ class NavSpec:
A list containing the home document (if defined) and all A list containing the home document (if defined) and all
group pattern entries. group pattern entries.
""" """
patterns: List[str] = [] patterns: list[str] = []
if self.home: if self.home:
patterns.append(self.home) patterns.append(self.home)

View File

@@ -1,6 +1,4 @@
from pathlib import Path from pathlib import Path
from typing import Dict, List, Optional
class NavSpec: class NavSpec:
""" """
@@ -10,18 +8,16 @@ class NavSpec:
of filesystem structure or MkDocs specifics. of filesystem structure or MkDocs specifics.
""" """
home: Optional[str] home: str | None
groups: Dict[str, List[str]] groups: dict[str, list[str]]
def __init__( def __init__(
self, self,
home: Optional[str], home: str | None,
groups: Dict[str, List[str]], groups: dict[str, list[str]],
) -> None: ) -> None: ...
...
@classmethod @classmethod
def load(cls, path: Path) -> "NavSpec": def load(cls, path: Path) -> NavSpec:
""" """
Load and validate a nav specification from YAML. Load and validate a nav specification from YAML.
@@ -31,12 +27,11 @@ class NavSpec:
""" """
... ...
def all_patterns(self) -> List[str]: def all_patterns(self) -> list[str]:
""" """
Return all path patterns referenced by the spec Return all path patterns referenced by the spec
(including home and group entries). (including home and group entries).
""" """
... ...
def load_nav_spec(path: Path) -> NavSpec: ... def load_nav_spec(path: Path) -> NavSpec: ...

0
docforge/py.typed Normal file
View File

View File

@@ -1,13 +1,14 @@
""" """
# Summary
Renderers layer for doc-forge. Renderers layer for doc-forge.
The ``docforge.renderers`` package transforms the internal documentation The `docforge.renderers` package transforms the internal documentation
models into files formatted for specific documentation systems. models into files formatted for specific documentation systems.
--- ---
Overview # Overview
--------
Renderers consume the doc-forge project model and generate output suitable Renderers consume the doc-forge project model and generate output suitable
for documentation tools or machine interfaces. for documentation tools or machine interfaces.
@@ -15,18 +16,17 @@ for documentation tools or machine interfaces.
Current implementations: Current implementations:
- **MkDocsRenderer** – Produces Markdown files compatible with MkDocs and - **MkDocsRenderer** – Produces Markdown files compatible with MkDocs and
the ``mkdocstrings`` plugin. It automatically handles package hierarchy the `mkdocstrings` plugin. It automatically handles package hierarchy
and generates ``index.md`` files for packages. and generates `index.md` files for packages.
- **MCPRenderer** – Emits structured JSON resources designed for consumption - **MCPRenderer** – Emits structured JSON resources designed for consumption
by Model Context Protocol (MCP) clients. by Model Context Protocol (MCP) clients.
--- ---
Extending # Extending
---------
New renderers can be added by implementing the ``DocRenderer`` protocol New renderers can be added by implementing the `DocRenderer` protocol
defined in ``docforge.renderers.base``. defined in `docforge.renderers.base`.
--- ---
""" """

View File

@@ -1,5 +1,5 @@
from .mkdocs_renderer import MkDocsRenderer
from .mcp_renderer import MCPRenderer from .mcp_renderer import MCPRenderer
from .mkdocs_renderer import MkDocsRenderer
__all__ = [ __all__ = [
"MkDocsRenderer", "MkDocsRenderer",

View File

@@ -1,9 +1,11 @@
""" """
# Summary
Renderer base interfaces and configuration models. Renderer base interfaces and configuration models.
This module defines the base protocol and configuration container used by This module defines the base protocol and configuration container used by
doc-forge renderers. Concrete renderer implementations should implement the doc-forge renderers. Concrete renderer implementations should implement the
``DocRenderer`` protocol. `DocRenderer` protocol.
""" """
from pathlib import Path from pathlib import Path
@@ -16,12 +18,15 @@ class RendererConfig:
""" """
Configuration container for documentation renderers. Configuration container for documentation renderers.
A ``RendererConfig`` instance groups together the project model and the A `RendererConfig` instance groups together the project model and the
output directory used during rendering. output directory used during rendering.
Attributes: Attributes:
out_dir: Directory where generated documentation files will be written. out_dir (Path):
project: Documentation project model to be rendered. Directory where generated documentation files will be written.
project (Project):
Documentation project model to be rendered.
""" """
def __init__(self, out_dir: Path, project: Project) -> None: def __init__(self, out_dir: Path, project: Project) -> None:
@@ -29,8 +34,11 @@ class RendererConfig:
Initialize a RendererConfig instance. Initialize a RendererConfig instance.
Args: Args:
out_dir: Target directory where documentation files should be written. out_dir (Path):
project: Introspected project model to render. Target directory where documentation files should be written.
project (Project):
Introspected project model to render.
""" """
self.out_dir = out_dir self.out_dir = out_dir
self.project = project self.project = project
@@ -41,7 +49,7 @@ class DocRenderer(Protocol):
Protocol defining the interface for documentation renderers. Protocol defining the interface for documentation renderers.
Implementations of this protocol are responsible for transforming a Implementations of this protocol are responsible for transforming a
``Project`` model into renderer-specific documentation sources. `Project` model into renderer-specific documentation sources.
""" """
name: str name: str
@@ -55,8 +63,10 @@ class DocRenderer(Protocol):
Generate renderer-specific documentation sources. Generate renderer-specific documentation sources.
Args: Args:
project: Project model containing modules and documentation objects. project (Project):
out_dir: Directory where generated documentation sources Project model containing modules and documentation objects.
should be written.
out_dir (Path):
Directory where generated documentation sources should be written.
""" """
... ...

View File

@@ -3,7 +3,6 @@ from typing import Protocol
from docforge.models import Project from docforge.models import Project
class RendererConfig: class RendererConfig:
"""Renderer configuration container.""" """Renderer configuration container."""
@@ -12,7 +11,6 @@ class RendererConfig:
def __init__(self, out_dir: Path, project: Project) -> None: ... def __init__(self, out_dir: Path, project: Project) -> None: ...
class DocRenderer(Protocol): class DocRenderer(Protocol):
"""Renderer interface.""" """Renderer interface."""

View File

@@ -1,8 +1,16 @@
"""
# Summary
MCP renderer implementation.
This module defines the `MCPRenderer` class, which generates documentation
resources compatible with the Model Context Protocol (MCP).
"""
import json import json
from pathlib import Path from pathlib import Path
from typing import Dict, List
from docforge.models import Project, Module, DocObject from docforge.models import DocObject, Module, Project
class MCPRenderer: class MCPRenderer:
@@ -21,24 +29,29 @@ class MCPRenderer:
Generate MCP documentation resources for a project. Generate MCP documentation resources for a project.
The renderer serializes each module into a JSON resource and produces The renderer serializes each module into a JSON resource and produces
supporting metadata files such as ``nav.json`` and ``index.json``. supporting metadata files such as `nav.json` and `index.json`.
Args: Args:
project: Documentation project model to render. project (Project):
out_dir: Directory where MCP resources will be written. Documentation project model to render.
out_dir (Path):
Directory where MCP resources will be written.
""" """
modules_dir = out_dir / "modules" modules_dir = out_dir / "modules"
modules_dir.mkdir(parents=True, exist_ok=True) modules_dir.mkdir(parents=True, exist_ok=True)
nav: List[Dict[str, str]] = [] nav: list[dict[str, str]] = []
for module in project.get_all_modules(): for module in project.get_all_modules():
self._write_module(module, modules_dir) self._write_module(module, modules_dir)
nav.append({ nav.append(
"module": module.path, {
"resource": f"doc://modules/{module.path}", "module": module.path,
}) "resource": f"doc://modules/{module.path}",
}
)
# Write nav.json # Write nav.json
(out_dir / "nav.json").write_text( (out_dir / "nav.json").write_text(
@@ -64,8 +77,11 @@ class MCPRenderer:
Serialize a module into an MCP resource file. Serialize a module into an MCP resource file.
Args: Args:
module: Module instance to serialize. module (Module):
modules_dir: Directory where module JSON files are stored. Module instance to serialize.
modules_dir (Path):
Directory where module JSON files are stored.
""" """
payload = { payload = {
"module": module.path, "module": module.path,
@@ -76,17 +92,19 @@ class MCPRenderer:
out.parent.mkdir(parents=True, exist_ok=True) out.parent.mkdir(parents=True, exist_ok=True)
out.write_text(self._json(payload), encoding="utf-8") out.write_text(self._json(payload), encoding="utf-8")
def _render_module(self, module: Module) -> Dict: def _render_module(self, module: Module) -> dict:
""" """
Convert a Module model into MCP-compatible structured data. Convert a Module model into MCP-compatible structured data.
Args: Args:
module: Module instance to convert. module (Module):
Module instance to convert.
Returns: Returns:
Dictionary representing the module and its documented objects. Dict:
Dictionary representing the module and its documented objects.
""" """
data: Dict = { data: dict = {
"path": module.path, "path": module.path,
"docstring": module.docstring, "docstring": module.docstring,
"objects": {}, "objects": {},
@@ -97,17 +115,19 @@ class MCPRenderer:
return data return data
def _render_object(self, obj: DocObject) -> Dict: def _render_object(self, obj: DocObject) -> dict:
""" """
Recursively convert a DocObject into structured MCP data. Recursively convert a DocObject into structured MCP data.
Args: Args:
obj: Documentation object to convert. obj (DocObject):
Documentation object to convert.
Returns: Returns:
Dictionary describing the object and any nested members. Dict:
Dictionary describing the object and any nested members.
""" """
data: Dict = { data: dict = {
"name": obj.name, "name": obj.name,
"kind": obj.kind, "kind": obj.kind,
"path": obj.path, "path": obj.path,
@@ -118,21 +138,22 @@ class MCPRenderer:
members = list(obj.get_all_members()) members = list(obj.get_all_members())
if members: if members:
data["members"] = { data["members"] = {
member.name: self._render_object(member) member.name: self._render_object(member) for member in members
for member in members
} }
return data return data
@staticmethod @staticmethod
def _json(data: Dict) -> str: def _json(data: dict) -> str:
""" """
Serialize data to formatted JSON. Serialize data to formatted JSON.
Args: Args:
data: Dictionary to serialize. data (Dict):
Dictionary to serialize.
Returns: Returns:
JSON string formatted with indentation and UTF-8 compatibility. str:
JSON string formatted with indentation and UTF-8 compatibility.
""" """
return json.dumps(data, indent=2, ensure_ascii=False) return json.dumps(data, indent=2, ensure_ascii=False)

View File

@@ -1,8 +1,7 @@
from pathlib import Path from pathlib import Path
from typing import Dict, List from typing import Any
from docforge.models import Project, Module, DocObject
from docforge.models import DocObject, Module, Project
class MCPRenderer: class MCPRenderer:
"""Renderer that emits MCP-native JSON resources from docforge models.""" """Renderer that emits MCP-native JSON resources from docforge models."""
@@ -15,12 +14,12 @@ class MCPRenderer:
def _write_module(self, module: Module, modules_dir: Path) -> None: def _write_module(self, module: Module, modules_dir: Path) -> None:
"""Serialize a module into an MCP JSON resource.""" """Serialize a module into an MCP JSON resource."""
def _render_module(self, module: Module) -> Dict: def _render_module(self, module: Module) -> dict[str, Any]:
"""Render a Module into MCP-friendly structured data.""" """Render a Module into MCP-friendly structured data."""
def _render_object(self, obj: DocObject) -> Dict: def _render_object(self, obj: DocObject) -> dict[str, Any]:
"""Recursively render a DocObject into structured MCP data.""" """Recursively render a DocObject into structured MCP data."""
@staticmethod @staticmethod
def _json(data: Dict) -> str: def _json(data: dict[str, Any]) -> str:
"""Serialize structured data to formatted JSON.""" """Serialize structured data to formatted JSON."""

View File

@@ -1,20 +1,23 @@
""" """
# Summary
MkDocs renderer implementation. MkDocs renderer implementation.
This module defines the ``MkDocsRenderer`` class, which generates Markdown This module defines the `MkDocsRenderer` class, which generates Markdown
documentation sources compatible with MkDocs Material and the mkdocstrings documentation sources compatible with MkDocs Material and the mkdocstrings
plugin. plugin.
The renderer ensures a consistent documentation structure by: The renderer ensures a consistent documentation structure by:
- Creating a root ``index.md`` if one does not exist - Creating a root `index.md` if one does not exist
- Generating package index pages automatically - Generating package index pages automatically
- Linking child modules within parent package pages - Linking child modules within parent package pages
- Optionally generating ``README.md`` from the root package docstring - Optionally generating `README.md` from the root package docstring
""" """
from pathlib import Path from pathlib import Path
from docforge.models import Project, Module
from docforge.models import Module, Project
class MkDocsRenderer: class MkDocsRenderer:
@@ -45,10 +48,15 @@ class MkDocsRenderer:
specified output directory. specified output directory.
Args: Args:
project: Project model containing modules to document. project (Project):
out_dir: Directory where generated Markdown files will be written. Project model containing modules to document.
module_is_source: If True, treat the specified module as the
documentation root rather than nesting it inside a folder. out_dir (Path):
Directory where generated Markdown files will be written.
module_is_source (bool, optional):
If True, treat the specified module as the documentation root
rather than nesting it inside a folder.
""" """
out_dir.mkdir(parents=True, exist_ok=True) out_dir.mkdir(parents=True, exist_ok=True)
self._ensure_root_index(project, out_dir) self._ensure_root_index(project, out_dir)
@@ -58,8 +66,7 @@ class MkDocsRenderer:
# Detect packages (modules with children) # Detect packages (modules with children)
packages = { packages = {
p for p in paths p for p in paths if any(other.startswith(p + ".") for other in paths)
if any(other.startswith(p + ".") for other in paths)
} }
for module in modules: for module in modules:
@@ -77,19 +84,23 @@ class MkDocsRenderer:
module_is_source: bool | None = None, module_is_source: bool | None = None,
) -> None: ) -> None:
""" """
Generate a ``README.md`` file from the root module docstring. Generate a `README.md` file from the root module docstring.
Behavior: Behavior:
- If ``module_is_source`` is True, ``README.md`` is written to the - If `module_is_source` is True, `README.md` is written to the project
project root directory. root directory.
- If False, README generation is currently not implemented. - If False, README generation is currently not implemented.
Args: Args:
project: Project model containing documentation metadata. project (Project):
docs_dir: Directory containing generated documentation sources. Project model containing documentation metadata.
module_is_source: Whether the module is treated as the project
source root. docs_dir (Path):
Directory containing generated documentation sources.
module_is_source (bool, optional):
Whether the module is treated as the project source root.
""" """
if not module_is_source: if not module_is_source:
@@ -116,12 +127,12 @@ class MkDocsRenderer:
str(root_module.docstring), str(root_module.docstring),
) )
content = ( content = f"# {project.name}\n\n" f"{doc.strip()}\n"
f"# {project.name}\n\n"
f"{doc.strip()}\n"
)
if not readme_path.exists() or readme_path.read_text(encoding="utf-8") != content: if (
not readme_path.exists()
or readme_path.read_text(encoding="utf-8") != content
):
readme_path.write_text( readme_path.write_text(
content, content,
encoding="utf-8", encoding="utf-8",
@@ -136,10 +147,12 @@ class MkDocsRenderer:
Locate the root module corresponding to the project name. Locate the root module corresponding to the project name.
Args: Args:
project: Project model to inspect. project (Project):
Project model to inspect.
Returns: Returns:
The root ``Module`` if found, otherwise ``None``. Optional[Module]:
The root `Module` if found, otherwise `None`.
""" """
for module in project.get_all_modules(): for module in project.get_all_modules():
if module.path == project.name: if module.path == project.name:
@@ -156,16 +169,22 @@ class MkDocsRenderer:
""" """
Write documentation for a single module. Write documentation for a single module.
Package modules are rendered as ``index.md`` files inside their Package modules are rendered as `index.md` files inside their
corresponding directories, while leaf modules are written as corresponding directories, while leaf modules are written as
standalone Markdown pages. standalone Markdown pages.
Args: Args:
module: Module to render. module (Module):
packages: Set of module paths identified as packages. Module to render.
out_dir: Base directory for generated documentation files.
module_is_source: Whether the module acts as the documentation packages (set[str]):
root directory. Set of module paths identified as packages.
out_dir (Path):
Base directory for generated documentation files.
module_is_source (bool, optional):
Whether the module acts as the documentation root directory.
""" """
parts = module.path.split(".") parts = module.path.split(".")
@@ -202,16 +221,17 @@ class MkDocsRenderer:
Generate Markdown content for a module documentation page. Generate Markdown content for a module documentation page.
Args: Args:
title: Page title displayed in the documentation. title (str):
module_path: Dotted import path of the module. Page title displayed in the documentation.
module_path (str):
Dotted import path of the module.
Returns: Returns:
Markdown source containing a mkdocstrings directive. str:
Markdown source containing a mkdocstrings directive.
""" """
return ( return f"# {title}\n\n" f"::: {module_path}\n"
f"# {title}\n\n"
f"::: {module_path}\n"
)
def _ensure_root_index( def _ensure_root_index(
self, self,
@@ -219,18 +239,20 @@ class MkDocsRenderer:
out_dir: Path, out_dir: Path,
) -> None: ) -> None:
""" """
Ensure that the root ``index.md`` page exists. Ensure that the root `index.md` page exists.
Args: Args:
project: Project model used for the page title. project (Project):
out_dir: Documentation output directory. Project model used for the page title.
out_dir (Path):
Documentation output directory.
""" """
root_index = out_dir / "index.md" root_index = out_dir / "index.md"
if not root_index.exists(): if not root_index.exists():
root_index.write_text( root_index.write_text(
f"# {project.name}\n\n" f"# {project.name}\n\n" "## Modules\n\n",
"## Modules\n\n",
encoding="utf-8", encoding="utf-8",
) )
@@ -246,10 +268,17 @@ class MkDocsRenderer:
child modules. child modules.
Args: Args:
parts: Module path components. parts (list[str]):
out_dir: Documentation output directory. Module path components.
link_target: Link target used in the parent index.
title: Display title for the link. out_dir (Path):
Documentation output directory.
link_target (str):
Link target used in the parent index.
title (str):
Display title for the link.
""" """
if len(parts) == 1: if len(parts) == 1:
parent_index = out_dir / "index.md" parent_index = out_dir / "index.md"

View File

@@ -1,6 +1,6 @@
from pathlib import Path from pathlib import Path
from docforge.models import Project, Module
from docforge.models import Module, Project
class MkDocsRenderer: class MkDocsRenderer:
name: str name: str
@@ -11,14 +11,12 @@ class MkDocsRenderer:
out_dir: Path, out_dir: Path,
module_is_source: bool | None = None, module_is_source: bool | None = None,
) -> None: ... ) -> None: ...
def generate_readme( def generate_readme(
self, self,
project: Project, project: Project,
docs_dir: Path, docs_dir: Path,
module_is_source: bool | None = None, module_is_source: bool | None = None,
) -> None: ) -> None: ...
def _write_module( def _write_module(
self, self,
module: Module, module: Module,
@@ -26,9 +24,8 @@ class MkDocsRenderer:
out_dir: Path, out_dir: Path,
module_is_source: bool | None = None, module_is_source: bool | None = None,
) -> None: ... ) -> None: ...
def _render_markdown(self, title: str, module_path: str) -> str: ... def _render_markdown(self, title: str, module_path: str) -> str: ...
def _ensure_root_index(self, project: Project, out_dir: Path) -> None: ...
def _ensure_root_index(self, project, out_dir) -> None: ... def _ensure_parent_index(
self, parts: list[str], out_dir: Path, link_target: str, title: str
def _ensure_parent_index(self, parts, out_dir, link_target, title) -> None: ... ) -> None: ...

View File

@@ -1,4 +1,6 @@
""" """
# Summary
Server layer for doc-forge. Server layer for doc-forge.
This module exposes server implementations used to provide live access This module exposes server implementations used to provide live access

View File

@@ -1,3 +1,12 @@
"""
# Summary
MCP server implementation.
This module defines the `MCPServer` class, which serves pre-generated
documentation bundles through the Model Context Protocol (MCP).
"""
from __future__ import annotations from __future__ import annotations
import json import json
@@ -20,10 +29,12 @@ class MCPServer:
Initialize the MCP server. Initialize the MCP server.
Args: Args:
mcp_root: Directory containing the generated MCP documentation mcp_root (Path):
bundle (for example ``index.json``, ``nav.json``, and Directory containing the generated MCP documentation bundle
``modules/``). (for example `index.json`, `nav.json`, and `modules/`).
name: Identifier used for the MCP server instance.
name (str):
Identifier used for the MCP server instance.
""" """
self.mcp_root = mcp_root self.mcp_root = mcp_root
self.app = FastMCP(name) self.app = FastMCP(name)
@@ -43,11 +54,13 @@ class MCPServer:
instead of raising an exception. instead of raising an exception.
Args: Args:
path: Path to the JSON file to read. path (Path):
Path to the JSON file to read.
Returns: Returns:
Parsed JSON data if the file exists, otherwise an error dictionary Any:
describing the missing resource. Parsed JSON data if the file exists, otherwise an error dictionary
describing the missing resource.
""" """
if not path.exists(): if not path.exists():
return { return {
@@ -68,9 +81,9 @@ class MCPServer:
The server exposes documentation resources through the following The server exposes documentation resources through the following
endpoints: endpoints:
- ``docs://index`` – Project metadata - `docs://index` – Project metadata
- ``docs://nav`` – Navigation structure - `docs://nav` – Navigation structure
- ``docs://modules/{module}`` – Individual module documentation - `docs://modules/{module}` – Individual module documentation
""" """
@self.app.resource("docs://index") @self.app.resource("docs://index")
@@ -83,9 +96,7 @@ class MCPServer:
@self.app.resource("docs://modules/{module}") @self.app.resource("docs://modules/{module}")
def module(module: str): def module(module: str):
return self._read_json( return self._read_json(self.mcp_root / "modules" / f"{module}.json")
self.mcp_root / "modules" / f"{module}.json"
)
# ------------------------------------------------------------------ # ------------------------------------------------------------------
# MCP tools # MCP tools
@@ -116,7 +127,8 @@ class MCPServer:
Start the MCP server. Start the MCP server.
Args: Args:
transport: Transport mechanism used by the MCP server. Supported transport (Literal["stdio", "sse", "streamable-http"]):
options include ``stdio``, ``sse``, and ``streamable-http``. Transport mechanism used by the MCP server. Supported options
include `stdio`, `sse`, and `streamable-http`.
""" """
self.app.run(transport=transport) self.app.run(transport=transport)

View File

@@ -1,9 +1,8 @@
from pathlib import Path from pathlib import Path
from typing import Literal, Any from typing import Any, Literal
from mcp.server.fastmcp import FastMCP from mcp.server.fastmcp import FastMCP
class MCPServer: class MCPServer:
"""MCP server for serving documentation.""" """MCP server for serving documentation."""
@@ -11,12 +10,8 @@ class MCPServer:
app: FastMCP app: FastMCP
def __init__(self, mcp_root: Path, name: str) -> None: ... def __init__(self, mcp_root: Path, name: str) -> None: ...
def _read_json(self, path: Path) -> Any: ... def _read_json(self, path: Path) -> Any: ...
def _register_resources(self) -> None: ... def _register_resources(self) -> None: ...
def _register_tools(self) -> None: ... def _register_tools(self) -> None: ...
def run(self, transport: Literal["stdio", "sse", "streamable-http"] = ...) -> None: def run(self, transport: Literal["stdio", "sse", "streamable-http"] = ...) -> None:
"""Start the MCP server.""" """Start the MCP server."""

View File

@@ -2,7 +2,7 @@
"module": "docforge.cli.commands", "module": "docforge.cli.commands",
"content": { "content": {
"path": "docforge.cli.commands", "path": "docforge.cli.commands",
"docstring": null, "docstring": "# Summary\n\nCommand definitions for the doc-forge CLI.\n\nProvides the CLI structure using Click, including build, serve, and tree commands.",
"objects": { "objects": {
"click": { "click": {
"name": "click", "name": "click",
@@ -37,21 +37,21 @@
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.GriffeLoader", "path": "docforge.cli.commands.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>", "signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.", "docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into `Project`, `Module`,\nand `DocObject` instances used by doc-forge.",
"members": { "members": {
"load_project": { "load_project": {
"name": "load_project", "name": "load_project",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.GriffeLoader.load_project", "path": "docforge.cli.commands.GriffeLoader.load_project",
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>", "signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False." "docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a `Module`\ninstance. All modules are then aggregated into a single `Project`\nobject.\n\nArgs:\n module_paths (List[str]):\n List of dotted module import paths to load.\n\n project_name (str, optional):\n Optional override for the project name. Defaults to the top-level\n name of the first module.\n\n skip_import_errors (bool, optional):\n If True, modules that fail to load will be skipped instead of raising an error.\n\nReturns:\n Project:\n A populated `Project` instance containing the loaded modules.\n\nRaises:\n ValueError:\n If no module paths are provided.\n\n ImportError:\n If a module fails to load and `skip_import_errors` is False."
}, },
"load_module": { "load_module": {
"name": "load_module", "name": "load_module",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.GriffeLoader.load_module", "path": "docforge.cli.commands.GriffeLoader.load_module",
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>", "signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance." "docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge `Module` model.\n\nArgs:\n path (str):\n Dotted import path of the module.\n\nReturns:\n Module:\n A populated `Module` instance."
} }
} }
}, },
@@ -60,7 +60,7 @@
"kind": "module", "kind": "module",
"path": "docforge.cli.commands.mkdocs_utils", "path": "docforge.cli.commands.mkdocs_utils",
"signature": "<bound method Alias.signature of Alias('mkdocs_utils', 'docforge.cli.mkdocs_utils')>", "signature": "<bound method Alias.signature of Alias('mkdocs_utils', 'docforge.cli.mkdocs_utils')>",
"docstring": null, "docstring": "# Summary\n\nUtilities for working with MkDocs in the doc-forge CLI.",
"members": { "members": {
"Path": { "Path": {
"name": "Path", "name": "Path",
@@ -95,21 +95,21 @@
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mkdocs_utils.GriffeLoader", "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mkdocs_utils.GriffeLoader')>", "signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mkdocs_utils.GriffeLoader')>",
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.", "docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into `Project`, `Module`,\nand `DocObject` instances used by doc-forge.",
"members": { "members": {
"load_project": { "load_project": {
"name": "load_project", "name": "load_project",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_project", "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_project",
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>", "signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False." "docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a `Module`\ninstance. All modules are then aggregated into a single `Project`\nobject.\n\nArgs:\n module_paths (List[str]):\n List of dotted module import paths to load.\n\n project_name (str, optional):\n Optional override for the project name. Defaults to the top-level\n name of the first module.\n\n skip_import_errors (bool, optional):\n If True, modules that fail to load will be skipped instead of raising an error.\n\nReturns:\n Project:\n A populated `Project` instance containing the loaded modules.\n\nRaises:\n ValueError:\n If no module paths are provided.\n\n ImportError:\n If a module fails to load and `skip_import_errors` is False."
}, },
"load_module": { "load_module": {
"name": "load_module", "name": "load_module",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_module", "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_module",
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>", "signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance." "docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge `Module` model.\n\nArgs:\n path (str):\n Dotted import path of the module.\n\nReturns:\n Module:\n A populated `Module` instance."
} }
} }
}, },
@@ -118,7 +118,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.discover_module_paths", "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')>", "signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mkdocs_utils.discover_module_paths')>",
"docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for ``.py`` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing ``__init__.py`` are treated as packages.\n- Each ``.py`` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name: Top-level package name to discover modules from.\n project_root: Root directory used to resolve module paths. If not\n provided, the current working directory is used.\n\nReturns:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError: If the specified package directory does not exist." "docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for `.py` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing `__init__.py` are treated as packages.\n- Each `.py` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name (str):\n Top-level package name to discover modules from.\n\n project_root (Path, optional):\n Root directory used to resolve module paths. If not provided, the\n current working directory is used.\n\nReturns:\n List[str]:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError:\n If the specified package directory does not exist."
}, },
"MkDocsRenderer": { "MkDocsRenderer": {
"name": "MkDocsRenderer", "name": "MkDocsRenderer",
@@ -139,14 +139,14 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.generate_sources", "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')>", "signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
"docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project: Project model containing modules to document.\n out_dir: Directory where generated Markdown files will be written.\n module_is_source: If True, treat the specified module as the\n documentation root rather than nesting it inside a folder." "docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project (Project):\n Project model containing modules to document.\n\n out_dir (Path):\n Directory where generated Markdown files will be written.\n\n module_is_source (bool, optional):\n If True, treat the specified module as the documentation root\n rather than nesting it inside a folder."
}, },
"generate_readme": { "generate_readme": {
"name": "generate_readme", "name": "generate_readme",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.generate_readme", "path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.generate_readme",
"signature": "<bound method Alias.signature of Alias('generate_readme', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme')>", "signature": "<bound method Alias.signature of Alias('generate_readme', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme')>",
"docstring": "Generate a ``README.md`` file from the root module docstring.\n\nBehavior:\n\n- If ``module_is_source`` is True, ``README.md`` is written to the\n project root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project: Project model containing documentation metadata.\n docs_dir: Directory containing generated documentation sources.\n module_is_source: Whether the module is treated as the project\n source root." "docstring": "Generate a `README.md` file from the root module docstring.\n\nBehavior:\n\n- If `module_is_source` is True, `README.md` is written to the project\n root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project (Project):\n Project model containing documentation metadata.\n\n docs_dir (Path):\n Directory containing generated documentation sources.\n\n module_is_source (bool, optional):\n Whether the module is treated as the project source root."
} }
} }
}, },
@@ -185,28 +185,28 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.generate_sources", "path": "docforge.cli.commands.mkdocs_utils.generate_sources",
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.cli.mkdocs_utils.generate_sources')>", "signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.cli.mkdocs_utils.generate_sources')>",
"docstring": "Generate MkDocs Markdown sources for a Python module.\n\nThis function introspects the specified module, builds the internal\ndocumentation model, and renders Markdown documentation files for\nuse with MkDocs.\n\nArgs:\n module: Python module import path used as the entry point for\n documentation generation.\n docs_dir: Directory where the generated Markdown files will be written.\n project_name: Optional override for the project name used in\n documentation metadata.\n module_is_source: If True, treat the specified module directory as\n the project root rather than a nested module." "docstring": "Generate MkDocs Markdown sources for a Python module.\n\nThis function introspects the specified module, builds the internal\ndocumentation model, and renders Markdown documentation files for\nuse with MkDocs.\n\nArgs:\n module (str):\n Python module import path used as the entry point for\n documentation generation.\n\n docs_dir (Path):\n Directory where the generated Markdown files will be written.\n\n project_name (Optional[str]):\n Optional override for the project name used in documentation metadata.\n\n module_is_source (Optional[bool]):\n If True, treat the specified module directory as the project root\n rather than a nested module."
}, },
"generate_config": { "generate_config": {
"name": "generate_config", "name": "generate_config",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.generate_config", "path": "docforge.cli.commands.mkdocs_utils.generate_config",
"signature": "<bound method Alias.signature of Alias('generate_config', 'docforge.cli.mkdocs_utils.generate_config')>", "signature": "<bound method Alias.signature of Alias('generate_config', 'docforge.cli.mkdocs_utils.generate_config')>",
"docstring": "Generate an ``mkdocs.yml`` configuration file.\n\nThe configuration is created by combining a template configuration\nwith a navigation structure derived from the docforge navigation\nspecification.\n\nArgs:\n docs_dir: Directory containing generated documentation Markdown files.\n nav_file: Path to the ``docforge.nav.yml`` navigation specification.\n template: Optional path to a custom MkDocs configuration template.\n If not provided, a built-in template will be used.\n out: Destination path where the generated ``mkdocs.yml`` file\n will be written.\n site_name: Display name for the generated documentation site.\n\nRaises:\n click.FileError: If the navigation specification or template\n file cannot be found." "docstring": "Generate an `mkdocs.yml` configuration file.\n\nThe configuration is created by combining a template configuration\nwith a navigation structure derived from the docforge navigation\nspecification.\n\nArgs:\n docs_dir (Path):\n Directory containing generated documentation Markdown files.\n\n nav_file (Path):\n Path to the `docforge.nav.yml` navigation specification.\n\n template (Optional[Path]):\n Optional path to a custom MkDocs configuration template. If not\n provided, a built-in template will be used.\n\n out (Path):\n Destination path where the generated `mkdocs.yml` file will be written.\n\n site_name (str):\n Display name for the generated documentation site.\n\nRaises:\n click.FileError:\n If the navigation specification or template file cannot be found."
}, },
"build": { "build": {
"name": "build", "name": "build",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.build", "path": "docforge.cli.commands.mkdocs_utils.build",
"signature": "<bound method Alias.signature of Alias('build', 'docforge.cli.mkdocs_utils.build')>", "signature": "<bound method Alias.signature of Alias('build', 'docforge.cli.mkdocs_utils.build')>",
"docstring": "Build the MkDocs documentation site.\n\nThis function loads the MkDocs configuration and runs the MkDocs\nbuild command to generate the final static documentation site.\n\nArgs:\n mkdocs_yml: Path to the ``mkdocs.yml`` configuration file.\n\nRaises:\n click.ClickException: If the configuration file does not exist." "docstring": "Build the MkDocs documentation site.\n\nThis function loads the MkDocs configuration and runs the MkDocs\nbuild command to generate the final static documentation site.\n\nArgs:\n mkdocs_yml (Path):\n Path to the `mkdocs.yml` configuration file.\n\nRaises:\n click.ClickException:\n If the configuration file does not exist."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.serve", "path": "docforge.cli.commands.mkdocs_utils.serve",
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mkdocs_utils.serve')>", "signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mkdocs_utils.serve')>",
"docstring": "Start an MkDocs development server with live reload.\n\nThe server watches documentation files and automatically reloads\nthe site when changes are detected.\n\nArgs:\n mkdocs_yml: Path to the ``mkdocs.yml`` configuration file.\n\nRaises:\n click.ClickException: If the configuration file does not exist." "docstring": "Start an MkDocs development server with live reload.\n\nThe server watches documentation files and automatically reloads\nthe site when changes are detected.\n\nArgs:\n mkdocs_yml (Path):\n Path to the `mkdocs.yml` configuration file.\n\nRaises:\n click.ClickException:\n If the configuration file does not exist."
} }
} }
}, },
@@ -215,7 +215,7 @@
"kind": "module", "kind": "module",
"path": "docforge.cli.commands.mcp_utils", "path": "docforge.cli.commands.mcp_utils",
"signature": "<bound method Alias.signature of Alias('mcp_utils', 'docforge.cli.mcp_utils')>", "signature": "<bound method Alias.signature of Alias('mcp_utils', 'docforge.cli.mcp_utils')>",
"docstring": null, "docstring": "# Summary\n\nUtilities for working with MCP in the doc-forge CLI.",
"members": { "members": {
"Path": { "Path": {
"name": "Path", "name": "Path",
@@ -236,21 +236,21 @@
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mcp_utils.GriffeLoader", "path": "docforge.cli.commands.mcp_utils.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mcp_utils.GriffeLoader')>", "signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mcp_utils.GriffeLoader')>",
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.", "docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into `Project`, `Module`,\nand `DocObject` instances used by doc-forge.",
"members": { "members": {
"load_project": { "load_project": {
"name": "load_project", "name": "load_project",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_project", "path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_project",
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>", "signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False." "docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a `Module`\ninstance. All modules are then aggregated into a single `Project`\nobject.\n\nArgs:\n module_paths (List[str]):\n List of dotted module import paths to load.\n\n project_name (str, optional):\n Optional override for the project name. Defaults to the top-level\n name of the first module.\n\n skip_import_errors (bool, optional):\n If True, modules that fail to load will be skipped instead of raising an error.\n\nReturns:\n Project:\n A populated `Project` instance containing the loaded modules.\n\nRaises:\n ValueError:\n If no module paths are provided.\n\n ImportError:\n If a module fails to load and `skip_import_errors` is False."
}, },
"load_module": { "load_module": {
"name": "load_module", "name": "load_module",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_module", "path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_module",
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>", "signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance." "docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge `Module` model.\n\nArgs:\n path (str):\n Dotted import path of the module.\n\nReturns:\n Module:\n A populated `Module` instance."
} }
} }
}, },
@@ -259,7 +259,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.discover_module_paths", "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')>", "signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mcp_utils.discover_module_paths')>",
"docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for ``.py`` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing ``__init__.py`` are treated as packages.\n- Each ``.py`` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name: Top-level package name to discover modules from.\n project_root: Root directory used to resolve module paths. If not\n provided, the current working directory is used.\n\nReturns:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError: If the specified package directory does not exist." "docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for `.py` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing `__init__.py` are treated as packages.\n- Each `.py` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name (str):\n Top-level package name to discover modules from.\n\n project_root (Path, optional):\n Root directory used to resolve module paths. If not provided, the\n current working directory is used.\n\nReturns:\n List[str]:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError:\n If the specified package directory does not exist."
}, },
"MCPRenderer": { "MCPRenderer": {
"name": "MCPRenderer", "name": "MCPRenderer",
@@ -280,7 +280,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.MCPRenderer.generate_sources", "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')>", "signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>",
"docstring": "Generate MCP documentation resources for a project.\n\nThe renderer serializes each module into a JSON resource and produces\nsupporting metadata files such as ``nav.json`` and ``index.json``.\n\nArgs:\n project: Documentation project model to render.\n out_dir: Directory where MCP resources will be written." "docstring": "Generate MCP documentation resources for a project.\n\nThe renderer serializes each module into a JSON resource and produces\nsupporting metadata files such as `nav.json` and `index.json`.\n\nArgs:\n project (Project):\n Documentation project model to render.\n\n out_dir (Path):\n Directory where MCP resources will be written."
} }
} }
}, },
@@ -310,7 +310,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.MCPServer.run", "path": "docforge.cli.commands.mcp_utils.MCPServer.run",
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>", "signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>",
"docstring": "Start the MCP server.\n\nArgs:\n transport: Transport mechanism used by the MCP server. Supported\n options include ``stdio``, ``sse``, and ``streamable-http``." "docstring": "Start the MCP server.\n\nArgs:\n transport (Literal[\"stdio\", \"sse\", \"streamable-http\"]):\n Transport mechanism used by the MCP server. Supported options\n include `stdio`, `sse`, and `streamable-http`."
} }
} }
}, },
@@ -319,14 +319,14 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.generate_resources", "path": "docforge.cli.commands.mcp_utils.generate_resources",
"signature": "<bound method Alias.signature of Alias('generate_resources', 'docforge.cli.mcp_utils.generate_resources')>", "signature": "<bound method Alias.signature of Alias('generate_resources', 'docforge.cli.mcp_utils.generate_resources')>",
"docstring": "Generate MCP documentation resources from a Python module.\n\nThe function performs project introspection, builds the internal\ndocumentation model, and renders MCP-compatible JSON resources\nto the specified output directory.\n\nArgs:\n module: Python module import path used as the entry point for\n documentation generation.\n project_name: Optional override for the project name used in\n generated documentation metadata.\n out_dir: Directory where MCP resources (index.json, nav.json,\n and module data) will be written." "docstring": "Generate MCP documentation resources from a Python module.\n\nThe function performs project introspection, builds the internal\ndocumentation model, and renders MCP-compatible JSON resources\nto the specified output directory.\n\nArgs:\n module (str):\n Python module import path used as the entry point for\n documentation generation.\n\n project_name (Optional[str]):\n Optional override for the project name used in generated\n documentation metadata.\n\n out_dir (Path):\n Directory where MCP resources (index.json, nav.json, and module data)\n will be written."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.serve", "path": "docforge.cli.commands.mcp_utils.serve",
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp_utils.serve')>", "signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp_utils.serve')>",
"docstring": "Start an MCP server for a pre-generated documentation bundle.\n\nThe server exposes documentation resources such as project metadata,\nnavigation structure, and module documentation through MCP endpoints.\n\nArgs:\n module: Python module import path used to identify the served\n documentation instance.\n mcp_root: Path to the directory containing the MCP documentation\n bundle (index.json, nav.json, and modules/).\n\nRaises:\n click.ClickException: If the MCP documentation bundle is missing\n required files or directories." "docstring": "Start an MCP server for a pre-generated documentation bundle.\n\nThe server exposes documentation resources such as project metadata,\nnavigation structure, and module documentation through MCP endpoints.\n\nArgs:\n module (str):\n Python module import path used to identify the served\n documentation instance.\n\n mcp_root (Path):\n Path to the directory containing the MCP documentation\n bundle (index.json, nav.json, and modules/).\n\nRaises:\n click.ClickException:\n If the MCP documentation bundle is missing required files or directories."
} }
} }
}, },
@@ -341,22 +341,22 @@
"name": "build", "name": "build",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.build", "path": "docforge.cli.commands.build",
"signature": "<bound method Function.signature of Function('build', 20, 108)>", "signature": "<bound method Function.signature of Function('build', 28, 136)>",
"docstring": "Build documentation artifacts.\n\nThis command performs the full documentation build pipeline:\n\n1. Introspects the Python project using Griffe\n2. Generates renderer-specific documentation sources\n3. Optionally builds the final documentation output\n\nDepending on the selected options, the build can target:\n\n- MkDocs static documentation sites\n- MCP structured documentation resources\n\nArgs:\n mcp: Enable MCP documentation generation.\n mkdocs: Enable MkDocs documentation generation.\n module_is_source: Treat the specified module directory as the\n project root.\n module: Python module import path to document.\n project_name: Optional override for the project name.\n site_name: Display name for the MkDocs site.\n docs_dir: Directory where Markdown documentation sources\n will be generated.\n nav_file: Path to the navigation specification file.\n template: Optional custom MkDocs configuration template.\n mkdocs_yml: Output path for the generated MkDocs configuration.\n out_dir: Output directory for generated MCP resources.\n\nRaises:\n click.UsageError: If required options are missing or conflicting." "docstring": "Build documentation artifacts.\n\nThis command performs the full documentation build pipeline:\n\n1. Introspects the Python project using Griffe\n2. Generates renderer-specific documentation sources\n3. Optionally builds the final documentation output\n\nDepending on the selected options, the build can target:\n\n- MkDocs static documentation sites\n- MCP structured documentation resources\n\nArgs:\n mcp (bool):\n Enable MCP documentation generation.\n\n mkdocs (bool):\n Enable MkDocs documentation generation.\n\n module_is_source (bool):\n Treat the specified module directory as the project root.\n\n module (Optional[str]):\n Python module import path to document.\n\n project_name (Optional[str]):\n Optional override for the project name.\n\n site_name (Optional[str]):\n Display name for the MkDocs site.\n\n docs_dir (Path):\n Directory where Markdown documentation sources will be generated.\n\n nav_file (Path):\n Path to the navigation specification file.\n\n template (Optional[Path]):\n Optional custom MkDocs configuration template.\n\n mkdocs_yml (Path):\n Output path for the generated MkDocs configuration.\n\n out_dir (Path):\n Output directory for generated MCP resources.\n\nRaises:\n click.UsageError:\n If required options are missing or conflicting."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.serve", "path": "docforge.cli.commands.serve",
"signature": "<bound method Function.signature of Function('serve', 111, 152)>", "signature": "<bound method Function.signature of Function('serve', 139, 190)>",
"docstring": "Serve generated documentation locally.\n\nDepending on the selected mode, this command starts either:\n\n- A MkDocs development server for browsing documentation\n- An MCP server exposing structured documentation resources\n\nArgs:\n mcp: Serve documentation using the MCP server.\n mkdocs: Serve the MkDocs development site.\n module: Python module import path to serve via MCP.\n mkdocs_yml: Path to the MkDocs configuration file.\n out_dir: Root directory containing MCP documentation resources.\n\nRaises:\n click.UsageError: If invalid or conflicting options are provided." "docstring": "Serve generated documentation locally.\n\nDepending on the selected mode, this command starts either:\n\n- A MkDocs development server for browsing documentation\n- An MCP server exposing structured documentation resources\n\nArgs:\n mcp (bool):\n Serve documentation using the MCP server.\n\n mkdocs (bool):\n Serve the MkDocs development site.\n\n module (Optional[str]):\n Python module import path to serve via MCP.\n\n mkdocs_yml (Path):\n Path to the MkDocs configuration file.\n\n out_dir (Path):\n Root directory containing MCP documentation resources.\n\nRaises:\n click.UsageError:\n If invalid or conflicting options are provided."
}, },
"tree": { "tree": {
"name": "tree", "name": "tree",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.tree", "path": "docforge.cli.commands.tree",
"signature": "<bound method Function.signature of Function('tree', 155, 188)>", "signature": "<bound method Function.signature of Function('tree', 193, 229)>",
"docstring": "Display the documentation object tree for a module.\n\nThis command introspects the specified module and prints a\nhierarchical representation of the discovered documentation\nobjects, including modules, classes, functions, and members.\n\nArgs:\n module: Python module import path to introspect.\n project_name: Optional name to display as the project root." "docstring": "Display the documentation object tree for a module.\n\nThis command introspects the specified module and prints a\nhierarchical representation of the discovered documentation\nobjects, including modules, classes, functions, and members.\n\nArgs:\n module (str):\n Python module import path to introspect.\n\n project_name (Optional[str]):\n Optional name to display as the project root."
}, },
"Group": { "Group": {
"name": "Group", "name": "Group",

View File

@@ -2,14 +2,14 @@
"module": "docforge.cli", "module": "docforge.cli",
"content": { "content": {
"path": "docforge.cli", "path": "docforge.cli",
"docstring": "Command line interface entry point for doc-forge.\n\nThis module exposes the primary CLI entry function used by the\n``doc-forge`` command. The actual command implementation resides in\n``docforge.cli.main``, while this module provides a stable import path\nfor external tools and the package entry point configuration.\n\nThe CLI is responsible for orchestrating documentation workflows such as\ngenerating renderer sources, building documentation sites, exporting\nmachine-readable documentation bundles, and starting development or MCP\nservers.\n\n---\n\nTypical usage\n-------------\n\nThe CLI is normally invoked through the installed command:\n\n doc-forge <command> [options]\n\nProgrammatic invocation is also possible:\n\n from docforge.cli import main\n main()\n\n---", "docstring": "# Summary\n\nCommand line interface entry point for doc-forge.\n\nThis module exposes the primary CLI entry function used by the\n`doc-forge` command. The actual command implementation resides in\n`docforge.cli.main`, while this module provides a stable import path\nfor external tools and the package entry point configuration.\n\nThe CLI is responsible for orchestrating documentation workflows such as\ngenerating renderer sources, building documentation sites, exporting\nmachine-readable documentation bundles, and starting development or MCP\nservers.\n\n---\n\n# Typical usage\n\nThe CLI is normally invoked through the installed command:\n\n```bash\ndoc-forge <command> [options]\n```\n\nProgrammatic invocation is also possible:\n\nExample:\n\n ```python\n from docforge.cli import main\n main()\n ```\n\n---",
"objects": { "objects": {
"main": { "main": {
"name": "main", "name": "main",
"kind": "module", "kind": "module",
"path": "docforge.cli.main", "path": "docforge.cli.main",
"signature": null, "signature": null,
"docstring": "Command-line entry point for the doc-forge CLI.\n\nThis module exposes the executable entry point that initializes the\nClick command group defined in ``docforge.cli.commands``.", "docstring": "# Summary\n\nCommand-line entry point for the doc-forge CLI.\n\nThis module exposes the executable entry point that initializes the\nClick command group defined in `docforge.cli.commands`.",
"members": { "members": {
"cli": { "cli": {
"name": "cli", "name": "cli",
@@ -22,8 +22,8 @@
"name": "main", "name": "main",
"kind": "function", "kind": "function",
"path": "docforge.cli.main.main", "path": "docforge.cli.main.main",
"signature": "<bound method Function.signature of Function('main', 11, 19)>", "signature": "<bound method Function.signature of Function('main', 13, 21)>",
"docstring": "Run the doc-forge command-line interface.\n\nThis function initializes and executes the Click CLI application.\nIt is used as the console entry point when invoking ``doc-forge``\nfrom the command line." "docstring": "Run the doc-forge command-line interface.\n\nThis function initializes and executes the Click CLI application.\nIt is used as the console entry point when invoking `doc-forge`\nfrom the command line."
} }
} }
}, },
@@ -32,7 +32,7 @@
"kind": "module", "kind": "module",
"path": "docforge.cli.commands", "path": "docforge.cli.commands",
"signature": null, "signature": null,
"docstring": null, "docstring": "# Summary\n\nCommand definitions for the doc-forge CLI.\n\nProvides the CLI structure using Click, including build, serve, and tree commands.",
"members": { "members": {
"click": { "click": {
"name": "click", "name": "click",
@@ -67,21 +67,21 @@
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.GriffeLoader", "path": "docforge.cli.commands.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>", "signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.", "docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into `Project`, `Module`,\nand `DocObject` instances used by doc-forge.",
"members": { "members": {
"load_project": { "load_project": {
"name": "load_project", "name": "load_project",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.GriffeLoader.load_project", "path": "docforge.cli.commands.GriffeLoader.load_project",
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>", "signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False." "docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a `Module`\ninstance. All modules are then aggregated into a single `Project`\nobject.\n\nArgs:\n module_paths (List[str]):\n List of dotted module import paths to load.\n\n project_name (str, optional):\n Optional override for the project name. Defaults to the top-level\n name of the first module.\n\n skip_import_errors (bool, optional):\n If True, modules that fail to load will be skipped instead of raising an error.\n\nReturns:\n Project:\n A populated `Project` instance containing the loaded modules.\n\nRaises:\n ValueError:\n If no module paths are provided.\n\n ImportError:\n If a module fails to load and `skip_import_errors` is False."
}, },
"load_module": { "load_module": {
"name": "load_module", "name": "load_module",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.GriffeLoader.load_module", "path": "docforge.cli.commands.GriffeLoader.load_module",
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>", "signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance." "docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge `Module` model.\n\nArgs:\n path (str):\n Dotted import path of the module.\n\nReturns:\n Module:\n A populated `Module` instance."
} }
} }
}, },
@@ -90,7 +90,7 @@
"kind": "module", "kind": "module",
"path": "docforge.cli.commands.mkdocs_utils", "path": "docforge.cli.commands.mkdocs_utils",
"signature": "<bound method Alias.signature of Alias('mkdocs_utils', 'docforge.cli.mkdocs_utils')>", "signature": "<bound method Alias.signature of Alias('mkdocs_utils', 'docforge.cli.mkdocs_utils')>",
"docstring": null, "docstring": "# Summary\n\nUtilities for working with MkDocs in the doc-forge CLI.",
"members": { "members": {
"Path": { "Path": {
"name": "Path", "name": "Path",
@@ -125,21 +125,21 @@
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mkdocs_utils.GriffeLoader", "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mkdocs_utils.GriffeLoader')>", "signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mkdocs_utils.GriffeLoader')>",
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.", "docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into `Project`, `Module`,\nand `DocObject` instances used by doc-forge.",
"members": { "members": {
"load_project": { "load_project": {
"name": "load_project", "name": "load_project",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_project", "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_project",
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>", "signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False." "docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a `Module`\ninstance. All modules are then aggregated into a single `Project`\nobject.\n\nArgs:\n module_paths (List[str]):\n List of dotted module import paths to load.\n\n project_name (str, optional):\n Optional override for the project name. Defaults to the top-level\n name of the first module.\n\n skip_import_errors (bool, optional):\n If True, modules that fail to load will be skipped instead of raising an error.\n\nReturns:\n Project:\n A populated `Project` instance containing the loaded modules.\n\nRaises:\n ValueError:\n If no module paths are provided.\n\n ImportError:\n If a module fails to load and `skip_import_errors` is False."
}, },
"load_module": { "load_module": {
"name": "load_module", "name": "load_module",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_module", "path": "docforge.cli.commands.mkdocs_utils.GriffeLoader.load_module",
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>", "signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance." "docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge `Module` model.\n\nArgs:\n path (str):\n Dotted import path of the module.\n\nReturns:\n Module:\n A populated `Module` instance."
} }
} }
}, },
@@ -148,7 +148,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.discover_module_paths", "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')>", "signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mkdocs_utils.discover_module_paths')>",
"docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for ``.py`` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing ``__init__.py`` are treated as packages.\n- Each ``.py`` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name: Top-level package name to discover modules from.\n project_root: Root directory used to resolve module paths. If not\n provided, the current working directory is used.\n\nReturns:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError: If the specified package directory does not exist." "docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for `.py` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing `__init__.py` are treated as packages.\n- Each `.py` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name (str):\n Top-level package name to discover modules from.\n\n project_root (Path, optional):\n Root directory used to resolve module paths. If not provided, the\n current working directory is used.\n\nReturns:\n List[str]:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError:\n If the specified package directory does not exist."
}, },
"MkDocsRenderer": { "MkDocsRenderer": {
"name": "MkDocsRenderer", "name": "MkDocsRenderer",
@@ -169,14 +169,14 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.generate_sources", "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')>", "signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
"docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project: Project model containing modules to document.\n out_dir: Directory where generated Markdown files will be written.\n module_is_source: If True, treat the specified module as the\n documentation root rather than nesting it inside a folder." "docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project (Project):\n Project model containing modules to document.\n\n out_dir (Path):\n Directory where generated Markdown files will be written.\n\n module_is_source (bool, optional):\n If True, treat the specified module as the documentation root\n rather than nesting it inside a folder."
}, },
"generate_readme": { "generate_readme": {
"name": "generate_readme", "name": "generate_readme",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.generate_readme", "path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.generate_readme",
"signature": "<bound method Alias.signature of Alias('generate_readme', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme')>", "signature": "<bound method Alias.signature of Alias('generate_readme', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme')>",
"docstring": "Generate a ``README.md`` file from the root module docstring.\n\nBehavior:\n\n- If ``module_is_source`` is True, ``README.md`` is written to the\n project root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project: Project model containing documentation metadata.\n docs_dir: Directory containing generated documentation sources.\n module_is_source: Whether the module is treated as the project\n source root." "docstring": "Generate a `README.md` file from the root module docstring.\n\nBehavior:\n\n- If `module_is_source` is True, `README.md` is written to the project\n root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project (Project):\n Project model containing documentation metadata.\n\n docs_dir (Path):\n Directory containing generated documentation sources.\n\n module_is_source (bool, optional):\n Whether the module is treated as the project source root."
} }
} }
}, },
@@ -215,28 +215,28 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.generate_sources", "path": "docforge.cli.commands.mkdocs_utils.generate_sources",
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.cli.mkdocs_utils.generate_sources')>", "signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.cli.mkdocs_utils.generate_sources')>",
"docstring": "Generate MkDocs Markdown sources for a Python module.\n\nThis function introspects the specified module, builds the internal\ndocumentation model, and renders Markdown documentation files for\nuse with MkDocs.\n\nArgs:\n module: Python module import path used as the entry point for\n documentation generation.\n docs_dir: Directory where the generated Markdown files will be written.\n project_name: Optional override for the project name used in\n documentation metadata.\n module_is_source: If True, treat the specified module directory as\n the project root rather than a nested module." "docstring": "Generate MkDocs Markdown sources for a Python module.\n\nThis function introspects the specified module, builds the internal\ndocumentation model, and renders Markdown documentation files for\nuse with MkDocs.\n\nArgs:\n module (str):\n Python module import path used as the entry point for\n documentation generation.\n\n docs_dir (Path):\n Directory where the generated Markdown files will be written.\n\n project_name (Optional[str]):\n Optional override for the project name used in documentation metadata.\n\n module_is_source (Optional[bool]):\n If True, treat the specified module directory as the project root\n rather than a nested module."
}, },
"generate_config": { "generate_config": {
"name": "generate_config", "name": "generate_config",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.generate_config", "path": "docforge.cli.commands.mkdocs_utils.generate_config",
"signature": "<bound method Alias.signature of Alias('generate_config', 'docforge.cli.mkdocs_utils.generate_config')>", "signature": "<bound method Alias.signature of Alias('generate_config', 'docforge.cli.mkdocs_utils.generate_config')>",
"docstring": "Generate an ``mkdocs.yml`` configuration file.\n\nThe configuration is created by combining a template configuration\nwith a navigation structure derived from the docforge navigation\nspecification.\n\nArgs:\n docs_dir: Directory containing generated documentation Markdown files.\n nav_file: Path to the ``docforge.nav.yml`` navigation specification.\n template: Optional path to a custom MkDocs configuration template.\n If not provided, a built-in template will be used.\n out: Destination path where the generated ``mkdocs.yml`` file\n will be written.\n site_name: Display name for the generated documentation site.\n\nRaises:\n click.FileError: If the navigation specification or template\n file cannot be found." "docstring": "Generate an `mkdocs.yml` configuration file.\n\nThe configuration is created by combining a template configuration\nwith a navigation structure derived from the docforge navigation\nspecification.\n\nArgs:\n docs_dir (Path):\n Directory containing generated documentation Markdown files.\n\n nav_file (Path):\n Path to the `docforge.nav.yml` navigation specification.\n\n template (Optional[Path]):\n Optional path to a custom MkDocs configuration template. If not\n provided, a built-in template will be used.\n\n out (Path):\n Destination path where the generated `mkdocs.yml` file will be written.\n\n site_name (str):\n Display name for the generated documentation site.\n\nRaises:\n click.FileError:\n If the navigation specification or template file cannot be found."
}, },
"build": { "build": {
"name": "build", "name": "build",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.build", "path": "docforge.cli.commands.mkdocs_utils.build",
"signature": "<bound method Alias.signature of Alias('build', 'docforge.cli.mkdocs_utils.build')>", "signature": "<bound method Alias.signature of Alias('build', 'docforge.cli.mkdocs_utils.build')>",
"docstring": "Build the MkDocs documentation site.\n\nThis function loads the MkDocs configuration and runs the MkDocs\nbuild command to generate the final static documentation site.\n\nArgs:\n mkdocs_yml: Path to the ``mkdocs.yml`` configuration file.\n\nRaises:\n click.ClickException: If the configuration file does not exist." "docstring": "Build the MkDocs documentation site.\n\nThis function loads the MkDocs configuration and runs the MkDocs\nbuild command to generate the final static documentation site.\n\nArgs:\n mkdocs_yml (Path):\n Path to the `mkdocs.yml` configuration file.\n\nRaises:\n click.ClickException:\n If the configuration file does not exist."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mkdocs_utils.serve", "path": "docforge.cli.commands.mkdocs_utils.serve",
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mkdocs_utils.serve')>", "signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mkdocs_utils.serve')>",
"docstring": "Start an MkDocs development server with live reload.\n\nThe server watches documentation files and automatically reloads\nthe site when changes are detected.\n\nArgs:\n mkdocs_yml: Path to the ``mkdocs.yml`` configuration file.\n\nRaises:\n click.ClickException: If the configuration file does not exist." "docstring": "Start an MkDocs development server with live reload.\n\nThe server watches documentation files and automatically reloads\nthe site when changes are detected.\n\nArgs:\n mkdocs_yml (Path):\n Path to the `mkdocs.yml` configuration file.\n\nRaises:\n click.ClickException:\n If the configuration file does not exist."
} }
} }
}, },
@@ -245,7 +245,7 @@
"kind": "module", "kind": "module",
"path": "docforge.cli.commands.mcp_utils", "path": "docforge.cli.commands.mcp_utils",
"signature": "<bound method Alias.signature of Alias('mcp_utils', 'docforge.cli.mcp_utils')>", "signature": "<bound method Alias.signature of Alias('mcp_utils', 'docforge.cli.mcp_utils')>",
"docstring": null, "docstring": "# Summary\n\nUtilities for working with MCP in the doc-forge CLI.",
"members": { "members": {
"Path": { "Path": {
"name": "Path", "name": "Path",
@@ -266,21 +266,21 @@
"kind": "class", "kind": "class",
"path": "docforge.cli.commands.mcp_utils.GriffeLoader", "path": "docforge.cli.commands.mcp_utils.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mcp_utils.GriffeLoader')>", "signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.cli.mcp_utils.GriffeLoader')>",
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.", "docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into `Project`, `Module`,\nand `DocObject` instances used by doc-forge.",
"members": { "members": {
"load_project": { "load_project": {
"name": "load_project", "name": "load_project",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_project", "path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_project",
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>", "signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False." "docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a `Module`\ninstance. All modules are then aggregated into a single `Project`\nobject.\n\nArgs:\n module_paths (List[str]):\n List of dotted module import paths to load.\n\n project_name (str, optional):\n Optional override for the project name. Defaults to the top-level\n name of the first module.\n\n skip_import_errors (bool, optional):\n If True, modules that fail to load will be skipped instead of raising an error.\n\nReturns:\n Project:\n A populated `Project` instance containing the loaded modules.\n\nRaises:\n ValueError:\n If no module paths are provided.\n\n ImportError:\n If a module fails to load and `skip_import_errors` is False."
}, },
"load_module": { "load_module": {
"name": "load_module", "name": "load_module",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_module", "path": "docforge.cli.commands.mcp_utils.GriffeLoader.load_module",
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>", "signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance." "docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge `Module` model.\n\nArgs:\n path (str):\n Dotted import path of the module.\n\nReturns:\n Module:\n A populated `Module` instance."
} }
} }
}, },
@@ -289,7 +289,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.discover_module_paths", "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')>", "signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.cli.mcp_utils.discover_module_paths')>",
"docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for ``.py`` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing ``__init__.py`` are treated as packages.\n- Each ``.py`` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name: Top-level package name to discover modules from.\n project_root: Root directory used to resolve module paths. If not\n provided, the current working directory is used.\n\nReturns:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError: If the specified package directory does not exist." "docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for `.py` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing `__init__.py` are treated as packages.\n- Each `.py` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name (str):\n Top-level package name to discover modules from.\n\n project_root (Path, optional):\n Root directory used to resolve module paths. If not provided, the\n current working directory is used.\n\nReturns:\n List[str]:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError:\n If the specified package directory does not exist."
}, },
"MCPRenderer": { "MCPRenderer": {
"name": "MCPRenderer", "name": "MCPRenderer",
@@ -310,7 +310,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.MCPRenderer.generate_sources", "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')>", "signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>",
"docstring": "Generate MCP documentation resources for a project.\n\nThe renderer serializes each module into a JSON resource and produces\nsupporting metadata files such as ``nav.json`` and ``index.json``.\n\nArgs:\n project: Documentation project model to render.\n out_dir: Directory where MCP resources will be written." "docstring": "Generate MCP documentation resources for a project.\n\nThe renderer serializes each module into a JSON resource and produces\nsupporting metadata files such as `nav.json` and `index.json`.\n\nArgs:\n project (Project):\n Documentation project model to render.\n\n out_dir (Path):\n Directory where MCP resources will be written."
} }
} }
}, },
@@ -340,7 +340,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.MCPServer.run", "path": "docforge.cli.commands.mcp_utils.MCPServer.run",
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>", "signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>",
"docstring": "Start the MCP server.\n\nArgs:\n transport: Transport mechanism used by the MCP server. Supported\n options include ``stdio``, ``sse``, and ``streamable-http``." "docstring": "Start the MCP server.\n\nArgs:\n transport (Literal[\"stdio\", \"sse\", \"streamable-http\"]):\n Transport mechanism used by the MCP server. Supported options\n include `stdio`, `sse`, and `streamable-http`."
} }
} }
}, },
@@ -349,14 +349,14 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.generate_resources", "path": "docforge.cli.commands.mcp_utils.generate_resources",
"signature": "<bound method Alias.signature of Alias('generate_resources', 'docforge.cli.mcp_utils.generate_resources')>", "signature": "<bound method Alias.signature of Alias('generate_resources', 'docforge.cli.mcp_utils.generate_resources')>",
"docstring": "Generate MCP documentation resources from a Python module.\n\nThe function performs project introspection, builds the internal\ndocumentation model, and renders MCP-compatible JSON resources\nto the specified output directory.\n\nArgs:\n module: Python module import path used as the entry point for\n documentation generation.\n project_name: Optional override for the project name used in\n generated documentation metadata.\n out_dir: Directory where MCP resources (index.json, nav.json,\n and module data) will be written." "docstring": "Generate MCP documentation resources from a Python module.\n\nThe function performs project introspection, builds the internal\ndocumentation model, and renders MCP-compatible JSON resources\nto the specified output directory.\n\nArgs:\n module (str):\n Python module import path used as the entry point for\n documentation generation.\n\n project_name (Optional[str]):\n Optional override for the project name used in generated\n documentation metadata.\n\n out_dir (Path):\n Directory where MCP resources (index.json, nav.json, and module data)\n will be written."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.mcp_utils.serve", "path": "docforge.cli.commands.mcp_utils.serve",
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp_utils.serve')>", "signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp_utils.serve')>",
"docstring": "Start an MCP server for a pre-generated documentation bundle.\n\nThe server exposes documentation resources such as project metadata,\nnavigation structure, and module documentation through MCP endpoints.\n\nArgs:\n module: Python module import path used to identify the served\n documentation instance.\n mcp_root: Path to the directory containing the MCP documentation\n bundle (index.json, nav.json, and modules/).\n\nRaises:\n click.ClickException: If the MCP documentation bundle is missing\n required files or directories." "docstring": "Start an MCP server for a pre-generated documentation bundle.\n\nThe server exposes documentation resources such as project metadata,\nnavigation structure, and module documentation through MCP endpoints.\n\nArgs:\n module (str):\n Python module import path used to identify the served\n documentation instance.\n\n mcp_root (Path):\n Path to the directory containing the MCP documentation\n bundle (index.json, nav.json, and modules/).\n\nRaises:\n click.ClickException:\n If the MCP documentation bundle is missing required files or directories."
} }
} }
}, },
@@ -371,22 +371,22 @@
"name": "build", "name": "build",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.build", "path": "docforge.cli.commands.build",
"signature": "<bound method Function.signature of Function('build', 20, 108)>", "signature": "<bound method Function.signature of Function('build', 28, 136)>",
"docstring": "Build documentation artifacts.\n\nThis command performs the full documentation build pipeline:\n\n1. Introspects the Python project using Griffe\n2. Generates renderer-specific documentation sources\n3. Optionally builds the final documentation output\n\nDepending on the selected options, the build can target:\n\n- MkDocs static documentation sites\n- MCP structured documentation resources\n\nArgs:\n mcp: Enable MCP documentation generation.\n mkdocs: Enable MkDocs documentation generation.\n module_is_source: Treat the specified module directory as the\n project root.\n module: Python module import path to document.\n project_name: Optional override for the project name.\n site_name: Display name for the MkDocs site.\n docs_dir: Directory where Markdown documentation sources\n will be generated.\n nav_file: Path to the navigation specification file.\n template: Optional custom MkDocs configuration template.\n mkdocs_yml: Output path for the generated MkDocs configuration.\n out_dir: Output directory for generated MCP resources.\n\nRaises:\n click.UsageError: If required options are missing or conflicting." "docstring": "Build documentation artifacts.\n\nThis command performs the full documentation build pipeline:\n\n1. Introspects the Python project using Griffe\n2. Generates renderer-specific documentation sources\n3. Optionally builds the final documentation output\n\nDepending on the selected options, the build can target:\n\n- MkDocs static documentation sites\n- MCP structured documentation resources\n\nArgs:\n mcp (bool):\n Enable MCP documentation generation.\n\n mkdocs (bool):\n Enable MkDocs documentation generation.\n\n module_is_source (bool):\n Treat the specified module directory as the project root.\n\n module (Optional[str]):\n Python module import path to document.\n\n project_name (Optional[str]):\n Optional override for the project name.\n\n site_name (Optional[str]):\n Display name for the MkDocs site.\n\n docs_dir (Path):\n Directory where Markdown documentation sources will be generated.\n\n nav_file (Path):\n Path to the navigation specification file.\n\n template (Optional[Path]):\n Optional custom MkDocs configuration template.\n\n mkdocs_yml (Path):\n Output path for the generated MkDocs configuration.\n\n out_dir (Path):\n Output directory for generated MCP resources.\n\nRaises:\n click.UsageError:\n If required options are missing or conflicting."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.serve", "path": "docforge.cli.commands.serve",
"signature": "<bound method Function.signature of Function('serve', 111, 152)>", "signature": "<bound method Function.signature of Function('serve', 139, 190)>",
"docstring": "Serve generated documentation locally.\n\nDepending on the selected mode, this command starts either:\n\n- A MkDocs development server for browsing documentation\n- An MCP server exposing structured documentation resources\n\nArgs:\n mcp: Serve documentation using the MCP server.\n mkdocs: Serve the MkDocs development site.\n module: Python module import path to serve via MCP.\n mkdocs_yml: Path to the MkDocs configuration file.\n out_dir: Root directory containing MCP documentation resources.\n\nRaises:\n click.UsageError: If invalid or conflicting options are provided." "docstring": "Serve generated documentation locally.\n\nDepending on the selected mode, this command starts either:\n\n- A MkDocs development server for browsing documentation\n- An MCP server exposing structured documentation resources\n\nArgs:\n mcp (bool):\n Serve documentation using the MCP server.\n\n mkdocs (bool):\n Serve the MkDocs development site.\n\n module (Optional[str]):\n Python module import path to serve via MCP.\n\n mkdocs_yml (Path):\n Path to the MkDocs configuration file.\n\n out_dir (Path):\n Root directory containing MCP documentation resources.\n\nRaises:\n click.UsageError:\n If invalid or conflicting options are provided."
}, },
"tree": { "tree": {
"name": "tree", "name": "tree",
"kind": "function", "kind": "function",
"path": "docforge.cli.commands.tree", "path": "docforge.cli.commands.tree",
"signature": "<bound method Function.signature of Function('tree', 155, 188)>", "signature": "<bound method Function.signature of Function('tree', 193, 229)>",
"docstring": "Display the documentation object tree for a module.\n\nThis command introspects the specified module and prints a\nhierarchical representation of the discovered documentation\nobjects, including modules, classes, functions, and members.\n\nArgs:\n module: Python module import path to introspect.\n project_name: Optional name to display as the project root." "docstring": "Display the documentation object tree for a module.\n\nThis command introspects the specified module and prints a\nhierarchical representation of the discovered documentation\nobjects, including modules, classes, functions, and members.\n\nArgs:\n module (str):\n Python module import path to introspect.\n\n project_name (Optional[str]):\n Optional name to display as the project root."
}, },
"Group": { "Group": {
"name": "Group", "name": "Group",
@@ -409,7 +409,7 @@
"kind": "module", "kind": "module",
"path": "docforge.cli.mcp_utils", "path": "docforge.cli.mcp_utils",
"signature": null, "signature": null,
"docstring": null, "docstring": "# Summary\n\nUtilities for working with MCP in the doc-forge CLI.",
"members": { "members": {
"Path": { "Path": {
"name": "Path", "name": "Path",
@@ -430,21 +430,21 @@
"kind": "class", "kind": "class",
"path": "docforge.cli.mcp_utils.GriffeLoader", "path": "docforge.cli.mcp_utils.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>", "signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.", "docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into `Project`, `Module`,\nand `DocObject` instances used by doc-forge.",
"members": { "members": {
"load_project": { "load_project": {
"name": "load_project", "name": "load_project",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.GriffeLoader.load_project", "path": "docforge.cli.mcp_utils.GriffeLoader.load_project",
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>", "signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False." "docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a `Module`\ninstance. All modules are then aggregated into a single `Project`\nobject.\n\nArgs:\n module_paths (List[str]):\n List of dotted module import paths to load.\n\n project_name (str, optional):\n Optional override for the project name. Defaults to the top-level\n name of the first module.\n\n skip_import_errors (bool, optional):\n If True, modules that fail to load will be skipped instead of raising an error.\n\nReturns:\n Project:\n A populated `Project` instance containing the loaded modules.\n\nRaises:\n ValueError:\n If no module paths are provided.\n\n ImportError:\n If a module fails to load and `skip_import_errors` is False."
}, },
"load_module": { "load_module": {
"name": "load_module", "name": "load_module",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.GriffeLoader.load_module", "path": "docforge.cli.mcp_utils.GriffeLoader.load_module",
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>", "signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance." "docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge `Module` model.\n\nArgs:\n path (str):\n Dotted import path of the module.\n\nReturns:\n Module:\n A populated `Module` instance."
} }
} }
}, },
@@ -453,7 +453,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.discover_module_paths", "path": "docforge.cli.mcp_utils.discover_module_paths",
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>", "signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>",
"docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for ``.py`` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing ``__init__.py`` are treated as packages.\n- Each ``.py`` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name: Top-level package name to discover modules from.\n project_root: Root directory used to resolve module paths. If not\n provided, the current working directory is used.\n\nReturns:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError: If the specified package directory does not exist." "docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for `.py` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing `__init__.py` are treated as packages.\n- Each `.py` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name (str):\n Top-level package name to discover modules from.\n\n project_root (Path, optional):\n Root directory used to resolve module paths. If not provided, the\n current working directory is used.\n\nReturns:\n List[str]:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError:\n If the specified package directory does not exist."
}, },
"MCPRenderer": { "MCPRenderer": {
"name": "MCPRenderer", "name": "MCPRenderer",
@@ -474,7 +474,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.MCPRenderer.generate_sources", "path": "docforge.cli.mcp_utils.MCPRenderer.generate_sources",
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>", "signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>",
"docstring": "Generate MCP documentation resources for a project.\n\nThe renderer serializes each module into a JSON resource and produces\nsupporting metadata files such as ``nav.json`` and ``index.json``.\n\nArgs:\n project: Documentation project model to render.\n out_dir: Directory where MCP resources will be written." "docstring": "Generate MCP documentation resources for a project.\n\nThe renderer serializes each module into a JSON resource and produces\nsupporting metadata files such as `nav.json` and `index.json`.\n\nArgs:\n project (Project):\n Documentation project model to render.\n\n out_dir (Path):\n Directory where MCP resources will be written."
} }
} }
}, },
@@ -504,7 +504,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.MCPServer.run", "path": "docforge.cli.mcp_utils.MCPServer.run",
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>", "signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>",
"docstring": "Start the MCP server.\n\nArgs:\n transport: Transport mechanism used by the MCP server. Supported\n options include ``stdio``, ``sse``, and ``streamable-http``." "docstring": "Start the MCP server.\n\nArgs:\n transport (Literal[\"stdio\", \"sse\", \"streamable-http\"]):\n Transport mechanism used by the MCP server. Supported options\n include `stdio`, `sse`, and `streamable-http`."
} }
} }
}, },
@@ -512,15 +512,15 @@
"name": "generate_resources", "name": "generate_resources",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.generate_resources", "path": "docforge.cli.mcp_utils.generate_resources",
"signature": "<bound method Function.signature of Function('generate_resources', 8, 29)>", "signature": "<bound method Function.signature of Function('generate_resources', 14, 40)>",
"docstring": "Generate MCP documentation resources from a Python module.\n\nThe function performs project introspection, builds the internal\ndocumentation model, and renders MCP-compatible JSON resources\nto the specified output directory.\n\nArgs:\n module: Python module import path used as the entry point for\n documentation generation.\n project_name: Optional override for the project name used in\n generated documentation metadata.\n out_dir: Directory where MCP resources (index.json, nav.json,\n and module data) will be written." "docstring": "Generate MCP documentation resources from a Python module.\n\nThe function performs project introspection, builds the internal\ndocumentation model, and renders MCP-compatible JSON resources\nto the specified output directory.\n\nArgs:\n module (str):\n Python module import path used as the entry point for\n documentation generation.\n\n project_name (Optional[str]):\n Optional override for the project name used in generated\n documentation metadata.\n\n out_dir (Path):\n Directory where MCP resources (index.json, nav.json, and module data)\n will be written."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.serve", "path": "docforge.cli.mcp_utils.serve",
"signature": "<bound method Function.signature of Function('serve', 32, 66)>", "signature": "<bound method Function.signature of Function('serve', 43, 80)>",
"docstring": "Start an MCP server for a pre-generated documentation bundle.\n\nThe server exposes documentation resources such as project metadata,\nnavigation structure, and module documentation through MCP endpoints.\n\nArgs:\n module: Python module import path used to identify the served\n documentation instance.\n mcp_root: Path to the directory containing the MCP documentation\n bundle (index.json, nav.json, and modules/).\n\nRaises:\n click.ClickException: If the MCP documentation bundle is missing\n required files or directories." "docstring": "Start an MCP server for a pre-generated documentation bundle.\n\nThe server exposes documentation resources such as project metadata,\nnavigation structure, and module documentation through MCP endpoints.\n\nArgs:\n module (str):\n Python module import path used to identify the served\n documentation instance.\n\n mcp_root (Path):\n Path to the directory containing the MCP documentation\n bundle (index.json, nav.json, and modules/).\n\nRaises:\n click.ClickException:\n If the MCP documentation bundle is missing required files or directories."
} }
} }
}, },
@@ -529,7 +529,7 @@
"kind": "module", "kind": "module",
"path": "docforge.cli.mkdocs_utils", "path": "docforge.cli.mkdocs_utils",
"signature": null, "signature": null,
"docstring": null, "docstring": "# Summary\n\nUtilities for working with MkDocs in the doc-forge CLI.",
"members": { "members": {
"Path": { "Path": {
"name": "Path", "name": "Path",
@@ -564,21 +564,21 @@
"kind": "class", "kind": "class",
"path": "docforge.cli.mkdocs_utils.GriffeLoader", "path": "docforge.cli.mkdocs_utils.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>", "signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.", "docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into `Project`, `Module`,\nand `DocObject` instances used by doc-forge.",
"members": { "members": {
"load_project": { "load_project": {
"name": "load_project", "name": "load_project",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.GriffeLoader.load_project", "path": "docforge.cli.mkdocs_utils.GriffeLoader.load_project",
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>", "signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False." "docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a `Module`\ninstance. All modules are then aggregated into a single `Project`\nobject.\n\nArgs:\n module_paths (List[str]):\n List of dotted module import paths to load.\n\n project_name (str, optional):\n Optional override for the project name. Defaults to the top-level\n name of the first module.\n\n skip_import_errors (bool, optional):\n If True, modules that fail to load will be skipped instead of raising an error.\n\nReturns:\n Project:\n A populated `Project` instance containing the loaded modules.\n\nRaises:\n ValueError:\n If no module paths are provided.\n\n ImportError:\n If a module fails to load and `skip_import_errors` is False."
}, },
"load_module": { "load_module": {
"name": "load_module", "name": "load_module",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.GriffeLoader.load_module", "path": "docforge.cli.mkdocs_utils.GriffeLoader.load_module",
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>", "signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance." "docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge `Module` model.\n\nArgs:\n path (str):\n Dotted import path of the module.\n\nReturns:\n Module:\n A populated `Module` instance."
} }
} }
}, },
@@ -587,7 +587,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.discover_module_paths", "path": "docforge.cli.mkdocs_utils.discover_module_paths",
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>", "signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>",
"docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for ``.py`` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing ``__init__.py`` are treated as packages.\n- Each ``.py`` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name: Top-level package name to discover modules from.\n project_root: Root directory used to resolve module paths. If not\n provided, the current working directory is used.\n\nReturns:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError: If the specified package directory does not exist." "docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for `.py` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing `__init__.py` are treated as packages.\n- Each `.py` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name (str):\n Top-level package name to discover modules from.\n\n project_root (Path, optional):\n Root directory used to resolve module paths. If not provided, the\n current working directory is used.\n\nReturns:\n List[str]:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError:\n If the specified package directory does not exist."
}, },
"MkDocsRenderer": { "MkDocsRenderer": {
"name": "MkDocsRenderer", "name": "MkDocsRenderer",
@@ -608,14 +608,14 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_sources", "path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_sources",
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>", "signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
"docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project: Project model containing modules to document.\n out_dir: Directory where generated Markdown files will be written.\n module_is_source: If True, treat the specified module as the\n documentation root rather than nesting it inside a folder." "docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project (Project):\n Project model containing modules to document.\n\n out_dir (Path):\n Directory where generated Markdown files will be written.\n\n module_is_source (bool, optional):\n If True, treat the specified module as the documentation root\n rather than nesting it inside a folder."
}, },
"generate_readme": { "generate_readme": {
"name": "generate_readme", "name": "generate_readme",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_readme", "path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_readme",
"signature": "<bound method Alias.signature of Alias('generate_readme', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme')>", "signature": "<bound method Alias.signature of Alias('generate_readme', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme')>",
"docstring": "Generate a ``README.md`` file from the root module docstring.\n\nBehavior:\n\n- If ``module_is_source`` is True, ``README.md`` is written to the\n project root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project: Project model containing documentation metadata.\n docs_dir: Directory containing generated documentation sources.\n module_is_source: Whether the module is treated as the project\n source root." "docstring": "Generate a `README.md` file from the root module docstring.\n\nBehavior:\n\n- If `module_is_source` is True, `README.md` is written to the project\n root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project (Project):\n Project model containing documentation metadata.\n\n docs_dir (Path):\n Directory containing generated documentation sources.\n\n module_is_source (bool, optional):\n Whether the module is treated as the project source root."
} }
} }
}, },
@@ -653,29 +653,29 @@
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.generate_sources", "path": "docforge.cli.mkdocs_utils.generate_sources",
"signature": "<bound method Function.signature of Function('generate_sources', 10, 47)>", "signature": "<bound method Function.signature of Function('generate_sources', 16, 59)>",
"docstring": "Generate MkDocs Markdown sources for a Python module.\n\nThis function introspects the specified module, builds the internal\ndocumentation model, and renders Markdown documentation files for\nuse with MkDocs.\n\nArgs:\n module: Python module import path used as the entry point for\n documentation generation.\n docs_dir: Directory where the generated Markdown files will be written.\n project_name: Optional override for the project name used in\n documentation metadata.\n module_is_source: If True, treat the specified module directory as\n the project root rather than a nested module." "docstring": "Generate MkDocs Markdown sources for a Python module.\n\nThis function introspects the specified module, builds the internal\ndocumentation model, and renders Markdown documentation files for\nuse with MkDocs.\n\nArgs:\n module (str):\n Python module import path used as the entry point for\n documentation generation.\n\n docs_dir (Path):\n Directory where the generated Markdown files will be written.\n\n project_name (Optional[str]):\n Optional override for the project name used in documentation metadata.\n\n module_is_source (Optional[bool]):\n If True, treat the specified module directory as the project root\n rather than a nested module."
}, },
"generate_config": { "generate_config": {
"name": "generate_config", "name": "generate_config",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.generate_config", "path": "docforge.cli.mkdocs_utils.generate_config",
"signature": "<bound method Function.signature of Function('generate_config', 50, 100)>", "signature": "<bound method Function.signature of Function('generate_config', 62, 120)>",
"docstring": "Generate an ``mkdocs.yml`` configuration file.\n\nThe configuration is created by combining a template configuration\nwith a navigation structure derived from the docforge navigation\nspecification.\n\nArgs:\n docs_dir: Directory containing generated documentation Markdown files.\n nav_file: Path to the ``docforge.nav.yml`` navigation specification.\n template: Optional path to a custom MkDocs configuration template.\n If not provided, a built-in template will be used.\n out: Destination path where the generated ``mkdocs.yml`` file\n will be written.\n site_name: Display name for the generated documentation site.\n\nRaises:\n click.FileError: If the navigation specification or template\n file cannot be found." "docstring": "Generate an `mkdocs.yml` configuration file.\n\nThe configuration is created by combining a template configuration\nwith a navigation structure derived from the docforge navigation\nspecification.\n\nArgs:\n docs_dir (Path):\n Directory containing generated documentation Markdown files.\n\n nav_file (Path):\n Path to the `docforge.nav.yml` navigation specification.\n\n template (Optional[Path]):\n Optional path to a custom MkDocs configuration template. If not\n provided, a built-in template will be used.\n\n out (Path):\n Destination path where the generated `mkdocs.yml` file will be written.\n\n site_name (str):\n Display name for the generated documentation site.\n\nRaises:\n click.FileError:\n If the navigation specification or template file cannot be found."
}, },
"build": { "build": {
"name": "build", "name": "build",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.build", "path": "docforge.cli.mkdocs_utils.build",
"signature": "<bound method Function.signature of Function('build', 103, 122)>", "signature": "<bound method Function.signature of Function('build', 123, 144)>",
"docstring": "Build the MkDocs documentation site.\n\nThis function loads the MkDocs configuration and runs the MkDocs\nbuild command to generate the final static documentation site.\n\nArgs:\n mkdocs_yml: Path to the ``mkdocs.yml`` configuration file.\n\nRaises:\n click.ClickException: If the configuration file does not exist." "docstring": "Build the MkDocs documentation site.\n\nThis function loads the MkDocs configuration and runs the MkDocs\nbuild command to generate the final static documentation site.\n\nArgs:\n mkdocs_yml (Path):\n Path to the `mkdocs.yml` configuration file.\n\nRaises:\n click.ClickException:\n If the configuration file does not exist."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.serve", "path": "docforge.cli.mkdocs_utils.serve",
"signature": "<bound method Function.signature of Function('serve', 125, 142)>", "signature": "<bound method Function.signature of Function('serve', 147, 166)>",
"docstring": "Start an MkDocs development server with live reload.\n\nThe server watches documentation files and automatically reloads\nthe site when changes are detected.\n\nArgs:\n mkdocs_yml: Path to the ``mkdocs.yml`` configuration file.\n\nRaises:\n click.ClickException: If the configuration file does not exist." "docstring": "Start an MkDocs development server with live reload.\n\nThe server watches documentation files and automatically reloads\nthe site when changes are detected.\n\nArgs:\n mkdocs_yml (Path):\n Path to the `mkdocs.yml` configuration file.\n\nRaises:\n click.ClickException:\n If the configuration file does not exist."
} }
} }
} }

View File

@@ -2,7 +2,7 @@
"module": "docforge.cli.main", "module": "docforge.cli.main",
"content": { "content": {
"path": "docforge.cli.main", "path": "docforge.cli.main",
"docstring": "Command-line entry point for the doc-forge CLI.\n\nThis module exposes the executable entry point that initializes the\nClick command group defined in ``docforge.cli.commands``.", "docstring": "# Summary\n\nCommand-line entry point for the doc-forge CLI.\n\nThis module exposes the executable entry point that initializes the\nClick command group defined in `docforge.cli.commands`.",
"objects": { "objects": {
"cli": { "cli": {
"name": "cli", "name": "cli",
@@ -15,8 +15,8 @@
"name": "main", "name": "main",
"kind": "function", "kind": "function",
"path": "docforge.cli.main.main", "path": "docforge.cli.main.main",
"signature": "<bound method Function.signature of Function('main', 11, 19)>", "signature": "<bound method Function.signature of Function('main', 13, 21)>",
"docstring": "Run the doc-forge command-line interface.\n\nThis function initializes and executes the Click CLI application.\nIt is used as the console entry point when invoking ``doc-forge``\nfrom the command line." "docstring": "Run the doc-forge command-line interface.\n\nThis function initializes and executes the Click CLI application.\nIt is used as the console entry point when invoking `doc-forge`\nfrom the command line."
} }
} }
} }

View File

@@ -2,7 +2,7 @@
"module": "docforge.cli.mcp_utils", "module": "docforge.cli.mcp_utils",
"content": { "content": {
"path": "docforge.cli.mcp_utils", "path": "docforge.cli.mcp_utils",
"docstring": null, "docstring": "# Summary\n\nUtilities for working with MCP in the doc-forge CLI.",
"objects": { "objects": {
"Path": { "Path": {
"name": "Path", "name": "Path",
@@ -23,21 +23,21 @@
"kind": "class", "kind": "class",
"path": "docforge.cli.mcp_utils.GriffeLoader", "path": "docforge.cli.mcp_utils.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>", "signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.", "docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into `Project`, `Module`,\nand `DocObject` instances used by doc-forge.",
"members": { "members": {
"load_project": { "load_project": {
"name": "load_project", "name": "load_project",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.GriffeLoader.load_project", "path": "docforge.cli.mcp_utils.GriffeLoader.load_project",
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>", "signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False." "docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a `Module`\ninstance. All modules are then aggregated into a single `Project`\nobject.\n\nArgs:\n module_paths (List[str]):\n List of dotted module import paths to load.\n\n project_name (str, optional):\n Optional override for the project name. Defaults to the top-level\n name of the first module.\n\n skip_import_errors (bool, optional):\n If True, modules that fail to load will be skipped instead of raising an error.\n\nReturns:\n Project:\n A populated `Project` instance containing the loaded modules.\n\nRaises:\n ValueError:\n If no module paths are provided.\n\n ImportError:\n If a module fails to load and `skip_import_errors` is False."
}, },
"load_module": { "load_module": {
"name": "load_module", "name": "load_module",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.GriffeLoader.load_module", "path": "docforge.cli.mcp_utils.GriffeLoader.load_module",
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>", "signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance." "docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge `Module` model.\n\nArgs:\n path (str):\n Dotted import path of the module.\n\nReturns:\n Module:\n A populated `Module` instance."
} }
} }
}, },
@@ -46,7 +46,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.discover_module_paths", "path": "docforge.cli.mcp_utils.discover_module_paths",
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>", "signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>",
"docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for ``.py`` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing ``__init__.py`` are treated as packages.\n- Each ``.py`` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name: Top-level package name to discover modules from.\n project_root: Root directory used to resolve module paths. If not\n provided, the current working directory is used.\n\nReturns:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError: If the specified package directory does not exist." "docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for `.py` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing `__init__.py` are treated as packages.\n- Each `.py` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name (str):\n Top-level package name to discover modules from.\n\n project_root (Path, optional):\n Root directory used to resolve module paths. If not provided, the\n current working directory is used.\n\nReturns:\n List[str]:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError:\n If the specified package directory does not exist."
}, },
"MCPRenderer": { "MCPRenderer": {
"name": "MCPRenderer", "name": "MCPRenderer",
@@ -67,7 +67,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.MCPRenderer.generate_sources", "path": "docforge.cli.mcp_utils.MCPRenderer.generate_sources",
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>", "signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>",
"docstring": "Generate MCP documentation resources for a project.\n\nThe renderer serializes each module into a JSON resource and produces\nsupporting metadata files such as ``nav.json`` and ``index.json``.\n\nArgs:\n project: Documentation project model to render.\n out_dir: Directory where MCP resources will be written." "docstring": "Generate MCP documentation resources for a project.\n\nThe renderer serializes each module into a JSON resource and produces\nsupporting metadata files such as `nav.json` and `index.json`.\n\nArgs:\n project (Project):\n Documentation project model to render.\n\n out_dir (Path):\n Directory where MCP resources will be written."
} }
} }
}, },
@@ -97,7 +97,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.MCPServer.run", "path": "docforge.cli.mcp_utils.MCPServer.run",
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>", "signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>",
"docstring": "Start the MCP server.\n\nArgs:\n transport: Transport mechanism used by the MCP server. Supported\n options include ``stdio``, ``sse``, and ``streamable-http``." "docstring": "Start the MCP server.\n\nArgs:\n transport (Literal[\"stdio\", \"sse\", \"streamable-http\"]):\n Transport mechanism used by the MCP server. Supported options\n include `stdio`, `sse`, and `streamable-http`."
} }
} }
}, },
@@ -105,15 +105,15 @@
"name": "generate_resources", "name": "generate_resources",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.generate_resources", "path": "docforge.cli.mcp_utils.generate_resources",
"signature": "<bound method Function.signature of Function('generate_resources', 8, 29)>", "signature": "<bound method Function.signature of Function('generate_resources', 14, 40)>",
"docstring": "Generate MCP documentation resources from a Python module.\n\nThe function performs project introspection, builds the internal\ndocumentation model, and renders MCP-compatible JSON resources\nto the specified output directory.\n\nArgs:\n module: Python module import path used as the entry point for\n documentation generation.\n project_name: Optional override for the project name used in\n generated documentation metadata.\n out_dir: Directory where MCP resources (index.json, nav.json,\n and module data) will be written." "docstring": "Generate MCP documentation resources from a Python module.\n\nThe function performs project introspection, builds the internal\ndocumentation model, and renders MCP-compatible JSON resources\nto the specified output directory.\n\nArgs:\n module (str):\n Python module import path used as the entry point for\n documentation generation.\n\n project_name (Optional[str]):\n Optional override for the project name used in generated\n documentation metadata.\n\n out_dir (Path):\n Directory where MCP resources (index.json, nav.json, and module data)\n will be written."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.mcp_utils.serve", "path": "docforge.cli.mcp_utils.serve",
"signature": "<bound method Function.signature of Function('serve', 32, 66)>", "signature": "<bound method Function.signature of Function('serve', 43, 80)>",
"docstring": "Start an MCP server for a pre-generated documentation bundle.\n\nThe server exposes documentation resources such as project metadata,\nnavigation structure, and module documentation through MCP endpoints.\n\nArgs:\n module: Python module import path used to identify the served\n documentation instance.\n mcp_root: Path to the directory containing the MCP documentation\n bundle (index.json, nav.json, and modules/).\n\nRaises:\n click.ClickException: If the MCP documentation bundle is missing\n required files or directories." "docstring": "Start an MCP server for a pre-generated documentation bundle.\n\nThe server exposes documentation resources such as project metadata,\nnavigation structure, and module documentation through MCP endpoints.\n\nArgs:\n module (str):\n Python module import path used to identify the served\n documentation instance.\n\n mcp_root (Path):\n Path to the directory containing the MCP documentation\n bundle (index.json, nav.json, and modules/).\n\nRaises:\n click.ClickException:\n If the MCP documentation bundle is missing required files or directories."
} }
} }
} }

View File

@@ -2,7 +2,7 @@
"module": "docforge.cli.mkdocs_utils", "module": "docforge.cli.mkdocs_utils",
"content": { "content": {
"path": "docforge.cli.mkdocs_utils", "path": "docforge.cli.mkdocs_utils",
"docstring": null, "docstring": "# Summary\n\nUtilities for working with MkDocs in the doc-forge CLI.",
"objects": { "objects": {
"Path": { "Path": {
"name": "Path", "name": "Path",
@@ -37,21 +37,21 @@
"kind": "class", "kind": "class",
"path": "docforge.cli.mkdocs_utils.GriffeLoader", "path": "docforge.cli.mkdocs_utils.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>", "signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.GriffeLoader')>",
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.", "docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into `Project`, `Module`,\nand `DocObject` instances used by doc-forge.",
"members": { "members": {
"load_project": { "load_project": {
"name": "load_project", "name": "load_project",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.GriffeLoader.load_project", "path": "docforge.cli.mkdocs_utils.GriffeLoader.load_project",
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>", "signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False." "docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a `Module`\ninstance. All modules are then aggregated into a single `Project`\nobject.\n\nArgs:\n module_paths (List[str]):\n List of dotted module import paths to load.\n\n project_name (str, optional):\n Optional override for the project name. Defaults to the top-level\n name of the first module.\n\n skip_import_errors (bool, optional):\n If True, modules that fail to load will be skipped instead of raising an error.\n\nReturns:\n Project:\n A populated `Project` instance containing the loaded modules.\n\nRaises:\n ValueError:\n If no module paths are provided.\n\n ImportError:\n If a module fails to load and `skip_import_errors` is False."
}, },
"load_module": { "load_module": {
"name": "load_module", "name": "load_module",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.GriffeLoader.load_module", "path": "docforge.cli.mkdocs_utils.GriffeLoader.load_module",
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>", "signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance." "docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge `Module` model.\n\nArgs:\n path (str):\n Dotted import path of the module.\n\nReturns:\n Module:\n A populated `Module` instance."
} }
} }
}, },
@@ -60,7 +60,7 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.discover_module_paths", "path": "docforge.cli.mkdocs_utils.discover_module_paths",
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>", "signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.discover_module_paths')>",
"docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for ``.py`` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing ``__init__.py`` are treated as packages.\n- Each ``.py`` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name: Top-level package name to discover modules from.\n project_root: Root directory used to resolve module paths. If not\n provided, the current working directory is used.\n\nReturns:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError: If the specified package directory does not exist." "docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for `.py` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing `__init__.py` are treated as packages.\n- Each `.py` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name (str):\n Top-level package name to discover modules from.\n\n project_root (Path, optional):\n Root directory used to resolve module paths. If not provided, the\n current working directory is used.\n\nReturns:\n List[str]:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError:\n If the specified package directory does not exist."
}, },
"MkDocsRenderer": { "MkDocsRenderer": {
"name": "MkDocsRenderer", "name": "MkDocsRenderer",
@@ -81,14 +81,14 @@
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_sources", "path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_sources",
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>", "signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
"docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project: Project model containing modules to document.\n out_dir: Directory where generated Markdown files will be written.\n module_is_source: If True, treat the specified module as the\n documentation root rather than nesting it inside a folder." "docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project (Project):\n Project model containing modules to document.\n\n out_dir (Path):\n Directory where generated Markdown files will be written.\n\n module_is_source (bool, optional):\n If True, treat the specified module as the documentation root\n rather than nesting it inside a folder."
}, },
"generate_readme": { "generate_readme": {
"name": "generate_readme", "name": "generate_readme",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_readme", "path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_readme",
"signature": "<bound method Alias.signature of Alias('generate_readme', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme')>", "signature": "<bound method Alias.signature of Alias('generate_readme', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme')>",
"docstring": "Generate a ``README.md`` file from the root module docstring.\n\nBehavior:\n\n- If ``module_is_source`` is True, ``README.md`` is written to the\n project root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project: Project model containing documentation metadata.\n docs_dir: Directory containing generated documentation sources.\n module_is_source: Whether the module is treated as the project\n source root." "docstring": "Generate a `README.md` file from the root module docstring.\n\nBehavior:\n\n- If `module_is_source` is True, `README.md` is written to the project\n root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project (Project):\n Project model containing documentation metadata.\n\n docs_dir (Path):\n Directory containing generated documentation sources.\n\n module_is_source (bool, optional):\n Whether the module is treated as the project source root."
} }
} }
}, },
@@ -126,29 +126,29 @@
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.generate_sources", "path": "docforge.cli.mkdocs_utils.generate_sources",
"signature": "<bound method Function.signature of Function('generate_sources', 10, 47)>", "signature": "<bound method Function.signature of Function('generate_sources', 16, 59)>",
"docstring": "Generate MkDocs Markdown sources for a Python module.\n\nThis function introspects the specified module, builds the internal\ndocumentation model, and renders Markdown documentation files for\nuse with MkDocs.\n\nArgs:\n module: Python module import path used as the entry point for\n documentation generation.\n docs_dir: Directory where the generated Markdown files will be written.\n project_name: Optional override for the project name used in\n documentation metadata.\n module_is_source: If True, treat the specified module directory as\n the project root rather than a nested module." "docstring": "Generate MkDocs Markdown sources for a Python module.\n\nThis function introspects the specified module, builds the internal\ndocumentation model, and renders Markdown documentation files for\nuse with MkDocs.\n\nArgs:\n module (str):\n Python module import path used as the entry point for\n documentation generation.\n\n docs_dir (Path):\n Directory where the generated Markdown files will be written.\n\n project_name (Optional[str]):\n Optional override for the project name used in documentation metadata.\n\n module_is_source (Optional[bool]):\n If True, treat the specified module directory as the project root\n rather than a nested module."
}, },
"generate_config": { "generate_config": {
"name": "generate_config", "name": "generate_config",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.generate_config", "path": "docforge.cli.mkdocs_utils.generate_config",
"signature": "<bound method Function.signature of Function('generate_config', 50, 100)>", "signature": "<bound method Function.signature of Function('generate_config', 62, 120)>",
"docstring": "Generate an ``mkdocs.yml`` configuration file.\n\nThe configuration is created by combining a template configuration\nwith a navigation structure derived from the docforge navigation\nspecification.\n\nArgs:\n docs_dir: Directory containing generated documentation Markdown files.\n nav_file: Path to the ``docforge.nav.yml`` navigation specification.\n template: Optional path to a custom MkDocs configuration template.\n If not provided, a built-in template will be used.\n out: Destination path where the generated ``mkdocs.yml`` file\n will be written.\n site_name: Display name for the generated documentation site.\n\nRaises:\n click.FileError: If the navigation specification or template\n file cannot be found." "docstring": "Generate an `mkdocs.yml` configuration file.\n\nThe configuration is created by combining a template configuration\nwith a navigation structure derived from the docforge navigation\nspecification.\n\nArgs:\n docs_dir (Path):\n Directory containing generated documentation Markdown files.\n\n nav_file (Path):\n Path to the `docforge.nav.yml` navigation specification.\n\n template (Optional[Path]):\n Optional path to a custom MkDocs configuration template. If not\n provided, a built-in template will be used.\n\n out (Path):\n Destination path where the generated `mkdocs.yml` file will be written.\n\n site_name (str):\n Display name for the generated documentation site.\n\nRaises:\n click.FileError:\n If the navigation specification or template file cannot be found."
}, },
"build": { "build": {
"name": "build", "name": "build",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.build", "path": "docforge.cli.mkdocs_utils.build",
"signature": "<bound method Function.signature of Function('build', 103, 122)>", "signature": "<bound method Function.signature of Function('build', 123, 144)>",
"docstring": "Build the MkDocs documentation site.\n\nThis function loads the MkDocs configuration and runs the MkDocs\nbuild command to generate the final static documentation site.\n\nArgs:\n mkdocs_yml: Path to the ``mkdocs.yml`` configuration file.\n\nRaises:\n click.ClickException: If the configuration file does not exist." "docstring": "Build the MkDocs documentation site.\n\nThis function loads the MkDocs configuration and runs the MkDocs\nbuild command to generate the final static documentation site.\n\nArgs:\n mkdocs_yml (Path):\n Path to the `mkdocs.yml` configuration file.\n\nRaises:\n click.ClickException:\n If the configuration file does not exist."
}, },
"serve": { "serve": {
"name": "serve", "name": "serve",
"kind": "function", "kind": "function",
"path": "docforge.cli.mkdocs_utils.serve", "path": "docforge.cli.mkdocs_utils.serve",
"signature": "<bound method Function.signature of Function('serve', 125, 142)>", "signature": "<bound method Function.signature of Function('serve', 147, 166)>",
"docstring": "Start an MkDocs development server with live reload.\n\nThe server watches documentation files and automatically reloads\nthe site when changes are detected.\n\nArgs:\n mkdocs_yml: Path to the ``mkdocs.yml`` configuration file.\n\nRaises:\n click.ClickException: If the configuration file does not exist." "docstring": "Start an MkDocs development server with live reload.\n\nThe server watches documentation files and automatically reloads\nthe site when changes are detected.\n\nArgs:\n mkdocs_yml (Path):\n Path to the `mkdocs.yml` configuration file.\n\nRaises:\n click.ClickException:\n If the configuration file does not exist."
} }
} }
} }

File diff suppressed because one or more lines are too long

View File

@@ -2,7 +2,7 @@
"module": "docforge.loaders.griffe_loader", "module": "docforge.loaders.griffe_loader",
"content": { "content": {
"path": "docforge.loaders.griffe_loader", "path": "docforge.loaders.griffe_loader",
"docstring": "Utilities for loading and introspecting Python modules using Griffe.\n\nThis module provides the ``GriffeLoader`` class and helper utilities used to\ndiscover Python modules, introspect their structure, and convert the results\ninto doc-forge documentation models.", "docstring": "# Summary\n\nUtilities for loading and introspecting Python modules using Griffe.\n\nThis module provides the `GriffeLoader` class and helper utilities used to\ndiscover Python modules, introspect their structure, and convert the results\ninto doc-forge documentation models.",
"objects": { "objects": {
"logging": { "logging": {
"name": "logging", "name": "logging",
@@ -65,7 +65,7 @@
"kind": "class", "kind": "class",
"path": "docforge.loaders.griffe_loader.Module", "path": "docforge.loaders.griffe_loader.Module",
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>", "signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>",
"docstring": "Representation of a documented Python module or package.\n\nA ``Module`` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level documentation string, if present.\n members: Mapping of object names to their corresponding\n ``DocObject`` representations.", "docstring": "Representation of a documented Python module or package.\n\nA `Module` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path (str):\n Dotted import path of the module.\n\n docstring (Optional[str]):\n Module-level documentation string, if present.\n\n members (Dict[str, DocObject]):\n Mapping of object names to their corresponding `DocObject` representations.",
"members": { "members": {
"path": { "path": {
"name": "path", "name": "path",
@@ -93,21 +93,21 @@
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.Module.add_object", "path": "docforge.loaders.griffe_loader.Module.add_object",
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.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: Documentation object to register as a top-level\n member of the module." "docstring": "Add a documented object to the module.\n\nArgs:\n obj (DocObject):\n Documentation object to register as a top-level member of the module."
}, },
"get_object": { "get_object": {
"name": "get_object", "name": "get_object",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.Module.get_object", "path": "docforge.loaders.griffe_loader.Module.get_object",
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>", "signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
"docstring": "Retrieve a documented object by name.\n\nArgs:\n name: Name of the object to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If no object with the given name exists." "docstring": "Retrieve a documented object by name.\n\nArgs:\n name (str):\n Name of the object to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If no object with the given name exists."
}, },
"get_all_objects": { "get_all_objects": {
"name": "get_all_objects", "name": "get_all_objects",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.Module.get_all_objects", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
"docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n An iterable of ``DocObject`` instances representing the\n module's public members." "docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing the module's public members."
} }
} }
}, },
@@ -116,7 +116,7 @@
"kind": "class", "kind": "class",
"path": "docforge.loaders.griffe_loader.Project", "path": "docforge.loaders.griffe_loader.Project",
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>", "signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
"docstring": "Representation of a documentation project.\n\nA ``Project`` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name: Name of the project.\n modules: Mapping of module paths to ``Module`` instances.", "docstring": "Representation of a documentation project.\n\nA `Project` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name (str):\n Name of the project.\n\n modules (Dict[str, Module]):\n Mapping of module paths to `Module` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -137,28 +137,28 @@
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.Project.add_module", "path": "docforge.loaders.griffe_loader.Project.add_module",
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>", "signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
"docstring": "Register a module in the project.\n\nArgs:\n module: Module instance to add to the project." "docstring": "Register a module in the project.\n\nArgs:\n module (Module):\n Module instance to add to the project."
}, },
"get_module": { "get_module": {
"name": "get_module", "name": "get_module",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.Project.get_module", "path": "docforge.loaders.griffe_loader.Project.get_module",
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.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: Fully qualified dotted module path (for example ``pkg.module``).\n\nReturns:\n The corresponding ``Module`` instance.\n\nRaises:\n KeyError: If the module does not exist in the project." "docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path (str):\n Fully qualified dotted module path (for example `pkg.module`).\n\nReturns:\n Module:\n The corresponding `Module` instance.\n\nRaises:\n KeyError:\n If the module does not exist in the project."
}, },
"get_all_modules": { "get_all_modules": {
"name": "get_all_modules", "name": "get_all_modules",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.Project.get_all_modules", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
"docstring": "Return all modules contained in the project.\n\nReturns:\n An iterable of ``Module`` instances." "docstring": "Return all modules contained in the project.\n\nReturns:\n Iterable[Module]:\n An iterable of `Module` instances."
}, },
"get_module_list": { "get_module_list": {
"name": "get_module_list", "name": "get_module_list",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.Project.get_module_list", "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')>", "signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
"docstring": "Return the list of module import paths.\n\nReturns:\n A list containing the dotted paths of all modules in the project." "docstring": "Return the list of module import paths.\n\nReturns:\n list[str]:\n A list containing the dotted paths of all modules in the project."
} }
} }
}, },
@@ -167,7 +167,7 @@
"kind": "class", "kind": "class",
"path": "docforge.loaders.griffe_loader.DocObject", "path": "docforge.loaders.griffe_loader.DocObject",
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.DocObject')>", "signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.DocObject')>",
"docstring": "Representation of a documented Python object.\n\nA ``DocObject`` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (for example ``class``, ``function``,\n ``method``, or ``attribute``).\n path: Fully qualified dotted path to the object.\n signature: Callable signature if the object represents a callable.\n docstring: Raw docstring text extracted from the source code.\n members: Mapping of member names to child ``DocObject`` instances.", "docstring": "Representation of a documented Python object.\n\nA `DocObject` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name (str):\n Local name of the object.\n\n kind (str):\n Type of object (for example `class`, `function`, `method`, or `attribute`).\n\n path (str):\n Fully qualified dotted path to the object.\n\n signature (Optional[str]):\n Callable signature if the object represents a callable.\n\n docstring (Optional[str]):\n Raw docstring text extracted from the source code.\n\n members (Dict[str, DocObject]):\n Mapping of member names to child `DocObject` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -223,14 +223,14 @@
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.DocObject.get_member", "path": "docforge.loaders.griffe_loader.DocObject.get_member",
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>", "signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: Name of the member to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If the member does not exist." "docstring": "Retrieve a member object by name.\n\nArgs:\n name (str):\n Name of the member to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If the member does not exist."
}, },
"get_all_members": { "get_all_members": {
"name": "get_all_members", "name": "get_all_members",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.DocObject.get_all_members", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
"docstring": "Return all child members of the object.\n\nReturns:\n An iterable of ``DocObject`` instances representing nested members." "docstring": "Return all child members of the object.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing nested members."
} }
} }
}, },
@@ -245,29 +245,29 @@
"name": "discover_module_paths", "name": "discover_module_paths",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.discover_module_paths", "path": "docforge.loaders.griffe_loader.discover_module_paths",
"signature": "<bound method Function.signature of Function('discover_module_paths', 26, 73)>", "signature": "<bound method Function.signature of Function('discover_module_paths', 28, 80)>",
"docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for ``.py`` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing ``__init__.py`` are treated as packages.\n- Each ``.py`` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name: Top-level package name to discover modules from.\n project_root: Root directory used to resolve module paths. If not\n provided, the current working directory is used.\n\nReturns:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError: If the specified package directory does not exist." "docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for `.py` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing `__init__.py` are treated as packages.\n- Each `.py` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name (str):\n Top-level package name to discover modules from.\n\n project_root (Path, optional):\n Root directory used to resolve module paths. If not provided, the\n current working directory is used.\n\nReturns:\n List[str]:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError:\n If the specified package directory does not exist."
}, },
"GriffeLoader": { "GriffeLoader": {
"name": "GriffeLoader", "name": "GriffeLoader",
"kind": "class", "kind": "class",
"path": "docforge.loaders.griffe_loader.GriffeLoader", "path": "docforge.loaders.griffe_loader.GriffeLoader",
"signature": "<bound method Class.signature of Class('GriffeLoader', 76, 264)>", "signature": "<bound method Class.signature of Class('GriffeLoader', 83, 287)>",
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.", "docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into `Project`, `Module`,\nand `DocObject` instances used by doc-forge.",
"members": { "members": {
"load_project": { "load_project": {
"name": "load_project", "name": "load_project",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.GriffeLoader.load_project", "path": "docforge.loaders.griffe_loader.GriffeLoader.load_project",
"signature": "<bound method Function.signature of Function('load_project', 97, 144)>", "signature": "<bound method Function.signature of Function('load_project', 104, 158)>",
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False." "docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a `Module`\ninstance. All modules are then aggregated into a single `Project`\nobject.\n\nArgs:\n module_paths (List[str]):\n List of dotted module import paths to load.\n\n project_name (str, optional):\n Optional override for the project name. Defaults to the top-level\n name of the first module.\n\n skip_import_errors (bool, optional):\n If True, modules that fail to load will be skipped instead of raising an error.\n\nReturns:\n Project:\n A populated `Project` instance containing the loaded modules.\n\nRaises:\n ValueError:\n If no module paths are provided.\n\n ImportError:\n If a module fails to load and `skip_import_errors` is False."
}, },
"load_module": { "load_module": {
"name": "load_module", "name": "load_module",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.GriffeLoader.load_module", "path": "docforge.loaders.griffe_loader.GriffeLoader.load_module",
"signature": "<bound method Function.signature of Function('load_module', 146, 162)>", "signature": "<bound method Function.signature of Function('load_module', 160, 178)>",
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance." "docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge `Module` model.\n\nArgs:\n path (str):\n Dotted import path of the module.\n\nReturns:\n Module:\n A populated `Module` instance."
} }
} }
} }

View File

@@ -2,28 +2,28 @@
"module": "docforge.loaders", "module": "docforge.loaders",
"content": { "content": {
"path": "docforge.loaders", "path": "docforge.loaders",
"docstring": "Loader layer for doc-forge.\n\nThe ``docforge.loaders`` package is responsible for discovering Python modules\nand extracting documentation data using static analysis.\n\n---\n\nOverview\n--------\n\nThis layer converts Python source code into an intermediate documentation\nmodel used by doc-forge. It performs module discovery, introspection, and\ninitial filtering before the data is passed to the core documentation models.\n\nCore capabilities include:\n\n- **Module discovery** – Locate Python modules and packages within a project.\n- **Static introspection** – Parse docstrings, signatures, and object\n hierarchies using the ``griffe`` library without executing the code.\n- **Public API filtering** – Exclude private members (names prefixed with\n ``_``) to produce clean public documentation structures.\n\n---", "docstring": "# Summary\n\nLoader layer for doc-forge.\n\nThe `docforge.loaders` package is responsible for discovering Python modules\nand extracting documentation data using static analysis.\n\n---\n\n# Overview\n\nThis layer converts Python source code into an intermediate documentation\nmodel used by doc-forge. It performs module discovery, introspection, and\ninitial filtering before the data is passed to the core documentation models.\n\nCore capabilities include:\n\n- **Module discovery** – Locate Python modules and packages within a project.\n- **Static introspection** – Parse docstrings, signatures, and object\n hierarchies using the `griffe` library without executing the code.\n- **Public API filtering** – Exclude private members (names prefixed with\n `_`) to produce clean public documentation structures.\n\n---",
"objects": { "objects": {
"GriffeLoader": { "GriffeLoader": {
"name": "GriffeLoader", "name": "GriffeLoader",
"kind": "class", "kind": "class",
"path": "docforge.loaders.GriffeLoader", "path": "docforge.loaders.GriffeLoader",
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.griffe_loader.GriffeLoader')>", "signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.griffe_loader.GriffeLoader')>",
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.", "docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into `Project`, `Module`,\nand `DocObject` instances used by doc-forge.",
"members": { "members": {
"load_project": { "load_project": {
"name": "load_project", "name": "load_project",
"kind": "function", "kind": "function",
"path": "docforge.loaders.GriffeLoader.load_project", "path": "docforge.loaders.GriffeLoader.load_project",
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>", "signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False." "docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a `Module`\ninstance. All modules are then aggregated into a single `Project`\nobject.\n\nArgs:\n module_paths (List[str]):\n List of dotted module import paths to load.\n\n project_name (str, optional):\n Optional override for the project name. Defaults to the top-level\n name of the first module.\n\n skip_import_errors (bool, optional):\n If True, modules that fail to load will be skipped instead of raising an error.\n\nReturns:\n Project:\n A populated `Project` instance containing the loaded modules.\n\nRaises:\n ValueError:\n If no module paths are provided.\n\n ImportError:\n If a module fails to load and `skip_import_errors` is False."
}, },
"load_module": { "load_module": {
"name": "load_module", "name": "load_module",
"kind": "function", "kind": "function",
"path": "docforge.loaders.GriffeLoader.load_module", "path": "docforge.loaders.GriffeLoader.load_module",
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>", "signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance." "docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge `Module` model.\n\nArgs:\n path (str):\n Dotted import path of the module.\n\nReturns:\n Module:\n A populated `Module` instance."
} }
} }
}, },
@@ -32,14 +32,14 @@
"kind": "function", "kind": "function",
"path": "docforge.loaders.discover_module_paths", "path": "docforge.loaders.discover_module_paths",
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.griffe_loader.discover_module_paths')>", "signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.griffe_loader.discover_module_paths')>",
"docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for ``.py`` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing ``__init__.py`` are treated as packages.\n- Each ``.py`` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name: Top-level package name to discover modules from.\n project_root: Root directory used to resolve module paths. If not\n provided, the current working directory is used.\n\nReturns:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError: If the specified package directory does not exist." "docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for `.py` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing `__init__.py` are treated as packages.\n- Each `.py` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name (str):\n Top-level package name to discover modules from.\n\n project_root (Path, optional):\n Root directory used to resolve module paths. If not provided, the\n current working directory is used.\n\nReturns:\n List[str]:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError:\n If the specified package directory does not exist."
}, },
"griffe_loader": { "griffe_loader": {
"name": "griffe_loader", "name": "griffe_loader",
"kind": "module", "kind": "module",
"path": "docforge.loaders.griffe_loader", "path": "docforge.loaders.griffe_loader",
"signature": null, "signature": null,
"docstring": "Utilities for loading and introspecting Python modules using Griffe.\n\nThis module provides the ``GriffeLoader`` class and helper utilities used to\ndiscover Python modules, introspect their structure, and convert the results\ninto doc-forge documentation models.", "docstring": "# Summary\n\nUtilities for loading and introspecting Python modules using Griffe.\n\nThis module provides the `GriffeLoader` class and helper utilities used to\ndiscover Python modules, introspect their structure, and convert the results\ninto doc-forge documentation models.",
"members": { "members": {
"logging": { "logging": {
"name": "logging", "name": "logging",
@@ -102,7 +102,7 @@
"kind": "class", "kind": "class",
"path": "docforge.loaders.griffe_loader.Module", "path": "docforge.loaders.griffe_loader.Module",
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>", "signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>",
"docstring": "Representation of a documented Python module or package.\n\nA ``Module`` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level documentation string, if present.\n members: Mapping of object names to their corresponding\n ``DocObject`` representations.", "docstring": "Representation of a documented Python module or package.\n\nA `Module` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path (str):\n Dotted import path of the module.\n\n docstring (Optional[str]):\n Module-level documentation string, if present.\n\n members (Dict[str, DocObject]):\n Mapping of object names to their corresponding `DocObject` representations.",
"members": { "members": {
"path": { "path": {
"name": "path", "name": "path",
@@ -130,21 +130,21 @@
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.Module.add_object", "path": "docforge.loaders.griffe_loader.Module.add_object",
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.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: Documentation object to register as a top-level\n member of the module." "docstring": "Add a documented object to the module.\n\nArgs:\n obj (DocObject):\n Documentation object to register as a top-level member of the module."
}, },
"get_object": { "get_object": {
"name": "get_object", "name": "get_object",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.Module.get_object", "path": "docforge.loaders.griffe_loader.Module.get_object",
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>", "signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
"docstring": "Retrieve a documented object by name.\n\nArgs:\n name: Name of the object to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If no object with the given name exists." "docstring": "Retrieve a documented object by name.\n\nArgs:\n name (str):\n Name of the object to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If no object with the given name exists."
}, },
"get_all_objects": { "get_all_objects": {
"name": "get_all_objects", "name": "get_all_objects",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.Module.get_all_objects", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
"docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n An iterable of ``DocObject`` instances representing the\n module's public members." "docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing the module's public members."
} }
} }
}, },
@@ -153,7 +153,7 @@
"kind": "class", "kind": "class",
"path": "docforge.loaders.griffe_loader.Project", "path": "docforge.loaders.griffe_loader.Project",
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>", "signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
"docstring": "Representation of a documentation project.\n\nA ``Project`` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name: Name of the project.\n modules: Mapping of module paths to ``Module`` instances.", "docstring": "Representation of a documentation project.\n\nA `Project` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name (str):\n Name of the project.\n\n modules (Dict[str, Module]):\n Mapping of module paths to `Module` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -174,28 +174,28 @@
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.Project.add_module", "path": "docforge.loaders.griffe_loader.Project.add_module",
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>", "signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
"docstring": "Register a module in the project.\n\nArgs:\n module: Module instance to add to the project." "docstring": "Register a module in the project.\n\nArgs:\n module (Module):\n Module instance to add to the project."
}, },
"get_module": { "get_module": {
"name": "get_module", "name": "get_module",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.Project.get_module", "path": "docforge.loaders.griffe_loader.Project.get_module",
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.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: Fully qualified dotted module path (for example ``pkg.module``).\n\nReturns:\n The corresponding ``Module`` instance.\n\nRaises:\n KeyError: If the module does not exist in the project." "docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path (str):\n Fully qualified dotted module path (for example `pkg.module`).\n\nReturns:\n Module:\n The corresponding `Module` instance.\n\nRaises:\n KeyError:\n If the module does not exist in the project."
}, },
"get_all_modules": { "get_all_modules": {
"name": "get_all_modules", "name": "get_all_modules",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.Project.get_all_modules", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
"docstring": "Return all modules contained in the project.\n\nReturns:\n An iterable of ``Module`` instances." "docstring": "Return all modules contained in the project.\n\nReturns:\n Iterable[Module]:\n An iterable of `Module` instances."
}, },
"get_module_list": { "get_module_list": {
"name": "get_module_list", "name": "get_module_list",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.Project.get_module_list", "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')>", "signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
"docstring": "Return the list of module import paths.\n\nReturns:\n A list containing the dotted paths of all modules in the project." "docstring": "Return the list of module import paths.\n\nReturns:\n list[str]:\n A list containing the dotted paths of all modules in the project."
} }
} }
}, },
@@ -204,7 +204,7 @@
"kind": "class", "kind": "class",
"path": "docforge.loaders.griffe_loader.DocObject", "path": "docforge.loaders.griffe_loader.DocObject",
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.DocObject')>", "signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.DocObject')>",
"docstring": "Representation of a documented Python object.\n\nA ``DocObject`` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (for example ``class``, ``function``,\n ``method``, or ``attribute``).\n path: Fully qualified dotted path to the object.\n signature: Callable signature if the object represents a callable.\n docstring: Raw docstring text extracted from the source code.\n members: Mapping of member names to child ``DocObject`` instances.", "docstring": "Representation of a documented Python object.\n\nA `DocObject` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name (str):\n Local name of the object.\n\n kind (str):\n Type of object (for example `class`, `function`, `method`, or `attribute`).\n\n path (str):\n Fully qualified dotted path to the object.\n\n signature (Optional[str]):\n Callable signature if the object represents a callable.\n\n docstring (Optional[str]):\n Raw docstring text extracted from the source code.\n\n members (Dict[str, DocObject]):\n Mapping of member names to child `DocObject` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -260,14 +260,14 @@
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.DocObject.get_member", "path": "docforge.loaders.griffe_loader.DocObject.get_member",
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>", "signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: Name of the member to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If the member does not exist." "docstring": "Retrieve a member object by name.\n\nArgs:\n name (str):\n Name of the member to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If the member does not exist."
}, },
"get_all_members": { "get_all_members": {
"name": "get_all_members", "name": "get_all_members",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.DocObject.get_all_members", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
"docstring": "Return all child members of the object.\n\nReturns:\n An iterable of ``DocObject`` instances representing nested members." "docstring": "Return all child members of the object.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing nested members."
} }
} }
}, },
@@ -282,29 +282,29 @@
"name": "discover_module_paths", "name": "discover_module_paths",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.discover_module_paths", "path": "docforge.loaders.griffe_loader.discover_module_paths",
"signature": "<bound method Function.signature of Function('discover_module_paths', 26, 73)>", "signature": "<bound method Function.signature of Function('discover_module_paths', 28, 80)>",
"docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for ``.py`` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing ``__init__.py`` are treated as packages.\n- Each ``.py`` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name: Top-level package name to discover modules from.\n project_root: Root directory used to resolve module paths. If not\n provided, the current working directory is used.\n\nReturns:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError: If the specified package directory does not exist." "docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for `.py` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing `__init__.py` are treated as packages.\n- Each `.py` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name (str):\n Top-level package name to discover modules from.\n\n project_root (Path, optional):\n Root directory used to resolve module paths. If not provided, the\n current working directory is used.\n\nReturns:\n List[str]:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError:\n If the specified package directory does not exist."
}, },
"GriffeLoader": { "GriffeLoader": {
"name": "GriffeLoader", "name": "GriffeLoader",
"kind": "class", "kind": "class",
"path": "docforge.loaders.griffe_loader.GriffeLoader", "path": "docforge.loaders.griffe_loader.GriffeLoader",
"signature": "<bound method Class.signature of Class('GriffeLoader', 76, 264)>", "signature": "<bound method Class.signature of Class('GriffeLoader', 83, 287)>",
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.", "docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into `Project`, `Module`,\nand `DocObject` instances used by doc-forge.",
"members": { "members": {
"load_project": { "load_project": {
"name": "load_project", "name": "load_project",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.GriffeLoader.load_project", "path": "docforge.loaders.griffe_loader.GriffeLoader.load_project",
"signature": "<bound method Function.signature of Function('load_project', 97, 144)>", "signature": "<bound method Function.signature of Function('load_project', 104, 158)>",
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False." "docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a `Module`\ninstance. All modules are then aggregated into a single `Project`\nobject.\n\nArgs:\n module_paths (List[str]):\n List of dotted module import paths to load.\n\n project_name (str, optional):\n Optional override for the project name. Defaults to the top-level\n name of the first module.\n\n skip_import_errors (bool, optional):\n If True, modules that fail to load will be skipped instead of raising an error.\n\nReturns:\n Project:\n A populated `Project` instance containing the loaded modules.\n\nRaises:\n ValueError:\n If no module paths are provided.\n\n ImportError:\n If a module fails to load and `skip_import_errors` is False."
}, },
"load_module": { "load_module": {
"name": "load_module", "name": "load_module",
"kind": "function", "kind": "function",
"path": "docforge.loaders.griffe_loader.GriffeLoader.load_module", "path": "docforge.loaders.griffe_loader.GriffeLoader.load_module",
"signature": "<bound method Function.signature of Function('load_module', 146, 162)>", "signature": "<bound method Function.signature of Function('load_module', 160, 178)>",
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance." "docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge `Module` model.\n\nArgs:\n path (str):\n Dotted import path of the module.\n\nReturns:\n Module:\n A populated `Module` instance."
} }
} }
} }

View File

@@ -2,14 +2,14 @@
"module": "docforge.models", "module": "docforge.models",
"content": { "content": {
"path": "docforge.models", "path": "docforge.models",
"docstring": "Model layer for doc-forge.\n\nThe ``docforge.models`` package defines the core data structures used to\nrepresent Python source code as a structured documentation model.\n\n---\n\nOverview\n--------\n\nThe model layer forms the central intermediate representation used throughout\ndoc-forge. Python modules and objects discovered during introspection are\nconverted into a hierarchy of documentation models that can later be rendered\ninto different documentation formats.\n\nKey components:\n\n- **Project** – Root container representing an entire documented codebase.\n- **Module** – Representation of a Python module or package containing\n documented members.\n- **DocObject** – Recursive structure representing Python objects such as\n classes, functions, methods, and attributes.\n\nThese models are intentionally **renderer-agnostic**, allowing the same\ndocumentation structure to be transformed into multiple output formats\n(e.g., MkDocs, MCP, or other renderers).\n\n---", "docstring": "# Summary\n\nModel layer for doc-forge.\n\nThe `docforge.models` package defines the core data structures used to\nrepresent Python source code as a structured documentation model.\n\n---\n\n# Overview\n\nThe model layer forms the central intermediate representation used throughout\ndoc-forge. Python modules and objects discovered during introspection are\nconverted into a hierarchy of documentation models that can later be rendered\ninto different documentation formats.\n\nKey components:\n\n- **Project** – Root container representing an entire documented codebase.\n- **Module** – Representation of a Python module or package containing\n documented members.\n- **DocObject** – Recursive structure representing Python objects such as\n classes, functions, methods, and attributes.\n\nThese models are intentionally **renderer-agnostic**, allowing the same\ndocumentation structure to be transformed into multiple output formats\n(e.g., MkDocs, MCP, or other renderers).\n\n---",
"objects": { "objects": {
"Project": { "Project": {
"name": "Project", "name": "Project",
"kind": "class", "kind": "class",
"path": "docforge.models.Project", "path": "docforge.models.Project",
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.project.Project')>", "signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.project.Project')>",
"docstring": "Representation of a documentation project.\n\nA ``Project`` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name: Name of the project.\n modules: Mapping of module paths to ``Module`` instances.", "docstring": "Representation of a documentation project.\n\nA `Project` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name (str):\n Name of the project.\n\n modules (Dict[str, Module]):\n Mapping of module paths to `Module` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -30,28 +30,28 @@
"kind": "function", "kind": "function",
"path": "docforge.models.Project.add_module", "path": "docforge.models.Project.add_module",
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>", "signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
"docstring": "Register a module in the project.\n\nArgs:\n module: Module instance to add to the project." "docstring": "Register a module in the project.\n\nArgs:\n module (Module):\n Module instance to add to the project."
}, },
"get_module": { "get_module": {
"name": "get_module", "name": "get_module",
"kind": "function", "kind": "function",
"path": "docforge.models.Project.get_module", "path": "docforge.models.Project.get_module",
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.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: Fully qualified dotted module path (for example ``pkg.module``).\n\nReturns:\n The corresponding ``Module`` instance.\n\nRaises:\n KeyError: If the module does not exist in the project." "docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path (str):\n Fully qualified dotted module path (for example `pkg.module`).\n\nReturns:\n Module:\n The corresponding `Module` instance.\n\nRaises:\n KeyError:\n If the module does not exist in the project."
}, },
"get_all_modules": { "get_all_modules": {
"name": "get_all_modules", "name": "get_all_modules",
"kind": "function", "kind": "function",
"path": "docforge.models.Project.get_all_modules", "path": "docforge.models.Project.get_all_modules",
"signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>", "signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
"docstring": "Return all modules contained in the project.\n\nReturns:\n An iterable of ``Module`` instances." "docstring": "Return all modules contained in the project.\n\nReturns:\n Iterable[Module]:\n An iterable of `Module` instances."
}, },
"get_module_list": { "get_module_list": {
"name": "get_module_list", "name": "get_module_list",
"kind": "function", "kind": "function",
"path": "docforge.models.Project.get_module_list", "path": "docforge.models.Project.get_module_list",
"signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>", "signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
"docstring": "Return the list of module import paths.\n\nReturns:\n A list containing the dotted paths of all modules in the project." "docstring": "Return the list of module import paths.\n\nReturns:\n list[str]:\n A list containing the dotted paths of all modules in the project."
} }
} }
}, },
@@ -60,7 +60,7 @@
"kind": "class", "kind": "class",
"path": "docforge.models.Module", "path": "docforge.models.Module",
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.module.Module')>", "signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.module.Module')>",
"docstring": "Representation of a documented Python module or package.\n\nA ``Module`` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level documentation string, if present.\n members: Mapping of object names to their corresponding\n ``DocObject`` representations.", "docstring": "Representation of a documented Python module or package.\n\nA `Module` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path (str):\n Dotted import path of the module.\n\n docstring (Optional[str]):\n Module-level documentation string, if present.\n\n members (Dict[str, DocObject]):\n Mapping of object names to their corresponding `DocObject` representations.",
"members": { "members": {
"path": { "path": {
"name": "path", "name": "path",
@@ -88,21 +88,21 @@
"kind": "function", "kind": "function",
"path": "docforge.models.Module.add_object", "path": "docforge.models.Module.add_object",
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.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: Documentation object to register as a top-level\n member of the module." "docstring": "Add a documented object to the module.\n\nArgs:\n obj (DocObject):\n Documentation object to register as a top-level member of the module."
}, },
"get_object": { "get_object": {
"name": "get_object", "name": "get_object",
"kind": "function", "kind": "function",
"path": "docforge.models.Module.get_object", "path": "docforge.models.Module.get_object",
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>", "signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
"docstring": "Retrieve a documented object by name.\n\nArgs:\n name: Name of the object to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If no object with the given name exists." "docstring": "Retrieve a documented object by name.\n\nArgs:\n name (str):\n Name of the object to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If no object with the given name exists."
}, },
"get_all_objects": { "get_all_objects": {
"name": "get_all_objects", "name": "get_all_objects",
"kind": "function", "kind": "function",
"path": "docforge.models.Module.get_all_objects", "path": "docforge.models.Module.get_all_objects",
"signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>", "signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
"docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n An iterable of ``DocObject`` instances representing the\n module's public members." "docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing the module's public members."
} }
} }
}, },
@@ -111,7 +111,7 @@
"kind": "class", "kind": "class",
"path": "docforge.models.DocObject", "path": "docforge.models.DocObject",
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.object.DocObject')>", "signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.object.DocObject')>",
"docstring": "Representation of a documented Python object.\n\nA ``DocObject`` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (for example ``class``, ``function``,\n ``method``, or ``attribute``).\n path: Fully qualified dotted path to the object.\n signature: Callable signature if the object represents a callable.\n docstring: Raw docstring text extracted from the source code.\n members: Mapping of member names to child ``DocObject`` instances.", "docstring": "Representation of a documented Python object.\n\nA `DocObject` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name (str):\n Local name of the object.\n\n kind (str):\n Type of object (for example `class`, `function`, `method`, or `attribute`).\n\n path (str):\n Fully qualified dotted path to the object.\n\n signature (Optional[str]):\n Callable signature if the object represents a callable.\n\n docstring (Optional[str]):\n Raw docstring text extracted from the source code.\n\n members (Dict[str, DocObject]):\n Mapping of member names to child `DocObject` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -167,14 +167,14 @@
"kind": "function", "kind": "function",
"path": "docforge.models.DocObject.get_member", "path": "docforge.models.DocObject.get_member",
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>", "signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: Name of the member to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If the member does not exist." "docstring": "Retrieve a member object by name.\n\nArgs:\n name (str):\n Name of the member to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If the member does not exist."
}, },
"get_all_members": { "get_all_members": {
"name": "get_all_members", "name": "get_all_members",
"kind": "function", "kind": "function",
"path": "docforge.models.DocObject.get_all_members", "path": "docforge.models.DocObject.get_all_members",
"signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>", "signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
"docstring": "Return all child members of the object.\n\nReturns:\n An iterable of ``DocObject`` instances representing nested members." "docstring": "Return all child members of the object.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing nested members."
} }
} }
}, },
@@ -183,7 +183,7 @@
"kind": "module", "kind": "module",
"path": "docforge.models.module", "path": "docforge.models.module",
"signature": null, "signature": null,
"docstring": "Documentation model representing a Python module or package.\n\nThis module defines the ``Module`` class used in the doc-forge documentation\nmodel. A ``Module`` acts as a container for top-level documented objects\n(classes, functions, variables, and other members) discovered during\nintrospection.", "docstring": "# Summary\n\nDocumentation model representing a Python module or package.\n\nThis module defines the `Module` class used in the doc-forge documentation\nmodel. A `Module` acts as a container for top-level documented objects\n(classes, functions, variables, and other members) discovered during\nintrospection.",
"members": { "members": {
"Dict": { "Dict": {
"name": "Dict", "name": "Dict",
@@ -211,7 +211,7 @@
"kind": "class", "kind": "class",
"path": "docforge.models.module.DocObject", "path": "docforge.models.module.DocObject",
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.object.DocObject')>", "signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.object.DocObject')>",
"docstring": "Representation of a documented Python object.\n\nA ``DocObject`` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (for example ``class``, ``function``,\n ``method``, or ``attribute``).\n path: Fully qualified dotted path to the object.\n signature: Callable signature if the object represents a callable.\n docstring: Raw docstring text extracted from the source code.\n members: Mapping of member names to child ``DocObject`` instances.", "docstring": "Representation of a documented Python object.\n\nA `DocObject` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name (str):\n Local name of the object.\n\n kind (str):\n Type of object (for example `class`, `function`, `method`, or `attribute`).\n\n path (str):\n Fully qualified dotted path to the object.\n\n signature (Optional[str]):\n Callable signature if the object represents a callable.\n\n docstring (Optional[str]):\n Raw docstring text extracted from the source code.\n\n members (Dict[str, DocObject]):\n Mapping of member names to child `DocObject` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -267,14 +267,14 @@
"kind": "function", "kind": "function",
"path": "docforge.models.module.DocObject.get_member", "path": "docforge.models.module.DocObject.get_member",
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>", "signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: Name of the member to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If the member does not exist." "docstring": "Retrieve a member object by name.\n\nArgs:\n name (str):\n Name of the member to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If the member does not exist."
}, },
"get_all_members": { "get_all_members": {
"name": "get_all_members", "name": "get_all_members",
"kind": "function", "kind": "function",
"path": "docforge.models.module.DocObject.get_all_members", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
"docstring": "Return all child members of the object.\n\nReturns:\n An iterable of ``DocObject`` instances representing nested members." "docstring": "Return all child members of the object.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing nested members."
} }
} }
}, },
@@ -282,8 +282,8 @@
"name": "Module", "name": "Module",
"kind": "class", "kind": "class",
"path": "docforge.models.module.Module", "path": "docforge.models.module.Module",
"signature": "<bound method Class.signature of Class('Module', 15, 79)>", "signature": "<bound method Class.signature of Class('Module', 17, 91)>",
"docstring": "Representation of a documented Python module or package.\n\nA ``Module`` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level documentation string, if present.\n members: Mapping of object names to their corresponding\n ``DocObject`` representations.", "docstring": "Representation of a documented Python module or package.\n\nA `Module` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path (str):\n Dotted import path of the module.\n\n docstring (Optional[str]):\n Module-level documentation string, if present.\n\n members (Dict[str, DocObject]):\n Mapping of object names to their corresponding `DocObject` representations.",
"members": { "members": {
"path": { "path": {
"name": "path", "name": "path",
@@ -310,22 +310,22 @@
"name": "add_object", "name": "add_object",
"kind": "function", "kind": "function",
"path": "docforge.models.module.Module.add_object", "path": "docforge.models.module.Module.add_object",
"signature": "<bound method Function.signature of Function('add_object', 46, 54)>", "signature": "<bound method Function.signature of Function('add_object', 55, 63)>",
"docstring": "Add a documented object to the module.\n\nArgs:\n obj: Documentation object to register as a top-level\n member of the module." "docstring": "Add a documented object to the module.\n\nArgs:\n obj (DocObject):\n Documentation object to register as a top-level member of the module."
}, },
"get_object": { "get_object": {
"name": "get_object", "name": "get_object",
"kind": "function", "kind": "function",
"path": "docforge.models.module.Module.get_object", "path": "docforge.models.module.Module.get_object",
"signature": "<bound method Function.signature of Function('get_object', 56, 69)>", "signature": "<bound method Function.signature of Function('get_object', 65, 81)>",
"docstring": "Retrieve a documented object by name.\n\nArgs:\n name: Name of the object to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If no object with the given name exists." "docstring": "Retrieve a documented object by name.\n\nArgs:\n name (str):\n Name of the object to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If no object with the given name exists."
}, },
"get_all_objects": { "get_all_objects": {
"name": "get_all_objects", "name": "get_all_objects",
"kind": "function", "kind": "function",
"path": "docforge.models.module.Module.get_all_objects", "path": "docforge.models.module.Module.get_all_objects",
"signature": "<bound method Function.signature of Function('get_all_objects', 71, 79)>", "signature": "<bound method Function.signature of Function('get_all_objects', 83, 91)>",
"docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n An iterable of ``DocObject`` instances representing the\n module's public members." "docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing the module's public members."
} }
} }
} }
@@ -336,7 +336,7 @@
"kind": "module", "kind": "module",
"path": "docforge.models.object", "path": "docforge.models.object",
"signature": null, "signature": null,
"docstring": "Documentation model representing individual Python objects.\n\nThis module defines the ``DocObject`` class, the fundamental recursive unit of\nthe doc-forge documentation model. Each ``DocObject`` represents a Python\nentity such as a class, function, method, or attribute, and may contain nested\nmembers that form a hierarchical documentation structure.", "docstring": "# Summary\n\nDocumentation model representing individual Python objects.\n\nThis module defines the `DocObject` class, the fundamental recursive unit of\nthe doc-forge documentation model. Each `DocObject` represents a Python\nentity such as a class, function, method, or attribute, and may contain nested\nmembers that form a hierarchical documentation structure.",
"members": { "members": {
"Dict": { "Dict": {
"name": "Dict", "name": "Dict",
@@ -363,8 +363,8 @@
"name": "DocObject", "name": "DocObject",
"kind": "class", "kind": "class",
"path": "docforge.models.object.DocObject", "path": "docforge.models.object.DocObject",
"signature": "<bound method Class.signature of Class('DocObject', 13, 90)>", "signature": "<bound method Class.signature of Class('DocObject', 15, 115)>",
"docstring": "Representation of a documented Python object.\n\nA ``DocObject`` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (for example ``class``, ``function``,\n ``method``, or ``attribute``).\n path: Fully qualified dotted path to the object.\n signature: Callable signature if the object represents a callable.\n docstring: Raw docstring text extracted from the source code.\n members: Mapping of member names to child ``DocObject`` instances.", "docstring": "Representation of a documented Python object.\n\nA `DocObject` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name (str):\n Local name of the object.\n\n kind (str):\n Type of object (for example `class`, `function`, `method`, or `attribute`).\n\n path (str):\n Fully qualified dotted path to the object.\n\n signature (Optional[str]):\n Callable signature if the object represents a callable.\n\n docstring (Optional[str]):\n Raw docstring text extracted from the source code.\n\n members (Dict[str, DocObject]):\n Mapping of member names to child `DocObject` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -412,22 +412,22 @@
"name": "add_member", "name": "add_member",
"kind": "function", "kind": "function",
"path": "docforge.models.object.DocObject.add_member", "path": "docforge.models.object.DocObject.add_member",
"signature": "<bound method Function.signature of Function('add_member', 56, 66)>", "signature": "<bound method Function.signature of Function('add_member', 77, 87)>",
"docstring": "Add a child documentation object.\n\nThis is typically used when attaching methods to classes or\nnested objects to their parent containers.\n\nArgs:\n obj: Documentation object to add as a member." "docstring": "Add a child documentation object.\n\nThis is typically used when attaching methods to classes or\nnested objects to their parent containers.\n\nArgs:\n obj: Documentation object to add as a member."
}, },
"get_member": { "get_member": {
"name": "get_member", "name": "get_member",
"kind": "function", "kind": "function",
"path": "docforge.models.object.DocObject.get_member", "path": "docforge.models.object.DocObject.get_member",
"signature": "<bound method Function.signature of Function('get_member', 68, 81)>", "signature": "<bound method Function.signature of Function('get_member', 89, 105)>",
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: Name of the member to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If the member does not exist." "docstring": "Retrieve a member object by name.\n\nArgs:\n name (str):\n Name of the member to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If the member does not exist."
}, },
"get_all_members": { "get_all_members": {
"name": "get_all_members", "name": "get_all_members",
"kind": "function", "kind": "function",
"path": "docforge.models.object.DocObject.get_all_members", "path": "docforge.models.object.DocObject.get_all_members",
"signature": "<bound method Function.signature of Function('get_all_members', 83, 90)>", "signature": "<bound method Function.signature of Function('get_all_members', 107, 115)>",
"docstring": "Return all child members of the object.\n\nReturns:\n An iterable of ``DocObject`` instances representing nested members." "docstring": "Return all child members of the object.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing nested members."
} }
} }
} }
@@ -438,7 +438,7 @@
"kind": "module", "kind": "module",
"path": "docforge.models.project", "path": "docforge.models.project",
"signature": null, "signature": null,
"docstring": "Documentation model representing a project.\n\nThis module defines the ``Project`` class, the top-level container used by\ndoc-forge to represent a documented codebase. A ``Project`` aggregates multiple\nmodules and provides access to them through a unified interface.", "docstring": "# Summary\n\nDocumentation model representing a project.\n\nThis module defines the `Project` class, the top-level container used by\ndoc-forge to represent a documented codebase. A `Project` aggregates multiple\nmodules and provides access to them through a unified interface.",
"members": { "members": {
"Dict": { "Dict": {
"name": "Dict", "name": "Dict",
@@ -459,7 +459,7 @@
"kind": "class", "kind": "class",
"path": "docforge.models.project.Module", "path": "docforge.models.project.Module",
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.module.Module')>", "signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.module.Module')>",
"docstring": "Representation of a documented Python module or package.\n\nA ``Module`` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level documentation string, if present.\n members: Mapping of object names to their corresponding\n ``DocObject`` representations.", "docstring": "Representation of a documented Python module or package.\n\nA `Module` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path (str):\n Dotted import path of the module.\n\n docstring (Optional[str]):\n Module-level documentation string, if present.\n\n members (Dict[str, DocObject]):\n Mapping of object names to their corresponding `DocObject` representations.",
"members": { "members": {
"path": { "path": {
"name": "path", "name": "path",
@@ -487,21 +487,21 @@
"kind": "function", "kind": "function",
"path": "docforge.models.project.Module.add_object", "path": "docforge.models.project.Module.add_object",
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.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: Documentation object to register as a top-level\n member of the module." "docstring": "Add a documented object to the module.\n\nArgs:\n obj (DocObject):\n Documentation object to register as a top-level member of the module."
}, },
"get_object": { "get_object": {
"name": "get_object", "name": "get_object",
"kind": "function", "kind": "function",
"path": "docforge.models.project.Module.get_object", "path": "docforge.models.project.Module.get_object",
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>", "signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
"docstring": "Retrieve a documented object by name.\n\nArgs:\n name: Name of the object to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If no object with the given name exists." "docstring": "Retrieve a documented object by name.\n\nArgs:\n name (str):\n Name of the object to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If no object with the given name exists."
}, },
"get_all_objects": { "get_all_objects": {
"name": "get_all_objects", "name": "get_all_objects",
"kind": "function", "kind": "function",
"path": "docforge.models.project.Module.get_all_objects", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
"docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n An iterable of ``DocObject`` instances representing the\n module's public members." "docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing the module's public members."
} }
} }
}, },
@@ -509,8 +509,8 @@
"name": "Project", "name": "Project",
"kind": "class", "kind": "class",
"path": "docforge.models.project.Project", "path": "docforge.models.project.Project",
"signature": "<bound method Class.signature of Class('Project', 14, 76)>", "signature": "<bound method Class.signature of Class('Project', 16, 88)>",
"docstring": "Representation of a documentation project.\n\nA ``Project`` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name: Name of the project.\n modules: Mapping of module paths to ``Module`` instances.", "docstring": "Representation of a documentation project.\n\nA `Project` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name (str):\n Name of the project.\n\n modules (Dict[str, Module]):\n Mapping of module paths to `Module` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -530,29 +530,29 @@
"name": "add_module", "name": "add_module",
"kind": "function", "kind": "function",
"path": "docforge.models.project.Project.add_module", "path": "docforge.models.project.Project.add_module",
"signature": "<bound method Function.signature of Function('add_module', 36, 43)>", "signature": "<bound method Function.signature of Function('add_module', 42, 50)>",
"docstring": "Register a module in the project.\n\nArgs:\n module: Module instance to add to the project." "docstring": "Register a module in the project.\n\nArgs:\n module (Module):\n Module instance to add to the project."
}, },
"get_module": { "get_module": {
"name": "get_module", "name": "get_module",
"kind": "function", "kind": "function",
"path": "docforge.models.project.Project.get_module", "path": "docforge.models.project.Project.get_module",
"signature": "<bound method Function.signature of Function('get_module', 45, 58)>", "signature": "<bound method Function.signature of Function('get_module', 52, 68)>",
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: Fully qualified dotted module path (for example ``pkg.module``).\n\nReturns:\n The corresponding ``Module`` instance.\n\nRaises:\n KeyError: If the module does not exist in the project." "docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path (str):\n Fully qualified dotted module path (for example `pkg.module`).\n\nReturns:\n Module:\n The corresponding `Module` instance.\n\nRaises:\n KeyError:\n If the module does not exist in the project."
}, },
"get_all_modules": { "get_all_modules": {
"name": "get_all_modules", "name": "get_all_modules",
"kind": "function", "kind": "function",
"path": "docforge.models.project.Project.get_all_modules", "path": "docforge.models.project.Project.get_all_modules",
"signature": "<bound method Function.signature of Function('get_all_modules', 60, 67)>", "signature": "<bound method Function.signature of Function('get_all_modules', 70, 78)>",
"docstring": "Return all modules contained in the project.\n\nReturns:\n An iterable of ``Module`` instances." "docstring": "Return all modules contained in the project.\n\nReturns:\n Iterable[Module]:\n An iterable of `Module` instances."
}, },
"get_module_list": { "get_module_list": {
"name": "get_module_list", "name": "get_module_list",
"kind": "function", "kind": "function",
"path": "docforge.models.project.Project.get_module_list", "path": "docforge.models.project.Project.get_module_list",
"signature": "<bound method Function.signature of Function('get_module_list', 69, 76)>", "signature": "<bound method Function.signature of Function('get_module_list', 80, 88)>",
"docstring": "Return the list of module import paths.\n\nReturns:\n A list containing the dotted paths of all modules in the project." "docstring": "Return the list of module import paths.\n\nReturns:\n list[str]:\n A list containing the dotted paths of all modules in the project."
} }
} }
} }

View File

@@ -2,7 +2,7 @@
"module": "docforge.models.module", "module": "docforge.models.module",
"content": { "content": {
"path": "docforge.models.module", "path": "docforge.models.module",
"docstring": "Documentation model representing a Python module or package.\n\nThis module defines the ``Module`` class used in the doc-forge documentation\nmodel. A ``Module`` acts as a container for top-level documented objects\n(classes, functions, variables, and other members) discovered during\nintrospection.", "docstring": "# Summary\n\nDocumentation model representing a Python module or package.\n\nThis module defines the `Module` class used in the doc-forge documentation\nmodel. A `Module` acts as a container for top-level documented objects\n(classes, functions, variables, and other members) discovered during\nintrospection.",
"objects": { "objects": {
"Dict": { "Dict": {
"name": "Dict", "name": "Dict",
@@ -30,7 +30,7 @@
"kind": "class", "kind": "class",
"path": "docforge.models.module.DocObject", "path": "docforge.models.module.DocObject",
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.object.DocObject')>", "signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.object.DocObject')>",
"docstring": "Representation of a documented Python object.\n\nA ``DocObject`` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (for example ``class``, ``function``,\n ``method``, or ``attribute``).\n path: Fully qualified dotted path to the object.\n signature: Callable signature if the object represents a callable.\n docstring: Raw docstring text extracted from the source code.\n members: Mapping of member names to child ``DocObject`` instances.", "docstring": "Representation of a documented Python object.\n\nA `DocObject` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name (str):\n Local name of the object.\n\n kind (str):\n Type of object (for example `class`, `function`, `method`, or `attribute`).\n\n path (str):\n Fully qualified dotted path to the object.\n\n signature (Optional[str]):\n Callable signature if the object represents a callable.\n\n docstring (Optional[str]):\n Raw docstring text extracted from the source code.\n\n members (Dict[str, DocObject]):\n Mapping of member names to child `DocObject` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -86,14 +86,14 @@
"kind": "function", "kind": "function",
"path": "docforge.models.module.DocObject.get_member", "path": "docforge.models.module.DocObject.get_member",
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>", "signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: Name of the member to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If the member does not exist." "docstring": "Retrieve a member object by name.\n\nArgs:\n name (str):\n Name of the member to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If the member does not exist."
}, },
"get_all_members": { "get_all_members": {
"name": "get_all_members", "name": "get_all_members",
"kind": "function", "kind": "function",
"path": "docforge.models.module.DocObject.get_all_members", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
"docstring": "Return all child members of the object.\n\nReturns:\n An iterable of ``DocObject`` instances representing nested members." "docstring": "Return all child members of the object.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing nested members."
} }
} }
}, },
@@ -101,8 +101,8 @@
"name": "Module", "name": "Module",
"kind": "class", "kind": "class",
"path": "docforge.models.module.Module", "path": "docforge.models.module.Module",
"signature": "<bound method Class.signature of Class('Module', 15, 79)>", "signature": "<bound method Class.signature of Class('Module', 17, 91)>",
"docstring": "Representation of a documented Python module or package.\n\nA ``Module`` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level documentation string, if present.\n members: Mapping of object names to their corresponding\n ``DocObject`` representations.", "docstring": "Representation of a documented Python module or package.\n\nA `Module` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path (str):\n Dotted import path of the module.\n\n docstring (Optional[str]):\n Module-level documentation string, if present.\n\n members (Dict[str, DocObject]):\n Mapping of object names to their corresponding `DocObject` representations.",
"members": { "members": {
"path": { "path": {
"name": "path", "name": "path",
@@ -129,22 +129,22 @@
"name": "add_object", "name": "add_object",
"kind": "function", "kind": "function",
"path": "docforge.models.module.Module.add_object", "path": "docforge.models.module.Module.add_object",
"signature": "<bound method Function.signature of Function('add_object', 46, 54)>", "signature": "<bound method Function.signature of Function('add_object', 55, 63)>",
"docstring": "Add a documented object to the module.\n\nArgs:\n obj: Documentation object to register as a top-level\n member of the module." "docstring": "Add a documented object to the module.\n\nArgs:\n obj (DocObject):\n Documentation object to register as a top-level member of the module."
}, },
"get_object": { "get_object": {
"name": "get_object", "name": "get_object",
"kind": "function", "kind": "function",
"path": "docforge.models.module.Module.get_object", "path": "docforge.models.module.Module.get_object",
"signature": "<bound method Function.signature of Function('get_object', 56, 69)>", "signature": "<bound method Function.signature of Function('get_object', 65, 81)>",
"docstring": "Retrieve a documented object by name.\n\nArgs:\n name: Name of the object to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If no object with the given name exists." "docstring": "Retrieve a documented object by name.\n\nArgs:\n name (str):\n Name of the object to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If no object with the given name exists."
}, },
"get_all_objects": { "get_all_objects": {
"name": "get_all_objects", "name": "get_all_objects",
"kind": "function", "kind": "function",
"path": "docforge.models.module.Module.get_all_objects", "path": "docforge.models.module.Module.get_all_objects",
"signature": "<bound method Function.signature of Function('get_all_objects', 71, 79)>", "signature": "<bound method Function.signature of Function('get_all_objects', 83, 91)>",
"docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n An iterable of ``DocObject`` instances representing the\n module's public members." "docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing the module's public members."
} }
} }
} }

View File

@@ -2,7 +2,7 @@
"module": "docforge.models.object", "module": "docforge.models.object",
"content": { "content": {
"path": "docforge.models.object", "path": "docforge.models.object",
"docstring": "Documentation model representing individual Python objects.\n\nThis module defines the ``DocObject`` class, the fundamental recursive unit of\nthe doc-forge documentation model. Each ``DocObject`` represents a Python\nentity such as a class, function, method, or attribute, and may contain nested\nmembers that form a hierarchical documentation structure.", "docstring": "# Summary\n\nDocumentation model representing individual Python objects.\n\nThis module defines the `DocObject` class, the fundamental recursive unit of\nthe doc-forge documentation model. Each `DocObject` represents a Python\nentity such as a class, function, method, or attribute, and may contain nested\nmembers that form a hierarchical documentation structure.",
"objects": { "objects": {
"Dict": { "Dict": {
"name": "Dict", "name": "Dict",
@@ -29,8 +29,8 @@
"name": "DocObject", "name": "DocObject",
"kind": "class", "kind": "class",
"path": "docforge.models.object.DocObject", "path": "docforge.models.object.DocObject",
"signature": "<bound method Class.signature of Class('DocObject', 13, 90)>", "signature": "<bound method Class.signature of Class('DocObject', 15, 115)>",
"docstring": "Representation of a documented Python object.\n\nA ``DocObject`` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (for example ``class``, ``function``,\n ``method``, or ``attribute``).\n path: Fully qualified dotted path to the object.\n signature: Callable signature if the object represents a callable.\n docstring: Raw docstring text extracted from the source code.\n members: Mapping of member names to child ``DocObject`` instances.", "docstring": "Representation of a documented Python object.\n\nA `DocObject` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name (str):\n Local name of the object.\n\n kind (str):\n Type of object (for example `class`, `function`, `method`, or `attribute`).\n\n path (str):\n Fully qualified dotted path to the object.\n\n signature (Optional[str]):\n Callable signature if the object represents a callable.\n\n docstring (Optional[str]):\n Raw docstring text extracted from the source code.\n\n members (Dict[str, DocObject]):\n Mapping of member names to child `DocObject` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -78,22 +78,22 @@
"name": "add_member", "name": "add_member",
"kind": "function", "kind": "function",
"path": "docforge.models.object.DocObject.add_member", "path": "docforge.models.object.DocObject.add_member",
"signature": "<bound method Function.signature of Function('add_member', 56, 66)>", "signature": "<bound method Function.signature of Function('add_member', 77, 87)>",
"docstring": "Add a child documentation object.\n\nThis is typically used when attaching methods to classes or\nnested objects to their parent containers.\n\nArgs:\n obj: Documentation object to add as a member." "docstring": "Add a child documentation object.\n\nThis is typically used when attaching methods to classes or\nnested objects to their parent containers.\n\nArgs:\n obj: Documentation object to add as a member."
}, },
"get_member": { "get_member": {
"name": "get_member", "name": "get_member",
"kind": "function", "kind": "function",
"path": "docforge.models.object.DocObject.get_member", "path": "docforge.models.object.DocObject.get_member",
"signature": "<bound method Function.signature of Function('get_member', 68, 81)>", "signature": "<bound method Function.signature of Function('get_member', 89, 105)>",
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: Name of the member to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If the member does not exist." "docstring": "Retrieve a member object by name.\n\nArgs:\n name (str):\n Name of the member to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If the member does not exist."
}, },
"get_all_members": { "get_all_members": {
"name": "get_all_members", "name": "get_all_members",
"kind": "function", "kind": "function",
"path": "docforge.models.object.DocObject.get_all_members", "path": "docforge.models.object.DocObject.get_all_members",
"signature": "<bound method Function.signature of Function('get_all_members', 83, 90)>", "signature": "<bound method Function.signature of Function('get_all_members', 107, 115)>",
"docstring": "Return all child members of the object.\n\nReturns:\n An iterable of ``DocObject`` instances representing nested members." "docstring": "Return all child members of the object.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing nested members."
} }
} }
} }

View File

@@ -2,7 +2,7 @@
"module": "docforge.models.project", "module": "docforge.models.project",
"content": { "content": {
"path": "docforge.models.project", "path": "docforge.models.project",
"docstring": "Documentation model representing a project.\n\nThis module defines the ``Project`` class, the top-level container used by\ndoc-forge to represent a documented codebase. A ``Project`` aggregates multiple\nmodules and provides access to them through a unified interface.", "docstring": "# Summary\n\nDocumentation model representing a project.\n\nThis module defines the `Project` class, the top-level container used by\ndoc-forge to represent a documented codebase. A `Project` aggregates multiple\nmodules and provides access to them through a unified interface.",
"objects": { "objects": {
"Dict": { "Dict": {
"name": "Dict", "name": "Dict",
@@ -23,7 +23,7 @@
"kind": "class", "kind": "class",
"path": "docforge.models.project.Module", "path": "docforge.models.project.Module",
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.module.Module')>", "signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.module.Module')>",
"docstring": "Representation of a documented Python module or package.\n\nA ``Module`` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level documentation string, if present.\n members: Mapping of object names to their corresponding\n ``DocObject`` representations.", "docstring": "Representation of a documented Python module or package.\n\nA `Module` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path (str):\n Dotted import path of the module.\n\n docstring (Optional[str]):\n Module-level documentation string, if present.\n\n members (Dict[str, DocObject]):\n Mapping of object names to their corresponding `DocObject` representations.",
"members": { "members": {
"path": { "path": {
"name": "path", "name": "path",
@@ -51,21 +51,21 @@
"kind": "function", "kind": "function",
"path": "docforge.models.project.Module.add_object", "path": "docforge.models.project.Module.add_object",
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.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: Documentation object to register as a top-level\n member of the module." "docstring": "Add a documented object to the module.\n\nArgs:\n obj (DocObject):\n Documentation object to register as a top-level member of the module."
}, },
"get_object": { "get_object": {
"name": "get_object", "name": "get_object",
"kind": "function", "kind": "function",
"path": "docforge.models.project.Module.get_object", "path": "docforge.models.project.Module.get_object",
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>", "signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
"docstring": "Retrieve a documented object by name.\n\nArgs:\n name: Name of the object to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If no object with the given name exists." "docstring": "Retrieve a documented object by name.\n\nArgs:\n name (str):\n Name of the object to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If no object with the given name exists."
}, },
"get_all_objects": { "get_all_objects": {
"name": "get_all_objects", "name": "get_all_objects",
"kind": "function", "kind": "function",
"path": "docforge.models.project.Module.get_all_objects", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
"docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n An iterable of ``DocObject`` instances representing the\n module's public members." "docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing the module's public members."
} }
} }
}, },
@@ -73,8 +73,8 @@
"name": "Project", "name": "Project",
"kind": "class", "kind": "class",
"path": "docforge.models.project.Project", "path": "docforge.models.project.Project",
"signature": "<bound method Class.signature of Class('Project', 14, 76)>", "signature": "<bound method Class.signature of Class('Project', 16, 88)>",
"docstring": "Representation of a documentation project.\n\nA ``Project`` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name: Name of the project.\n modules: Mapping of module paths to ``Module`` instances.", "docstring": "Representation of a documentation project.\n\nA `Project` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name (str):\n Name of the project.\n\n modules (Dict[str, Module]):\n Mapping of module paths to `Module` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -94,29 +94,29 @@
"name": "add_module", "name": "add_module",
"kind": "function", "kind": "function",
"path": "docforge.models.project.Project.add_module", "path": "docforge.models.project.Project.add_module",
"signature": "<bound method Function.signature of Function('add_module', 36, 43)>", "signature": "<bound method Function.signature of Function('add_module', 42, 50)>",
"docstring": "Register a module in the project.\n\nArgs:\n module: Module instance to add to the project." "docstring": "Register a module in the project.\n\nArgs:\n module (Module):\n Module instance to add to the project."
}, },
"get_module": { "get_module": {
"name": "get_module", "name": "get_module",
"kind": "function", "kind": "function",
"path": "docforge.models.project.Project.get_module", "path": "docforge.models.project.Project.get_module",
"signature": "<bound method Function.signature of Function('get_module', 45, 58)>", "signature": "<bound method Function.signature of Function('get_module', 52, 68)>",
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: Fully qualified dotted module path (for example ``pkg.module``).\n\nReturns:\n The corresponding ``Module`` instance.\n\nRaises:\n KeyError: If the module does not exist in the project." "docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path (str):\n Fully qualified dotted module path (for example `pkg.module`).\n\nReturns:\n Module:\n The corresponding `Module` instance.\n\nRaises:\n KeyError:\n If the module does not exist in the project."
}, },
"get_all_modules": { "get_all_modules": {
"name": "get_all_modules", "name": "get_all_modules",
"kind": "function", "kind": "function",
"path": "docforge.models.project.Project.get_all_modules", "path": "docforge.models.project.Project.get_all_modules",
"signature": "<bound method Function.signature of Function('get_all_modules', 60, 67)>", "signature": "<bound method Function.signature of Function('get_all_modules', 70, 78)>",
"docstring": "Return all modules contained in the project.\n\nReturns:\n An iterable of ``Module`` instances." "docstring": "Return all modules contained in the project.\n\nReturns:\n Iterable[Module]:\n An iterable of `Module` instances."
}, },
"get_module_list": { "get_module_list": {
"name": "get_module_list", "name": "get_module_list",
"kind": "function", "kind": "function",
"path": "docforge.models.project.Project.get_module_list", "path": "docforge.models.project.Project.get_module_list",
"signature": "<bound method Function.signature of Function('get_module_list', 69, 76)>", "signature": "<bound method Function.signature of Function('get_module_list', 80, 88)>",
"docstring": "Return the list of module import paths.\n\nReturns:\n A list containing the dotted paths of all modules in the project." "docstring": "Return the list of module import paths.\n\nReturns:\n list[str]:\n A list containing the dotted paths of all modules in the project."
} }
} }
} }

View File

@@ -2,7 +2,7 @@
"module": "docforge.renderers.base", "module": "docforge.renderers.base",
"content": { "content": {
"path": "docforge.renderers.base", "path": "docforge.renderers.base",
"docstring": "Renderer base interfaces and configuration models.\n\nThis module defines the base protocol and configuration container used by\ndoc-forge renderers. Concrete renderer implementations should implement the\n``DocRenderer`` protocol.", "docstring": "# Summary\n\nRenderer base interfaces and configuration models.\n\nThis module defines the base protocol and configuration container used by\ndoc-forge renderers. Concrete renderer implementations should implement the\n`DocRenderer` protocol.",
"objects": { "objects": {
"Path": { "Path": {
"name": "Path", "name": "Path",
@@ -23,7 +23,7 @@
"kind": "class", "kind": "class",
"path": "docforge.renderers.base.Project", "path": "docforge.renderers.base.Project",
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>", "signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
"docstring": "Representation of a documentation project.\n\nA ``Project`` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name: Name of the project.\n modules: Mapping of module paths to ``Module`` instances.", "docstring": "Representation of a documentation project.\n\nA `Project` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name (str):\n Name of the project.\n\n modules (Dict[str, Module]):\n Mapping of module paths to `Module` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -44,28 +44,28 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.base.Project.add_module", "path": "docforge.renderers.base.Project.add_module",
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>", "signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
"docstring": "Register a module in the project.\n\nArgs:\n module: Module instance to add to the project." "docstring": "Register a module in the project.\n\nArgs:\n module (Module):\n Module instance to add to the project."
}, },
"get_module": { "get_module": {
"name": "get_module", "name": "get_module",
"kind": "function", "kind": "function",
"path": "docforge.renderers.base.Project.get_module", "path": "docforge.renderers.base.Project.get_module",
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.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: Fully qualified dotted module path (for example ``pkg.module``).\n\nReturns:\n The corresponding ``Module`` instance.\n\nRaises:\n KeyError: If the module does not exist in the project." "docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path (str):\n Fully qualified dotted module path (for example `pkg.module`).\n\nReturns:\n Module:\n The corresponding `Module` instance.\n\nRaises:\n KeyError:\n If the module does not exist in the project."
}, },
"get_all_modules": { "get_all_modules": {
"name": "get_all_modules", "name": "get_all_modules",
"kind": "function", "kind": "function",
"path": "docforge.renderers.base.Project.get_all_modules", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
"docstring": "Return all modules contained in the project.\n\nReturns:\n An iterable of ``Module`` instances." "docstring": "Return all modules contained in the project.\n\nReturns:\n Iterable[Module]:\n An iterable of `Module` instances."
}, },
"get_module_list": { "get_module_list": {
"name": "get_module_list", "name": "get_module_list",
"kind": "function", "kind": "function",
"path": "docforge.renderers.base.Project.get_module_list", "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')>", "signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
"docstring": "Return the list of module import paths.\n\nReturns:\n A list containing the dotted paths of all modules in the project." "docstring": "Return the list of module import paths.\n\nReturns:\n list[str]:\n A list containing the dotted paths of all modules in the project."
} }
} }
}, },
@@ -73,8 +73,8 @@
"name": "RendererConfig", "name": "RendererConfig",
"kind": "class", "kind": "class",
"path": "docforge.renderers.base.RendererConfig", "path": "docforge.renderers.base.RendererConfig",
"signature": "<bound method Class.signature of Class('RendererConfig', 15, 36)>", "signature": "<bound method Class.signature of Class('RendererConfig', 17, 44)>",
"docstring": "Configuration container for documentation renderers.\n\nA ``RendererConfig`` instance groups together the project model and the\noutput directory used during rendering.\n\nAttributes:\n out_dir: Directory where generated documentation files will be written.\n project: Documentation project model to be rendered.", "docstring": "Configuration container for documentation renderers.\n\nA `RendererConfig` instance groups together the project model and the\noutput directory used during rendering.\n\nAttributes:\n out_dir (Path):\n Directory where generated documentation files will be written.\n\n project (Project):\n Documentation project model to be rendered.",
"members": { "members": {
"out_dir": { "out_dir": {
"name": "out_dir", "name": "out_dir",
@@ -96,8 +96,8 @@
"name": "DocRenderer", "name": "DocRenderer",
"kind": "class", "kind": "class",
"path": "docforge.renderers.base.DocRenderer", "path": "docforge.renderers.base.DocRenderer",
"signature": "<bound method Class.signature of Class('DocRenderer', 39, 62)>", "signature": "<bound method Class.signature of Class('DocRenderer', 47, 72)>",
"docstring": "Protocol defining the interface for documentation renderers.\n\nImplementations of this protocol are responsible for transforming a\n``Project`` model into renderer-specific documentation sources.", "docstring": "Protocol defining the interface for documentation renderers.\n\nImplementations of this protocol are responsible for transforming a\n`Project` model into renderer-specific documentation sources.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -110,8 +110,8 @@
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.renderers.base.DocRenderer.generate_sources", "path": "docforge.renderers.base.DocRenderer.generate_sources",
"signature": "<bound method Function.signature of Function('generate_sources', 49, 62)>", "signature": "<bound method Function.signature of Function('generate_sources', 57, 72)>",
"docstring": "Generate renderer-specific documentation sources.\n\nArgs:\n project: Project model containing modules and documentation objects.\n out_dir: Directory where generated documentation sources\n should be written." "docstring": "Generate renderer-specific documentation sources.\n\nArgs:\n project (Project):\n Project model containing modules and documentation objects.\n\n out_dir (Path):\n Directory where generated documentation sources should be written."
} }
} }
} }

View File

@@ -2,7 +2,7 @@
"module": "docforge.renderers", "module": "docforge.renderers",
"content": { "content": {
"path": "docforge.renderers", "path": "docforge.renderers",
"docstring": "Renderers layer for doc-forge.\n\nThe ``docforge.renderers`` package transforms the internal documentation\nmodels into files formatted for specific documentation systems.\n\n---\n\nOverview\n--------\n\nRenderers consume the doc-forge project model and generate output suitable\nfor documentation tools or machine interfaces.\n\nCurrent implementations:\n\n- **MkDocsRenderer** – Produces Markdown files compatible with MkDocs and\n the ``mkdocstrings`` plugin. It automatically handles package hierarchy\n and generates ``index.md`` files for packages.\n- **MCPRenderer** – Emits structured JSON resources designed for consumption\n by Model Context Protocol (MCP) clients.\n\n---\n\nExtending\n---------\n\nNew renderers can be added by implementing the ``DocRenderer`` protocol\ndefined in ``docforge.renderers.base``.\n\n---", "docstring": "# Summary\n\nRenderers layer for doc-forge.\n\nThe `docforge.renderers` package transforms the internal documentation\nmodels into files formatted for specific documentation systems.\n\n---\n\n# Overview\n\nRenderers consume the doc-forge project model and generate output suitable\nfor documentation tools or machine interfaces.\n\nCurrent implementations:\n\n- **MkDocsRenderer** – Produces Markdown files compatible with MkDocs and\n the `mkdocstrings` plugin. It automatically handles package hierarchy\n and generates `index.md` files for packages.\n- **MCPRenderer** – Emits structured JSON resources designed for consumption\n by Model Context Protocol (MCP) clients.\n\n---\n\n# Extending\n\nNew renderers can be added by implementing the `DocRenderer` protocol\ndefined in `docforge.renderers.base`.\n\n---",
"objects": { "objects": {
"MkDocsRenderer": { "MkDocsRenderer": {
"name": "MkDocsRenderer", "name": "MkDocsRenderer",
@@ -23,14 +23,14 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.MkDocsRenderer.generate_sources", "path": "docforge.renderers.MkDocsRenderer.generate_sources",
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>", "signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
"docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project: Project model containing modules to document.\n out_dir: Directory where generated Markdown files will be written.\n module_is_source: If True, treat the specified module as the\n documentation root rather than nesting it inside a folder." "docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project (Project):\n Project model containing modules to document.\n\n out_dir (Path):\n Directory where generated Markdown files will be written.\n\n module_is_source (bool, optional):\n If True, treat the specified module as the documentation root\n rather than nesting it inside a folder."
}, },
"generate_readme": { "generate_readme": {
"name": "generate_readme", "name": "generate_readme",
"kind": "function", "kind": "function",
"path": "docforge.renderers.MkDocsRenderer.generate_readme", "path": "docforge.renderers.MkDocsRenderer.generate_readme",
"signature": "<bound method Alias.signature of Alias('generate_readme', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme')>", "signature": "<bound method Alias.signature of Alias('generate_readme', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme')>",
"docstring": "Generate a ``README.md`` file from the root module docstring.\n\nBehavior:\n\n- If ``module_is_source`` is True, ``README.md`` is written to the\n project root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project: Project model containing documentation metadata.\n docs_dir: Directory containing generated documentation sources.\n module_is_source: Whether the module is treated as the project\n source root." "docstring": "Generate a `README.md` file from the root module docstring.\n\nBehavior:\n\n- If `module_is_source` is True, `README.md` is written to the project\n root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project (Project):\n Project model containing documentation metadata.\n\n docs_dir (Path):\n Directory containing generated documentation sources.\n\n module_is_source (bool, optional):\n Whether the module is treated as the project source root."
} }
} }
}, },
@@ -53,7 +53,7 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.MCPRenderer.generate_sources", "path": "docforge.renderers.MCPRenderer.generate_sources",
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>", "signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mcp_renderer.MCPRenderer.generate_sources')>",
"docstring": "Generate MCP documentation resources for a project.\n\nThe renderer serializes each module into a JSON resource and produces\nsupporting metadata files such as ``nav.json`` and ``index.json``.\n\nArgs:\n project: Documentation project model to render.\n out_dir: Directory where MCP resources will be written." "docstring": "Generate MCP documentation resources for a project.\n\nThe renderer serializes each module into a JSON resource and produces\nsupporting metadata files such as `nav.json` and `index.json`.\n\nArgs:\n project (Project):\n Documentation project model to render.\n\n out_dir (Path):\n Directory where MCP resources will be written."
} }
} }
}, },
@@ -62,7 +62,7 @@
"kind": "module", "kind": "module",
"path": "docforge.renderers.base", "path": "docforge.renderers.base",
"signature": null, "signature": null,
"docstring": "Renderer base interfaces and configuration models.\n\nThis module defines the base protocol and configuration container used by\ndoc-forge renderers. Concrete renderer implementations should implement the\n``DocRenderer`` protocol.", "docstring": "# Summary\n\nRenderer base interfaces and configuration models.\n\nThis module defines the base protocol and configuration container used by\ndoc-forge renderers. Concrete renderer implementations should implement the\n`DocRenderer` protocol.",
"members": { "members": {
"Path": { "Path": {
"name": "Path", "name": "Path",
@@ -83,7 +83,7 @@
"kind": "class", "kind": "class",
"path": "docforge.renderers.base.Project", "path": "docforge.renderers.base.Project",
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>", "signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
"docstring": "Representation of a documentation project.\n\nA ``Project`` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name: Name of the project.\n modules: Mapping of module paths to ``Module`` instances.", "docstring": "Representation of a documentation project.\n\nA `Project` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name (str):\n Name of the project.\n\n modules (Dict[str, Module]):\n Mapping of module paths to `Module` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -104,28 +104,28 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.base.Project.add_module", "path": "docforge.renderers.base.Project.add_module",
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>", "signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
"docstring": "Register a module in the project.\n\nArgs:\n module: Module instance to add to the project." "docstring": "Register a module in the project.\n\nArgs:\n module (Module):\n Module instance to add to the project."
}, },
"get_module": { "get_module": {
"name": "get_module", "name": "get_module",
"kind": "function", "kind": "function",
"path": "docforge.renderers.base.Project.get_module", "path": "docforge.renderers.base.Project.get_module",
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.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: Fully qualified dotted module path (for example ``pkg.module``).\n\nReturns:\n The corresponding ``Module`` instance.\n\nRaises:\n KeyError: If the module does not exist in the project." "docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path (str):\n Fully qualified dotted module path (for example `pkg.module`).\n\nReturns:\n Module:\n The corresponding `Module` instance.\n\nRaises:\n KeyError:\n If the module does not exist in the project."
}, },
"get_all_modules": { "get_all_modules": {
"name": "get_all_modules", "name": "get_all_modules",
"kind": "function", "kind": "function",
"path": "docforge.renderers.base.Project.get_all_modules", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
"docstring": "Return all modules contained in the project.\n\nReturns:\n An iterable of ``Module`` instances." "docstring": "Return all modules contained in the project.\n\nReturns:\n Iterable[Module]:\n An iterable of `Module` instances."
}, },
"get_module_list": { "get_module_list": {
"name": "get_module_list", "name": "get_module_list",
"kind": "function", "kind": "function",
"path": "docforge.renderers.base.Project.get_module_list", "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')>", "signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
"docstring": "Return the list of module import paths.\n\nReturns:\n A list containing the dotted paths of all modules in the project." "docstring": "Return the list of module import paths.\n\nReturns:\n list[str]:\n A list containing the dotted paths of all modules in the project."
} }
} }
}, },
@@ -133,8 +133,8 @@
"name": "RendererConfig", "name": "RendererConfig",
"kind": "class", "kind": "class",
"path": "docforge.renderers.base.RendererConfig", "path": "docforge.renderers.base.RendererConfig",
"signature": "<bound method Class.signature of Class('RendererConfig', 15, 36)>", "signature": "<bound method Class.signature of Class('RendererConfig', 17, 44)>",
"docstring": "Configuration container for documentation renderers.\n\nA ``RendererConfig`` instance groups together the project model and the\noutput directory used during rendering.\n\nAttributes:\n out_dir: Directory where generated documentation files will be written.\n project: Documentation project model to be rendered.", "docstring": "Configuration container for documentation renderers.\n\nA `RendererConfig` instance groups together the project model and the\noutput directory used during rendering.\n\nAttributes:\n out_dir (Path):\n Directory where generated documentation files will be written.\n\n project (Project):\n Documentation project model to be rendered.",
"members": { "members": {
"out_dir": { "out_dir": {
"name": "out_dir", "name": "out_dir",
@@ -156,8 +156,8 @@
"name": "DocRenderer", "name": "DocRenderer",
"kind": "class", "kind": "class",
"path": "docforge.renderers.base.DocRenderer", "path": "docforge.renderers.base.DocRenderer",
"signature": "<bound method Class.signature of Class('DocRenderer', 39, 62)>", "signature": "<bound method Class.signature of Class('DocRenderer', 47, 72)>",
"docstring": "Protocol defining the interface for documentation renderers.\n\nImplementations of this protocol are responsible for transforming a\n``Project`` model into renderer-specific documentation sources.", "docstring": "Protocol defining the interface for documentation renderers.\n\nImplementations of this protocol are responsible for transforming a\n`Project` model into renderer-specific documentation sources.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -170,8 +170,8 @@
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.renderers.base.DocRenderer.generate_sources", "path": "docforge.renderers.base.DocRenderer.generate_sources",
"signature": "<bound method Function.signature of Function('generate_sources', 49, 62)>", "signature": "<bound method Function.signature of Function('generate_sources', 57, 72)>",
"docstring": "Generate renderer-specific documentation sources.\n\nArgs:\n project: Project model containing modules and documentation objects.\n out_dir: Directory where generated documentation sources\n should be written." "docstring": "Generate renderer-specific documentation sources.\n\nArgs:\n project (Project):\n Project model containing modules and documentation objects.\n\n out_dir (Path):\n Directory where generated documentation sources should be written."
} }
} }
} }
@@ -182,7 +182,7 @@
"kind": "module", "kind": "module",
"path": "docforge.renderers.mcp_renderer", "path": "docforge.renderers.mcp_renderer",
"signature": null, "signature": null,
"docstring": null, "docstring": "# Summary\n\nMCP renderer implementation.\n\nThis module defines the `MCPRenderer` class, which generates documentation\nresources compatible with the Model Context Protocol (MCP).",
"members": { "members": {
"json": { "json": {
"name": "json", "name": "json",
@@ -217,7 +217,7 @@
"kind": "class", "kind": "class",
"path": "docforge.renderers.mcp_renderer.Project", "path": "docforge.renderers.mcp_renderer.Project",
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>", "signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
"docstring": "Representation of a documentation project.\n\nA ``Project`` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name: Name of the project.\n modules: Mapping of module paths to ``Module`` instances.", "docstring": "Representation of a documentation project.\n\nA `Project` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name (str):\n Name of the project.\n\n modules (Dict[str, Module]):\n Mapping of module paths to `Module` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -238,28 +238,28 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.Project.add_module", "path": "docforge.renderers.mcp_renderer.Project.add_module",
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>", "signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
"docstring": "Register a module in the project.\n\nArgs:\n module: Module instance to add to the project." "docstring": "Register a module in the project.\n\nArgs:\n module (Module):\n Module instance to add to the project."
}, },
"get_module": { "get_module": {
"name": "get_module", "name": "get_module",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.Project.get_module", "path": "docforge.renderers.mcp_renderer.Project.get_module",
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.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: Fully qualified dotted module path (for example ``pkg.module``).\n\nReturns:\n The corresponding ``Module`` instance.\n\nRaises:\n KeyError: If the module does not exist in the project." "docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path (str):\n Fully qualified dotted module path (for example `pkg.module`).\n\nReturns:\n Module:\n The corresponding `Module` instance.\n\nRaises:\n KeyError:\n If the module does not exist in the project."
}, },
"get_all_modules": { "get_all_modules": {
"name": "get_all_modules", "name": "get_all_modules",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.Project.get_all_modules", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
"docstring": "Return all modules contained in the project.\n\nReturns:\n An iterable of ``Module`` instances." "docstring": "Return all modules contained in the project.\n\nReturns:\n Iterable[Module]:\n An iterable of `Module` instances."
}, },
"get_module_list": { "get_module_list": {
"name": "get_module_list", "name": "get_module_list",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.Project.get_module_list", "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')>", "signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
"docstring": "Return the list of module import paths.\n\nReturns:\n A list containing the dotted paths of all modules in the project." "docstring": "Return the list of module import paths.\n\nReturns:\n list[str]:\n A list containing the dotted paths of all modules in the project."
} }
} }
}, },
@@ -268,7 +268,7 @@
"kind": "class", "kind": "class",
"path": "docforge.renderers.mcp_renderer.Module", "path": "docforge.renderers.mcp_renderer.Module",
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>", "signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>",
"docstring": "Representation of a documented Python module or package.\n\nA ``Module`` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level documentation string, if present.\n members: Mapping of object names to their corresponding\n ``DocObject`` representations.", "docstring": "Representation of a documented Python module or package.\n\nA `Module` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path (str):\n Dotted import path of the module.\n\n docstring (Optional[str]):\n Module-level documentation string, if present.\n\n members (Dict[str, DocObject]):\n Mapping of object names to their corresponding `DocObject` representations.",
"members": { "members": {
"path": { "path": {
"name": "path", "name": "path",
@@ -296,21 +296,21 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.Module.add_object", "path": "docforge.renderers.mcp_renderer.Module.add_object",
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.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: Documentation object to register as a top-level\n member of the module." "docstring": "Add a documented object to the module.\n\nArgs:\n obj (DocObject):\n Documentation object to register as a top-level member of the module."
}, },
"get_object": { "get_object": {
"name": "get_object", "name": "get_object",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.Module.get_object", "path": "docforge.renderers.mcp_renderer.Module.get_object",
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>", "signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
"docstring": "Retrieve a documented object by name.\n\nArgs:\n name: Name of the object to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If no object with the given name exists." "docstring": "Retrieve a documented object by name.\n\nArgs:\n name (str):\n Name of the object to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If no object with the given name exists."
}, },
"get_all_objects": { "get_all_objects": {
"name": "get_all_objects", "name": "get_all_objects",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.Module.get_all_objects", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
"docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n An iterable of ``DocObject`` instances representing the\n module's public members." "docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing the module's public members."
} }
} }
}, },
@@ -319,7 +319,7 @@
"kind": "class", "kind": "class",
"path": "docforge.renderers.mcp_renderer.DocObject", "path": "docforge.renderers.mcp_renderer.DocObject",
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.DocObject')>", "signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.DocObject')>",
"docstring": "Representation of a documented Python object.\n\nA ``DocObject`` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (for example ``class``, ``function``,\n ``method``, or ``attribute``).\n path: Fully qualified dotted path to the object.\n signature: Callable signature if the object represents a callable.\n docstring: Raw docstring text extracted from the source code.\n members: Mapping of member names to child ``DocObject`` instances.", "docstring": "Representation of a documented Python object.\n\nA `DocObject` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name (str):\n Local name of the object.\n\n kind (str):\n Type of object (for example `class`, `function`, `method`, or `attribute`).\n\n path (str):\n Fully qualified dotted path to the object.\n\n signature (Optional[str]):\n Callable signature if the object represents a callable.\n\n docstring (Optional[str]):\n Raw docstring text extracted from the source code.\n\n members (Dict[str, DocObject]):\n Mapping of member names to child `DocObject` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -375,14 +375,14 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.DocObject.get_member", "path": "docforge.renderers.mcp_renderer.DocObject.get_member",
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>", "signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: Name of the member to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If the member does not exist." "docstring": "Retrieve a member object by name.\n\nArgs:\n name (str):\n Name of the member to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If the member does not exist."
}, },
"get_all_members": { "get_all_members": {
"name": "get_all_members", "name": "get_all_members",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.DocObject.get_all_members", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
"docstring": "Return all child members of the object.\n\nReturns:\n An iterable of ``DocObject`` instances representing nested members." "docstring": "Return all child members of the object.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing nested members."
} }
} }
}, },
@@ -390,7 +390,7 @@
"name": "MCPRenderer", "name": "MCPRenderer",
"kind": "class", "kind": "class",
"path": "docforge.renderers.mcp_renderer.MCPRenderer", "path": "docforge.renderers.mcp_renderer.MCPRenderer",
"signature": "<bound method Class.signature of Class('MCPRenderer', 8, 138)>", "signature": "<bound method Class.signature of Class('MCPRenderer', 17, 159)>",
"docstring": "Renderer that generates MCP-compatible documentation resources.\n\nThis renderer converts doc-forge project models into structured JSON\nresources suitable for consumption by systems implementing the Model\nContext Protocol (MCP).", "docstring": "Renderer that generates MCP-compatible documentation resources.\n\nThis renderer converts doc-forge project models into structured JSON\nresources suitable for consumption by systems implementing the Model\nContext Protocol (MCP).",
"members": { "members": {
"name": { "name": {
@@ -404,8 +404,8 @@
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.MCPRenderer.generate_sources", "path": "docforge.renderers.mcp_renderer.MCPRenderer.generate_sources",
"signature": "<bound method Function.signature of Function('generate_sources', 19, 60)>", "signature": "<bound method Function.signature of Function('generate_sources', 28, 72)>",
"docstring": "Generate MCP documentation resources for a project.\n\nThe renderer serializes each module into a JSON resource and produces\nsupporting metadata files such as ``nav.json`` and ``index.json``.\n\nArgs:\n project: Documentation project model to render.\n out_dir: Directory where MCP resources will be written." "docstring": "Generate MCP documentation resources for a project.\n\nThe renderer serializes each module into a JSON resource and produces\nsupporting metadata files such as `nav.json` and `index.json`.\n\nArgs:\n project (Project):\n Documentation project model to render.\n\n out_dir (Path):\n Directory where MCP resources will be written."
} }
} }
} }
@@ -416,7 +416,7 @@
"kind": "module", "kind": "module",
"path": "docforge.renderers.mkdocs_renderer", "path": "docforge.renderers.mkdocs_renderer",
"signature": null, "signature": null,
"docstring": "MkDocs renderer implementation.\n\nThis module defines the ``MkDocsRenderer`` class, which generates Markdown\ndocumentation sources compatible with MkDocs Material and the mkdocstrings\nplugin.\n\nThe renderer ensures a consistent documentation structure by:\n\n- Creating a root ``index.md`` if one does not exist\n- Generating package index pages automatically\n- Linking child modules within parent package pages\n- Optionally generating ``README.md`` from the root package docstring", "docstring": "# Summary\n\nMkDocs renderer implementation.\n\nThis module defines the `MkDocsRenderer` class, which generates Markdown\ndocumentation sources compatible with MkDocs Material and the mkdocstrings\nplugin.\n\nThe renderer ensures a consistent documentation structure by:\n\n- Creating a root `index.md` if one does not exist\n- Generating package index pages automatically\n- Linking child modules within parent package pages\n- Optionally generating `README.md` from the root package docstring",
"members": { "members": {
"Path": { "Path": {
"name": "Path", "name": "Path",
@@ -430,7 +430,7 @@
"kind": "class", "kind": "class",
"path": "docforge.renderers.mkdocs_renderer.Project", "path": "docforge.renderers.mkdocs_renderer.Project",
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>", "signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
"docstring": "Representation of a documentation project.\n\nA ``Project`` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name: Name of the project.\n modules: Mapping of module paths to ``Module`` instances.", "docstring": "Representation of a documentation project.\n\nA `Project` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name (str):\n Name of the project.\n\n modules (Dict[str, Module]):\n Mapping of module paths to `Module` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -451,28 +451,28 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.Project.add_module", "path": "docforge.renderers.mkdocs_renderer.Project.add_module",
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>", "signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
"docstring": "Register a module in the project.\n\nArgs:\n module: Module instance to add to the project." "docstring": "Register a module in the project.\n\nArgs:\n module (Module):\n Module instance to add to the project."
}, },
"get_module": { "get_module": {
"name": "get_module", "name": "get_module",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.Project.get_module", "path": "docforge.renderers.mkdocs_renderer.Project.get_module",
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.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: Fully qualified dotted module path (for example ``pkg.module``).\n\nReturns:\n The corresponding ``Module`` instance.\n\nRaises:\n KeyError: If the module does not exist in the project." "docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path (str):\n Fully qualified dotted module path (for example `pkg.module`).\n\nReturns:\n Module:\n The corresponding `Module` instance.\n\nRaises:\n KeyError:\n If the module does not exist in the project."
}, },
"get_all_modules": { "get_all_modules": {
"name": "get_all_modules", "name": "get_all_modules",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.Project.get_all_modules", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
"docstring": "Return all modules contained in the project.\n\nReturns:\n An iterable of ``Module`` instances." "docstring": "Return all modules contained in the project.\n\nReturns:\n Iterable[Module]:\n An iterable of `Module` instances."
}, },
"get_module_list": { "get_module_list": {
"name": "get_module_list", "name": "get_module_list",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.Project.get_module_list", "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')>", "signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
"docstring": "Return the list of module import paths.\n\nReturns:\n A list containing the dotted paths of all modules in the project." "docstring": "Return the list of module import paths.\n\nReturns:\n list[str]:\n A list containing the dotted paths of all modules in the project."
} }
} }
}, },
@@ -481,7 +481,7 @@
"kind": "class", "kind": "class",
"path": "docforge.renderers.mkdocs_renderer.Module", "path": "docforge.renderers.mkdocs_renderer.Module",
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>", "signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>",
"docstring": "Representation of a documented Python module or package.\n\nA ``Module`` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level documentation string, if present.\n members: Mapping of object names to their corresponding\n ``DocObject`` representations.", "docstring": "Representation of a documented Python module or package.\n\nA `Module` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path (str):\n Dotted import path of the module.\n\n docstring (Optional[str]):\n Module-level documentation string, if present.\n\n members (Dict[str, DocObject]):\n Mapping of object names to their corresponding `DocObject` representations.",
"members": { "members": {
"path": { "path": {
"name": "path", "name": "path",
@@ -509,21 +509,21 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.Module.add_object", "path": "docforge.renderers.mkdocs_renderer.Module.add_object",
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.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: Documentation object to register as a top-level\n member of the module." "docstring": "Add a documented object to the module.\n\nArgs:\n obj (DocObject):\n Documentation object to register as a top-level member of the module."
}, },
"get_object": { "get_object": {
"name": "get_object", "name": "get_object",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.Module.get_object", "path": "docforge.renderers.mkdocs_renderer.Module.get_object",
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>", "signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
"docstring": "Retrieve a documented object by name.\n\nArgs:\n name: Name of the object to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If no object with the given name exists." "docstring": "Retrieve a documented object by name.\n\nArgs:\n name (str):\n Name of the object to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If no object with the given name exists."
}, },
"get_all_objects": { "get_all_objects": {
"name": "get_all_objects", "name": "get_all_objects",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.Module.get_all_objects", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
"docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n An iterable of ``DocObject`` instances representing the\n module's public members." "docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing the module's public members."
} }
} }
}, },
@@ -531,7 +531,7 @@
"name": "MkDocsRenderer", "name": "MkDocsRenderer",
"kind": "class", "kind": "class",
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer", "path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer",
"signature": "<bound method Class.signature of Class('MkDocsRenderer', 20, 272)>", "signature": "<bound method Class.signature of Class('MkDocsRenderer', 22, 305)>",
"docstring": "Renderer that produces Markdown documentation for MkDocs.\n\nGenerated pages use mkdocstrings directives to reference Python modules,\nallowing MkDocs to render API documentation dynamically.", "docstring": "Renderer that produces Markdown documentation for MkDocs.\n\nGenerated pages use mkdocstrings directives to reference Python modules,\nallowing MkDocs to render API documentation dynamically.",
"members": { "members": {
"name": { "name": {
@@ -545,15 +545,15 @@
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources", "path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources",
"signature": "<bound method Function.signature of Function('generate_sources', 34, 71)>", "signature": "<bound method Function.signature of Function('generate_sources', 36, 78)>",
"docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project: Project model containing modules to document.\n out_dir: Directory where generated Markdown files will be written.\n module_is_source: If True, treat the specified module as the\n documentation root rather than nesting it inside a folder." "docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project (Project):\n Project model containing modules to document.\n\n out_dir (Path):\n Directory where generated Markdown files will be written.\n\n module_is_source (bool, optional):\n If True, treat the specified module as the documentation root\n rather than nesting it inside a folder."
}, },
"generate_readme": { "generate_readme": {
"name": "generate_readme", "name": "generate_readme",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme", "path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme",
"signature": "<bound method Function.signature of Function('generate_readme', 73, 128)>", "signature": "<bound method Function.signature of Function('generate_readme', 80, 139)>",
"docstring": "Generate a ``README.md`` file from the root module docstring.\n\nBehavior:\n\n- If ``module_is_source`` is True, ``README.md`` is written to the\n project root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project: Project model containing documentation metadata.\n docs_dir: Directory containing generated documentation sources.\n module_is_source: Whether the module is treated as the project\n source root." "docstring": "Generate a `README.md` file from the root module docstring.\n\nBehavior:\n\n- If `module_is_source` is True, `README.md` is written to the project\n root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project (Project):\n Project model containing documentation metadata.\n\n docs_dir (Path):\n Directory containing generated documentation sources.\n\n module_is_source (bool, optional):\n Whether the module is treated as the project source root."
} }
} }
} }

View File

@@ -2,7 +2,7 @@
"module": "docforge.renderers.mcp_renderer", "module": "docforge.renderers.mcp_renderer",
"content": { "content": {
"path": "docforge.renderers.mcp_renderer", "path": "docforge.renderers.mcp_renderer",
"docstring": null, "docstring": "# Summary\n\nMCP renderer implementation.\n\nThis module defines the `MCPRenderer` class, which generates documentation\nresources compatible with the Model Context Protocol (MCP).",
"objects": { "objects": {
"json": { "json": {
"name": "json", "name": "json",
@@ -37,7 +37,7 @@
"kind": "class", "kind": "class",
"path": "docforge.renderers.mcp_renderer.Project", "path": "docforge.renderers.mcp_renderer.Project",
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>", "signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
"docstring": "Representation of a documentation project.\n\nA ``Project`` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name: Name of the project.\n modules: Mapping of module paths to ``Module`` instances.", "docstring": "Representation of a documentation project.\n\nA `Project` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name (str):\n Name of the project.\n\n modules (Dict[str, Module]):\n Mapping of module paths to `Module` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -58,28 +58,28 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.Project.add_module", "path": "docforge.renderers.mcp_renderer.Project.add_module",
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>", "signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
"docstring": "Register a module in the project.\n\nArgs:\n module: Module instance to add to the project." "docstring": "Register a module in the project.\n\nArgs:\n module (Module):\n Module instance to add to the project."
}, },
"get_module": { "get_module": {
"name": "get_module", "name": "get_module",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.Project.get_module", "path": "docforge.renderers.mcp_renderer.Project.get_module",
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.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: Fully qualified dotted module path (for example ``pkg.module``).\n\nReturns:\n The corresponding ``Module`` instance.\n\nRaises:\n KeyError: If the module does not exist in the project." "docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path (str):\n Fully qualified dotted module path (for example `pkg.module`).\n\nReturns:\n Module:\n The corresponding `Module` instance.\n\nRaises:\n KeyError:\n If the module does not exist in the project."
}, },
"get_all_modules": { "get_all_modules": {
"name": "get_all_modules", "name": "get_all_modules",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.Project.get_all_modules", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
"docstring": "Return all modules contained in the project.\n\nReturns:\n An iterable of ``Module`` instances." "docstring": "Return all modules contained in the project.\n\nReturns:\n Iterable[Module]:\n An iterable of `Module` instances."
}, },
"get_module_list": { "get_module_list": {
"name": "get_module_list", "name": "get_module_list",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.Project.get_module_list", "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')>", "signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
"docstring": "Return the list of module import paths.\n\nReturns:\n A list containing the dotted paths of all modules in the project." "docstring": "Return the list of module import paths.\n\nReturns:\n list[str]:\n A list containing the dotted paths of all modules in the project."
} }
} }
}, },
@@ -88,7 +88,7 @@
"kind": "class", "kind": "class",
"path": "docforge.renderers.mcp_renderer.Module", "path": "docforge.renderers.mcp_renderer.Module",
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>", "signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>",
"docstring": "Representation of a documented Python module or package.\n\nA ``Module`` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level documentation string, if present.\n members: Mapping of object names to their corresponding\n ``DocObject`` representations.", "docstring": "Representation of a documented Python module or package.\n\nA `Module` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path (str):\n Dotted import path of the module.\n\n docstring (Optional[str]):\n Module-level documentation string, if present.\n\n members (Dict[str, DocObject]):\n Mapping of object names to their corresponding `DocObject` representations.",
"members": { "members": {
"path": { "path": {
"name": "path", "name": "path",
@@ -116,21 +116,21 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.Module.add_object", "path": "docforge.renderers.mcp_renderer.Module.add_object",
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.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: Documentation object to register as a top-level\n member of the module." "docstring": "Add a documented object to the module.\n\nArgs:\n obj (DocObject):\n Documentation object to register as a top-level member of the module."
}, },
"get_object": { "get_object": {
"name": "get_object", "name": "get_object",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.Module.get_object", "path": "docforge.renderers.mcp_renderer.Module.get_object",
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>", "signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
"docstring": "Retrieve a documented object by name.\n\nArgs:\n name: Name of the object to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If no object with the given name exists." "docstring": "Retrieve a documented object by name.\n\nArgs:\n name (str):\n Name of the object to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If no object with the given name exists."
}, },
"get_all_objects": { "get_all_objects": {
"name": "get_all_objects", "name": "get_all_objects",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.Module.get_all_objects", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
"docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n An iterable of ``DocObject`` instances representing the\n module's public members." "docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing the module's public members."
} }
} }
}, },
@@ -139,7 +139,7 @@
"kind": "class", "kind": "class",
"path": "docforge.renderers.mcp_renderer.DocObject", "path": "docforge.renderers.mcp_renderer.DocObject",
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.DocObject')>", "signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.DocObject')>",
"docstring": "Representation of a documented Python object.\n\nA ``DocObject`` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (for example ``class``, ``function``,\n ``method``, or ``attribute``).\n path: Fully qualified dotted path to the object.\n signature: Callable signature if the object represents a callable.\n docstring: Raw docstring text extracted from the source code.\n members: Mapping of member names to child ``DocObject`` instances.", "docstring": "Representation of a documented Python object.\n\nA `DocObject` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name (str):\n Local name of the object.\n\n kind (str):\n Type of object (for example `class`, `function`, `method`, or `attribute`).\n\n path (str):\n Fully qualified dotted path to the object.\n\n signature (Optional[str]):\n Callable signature if the object represents a callable.\n\n docstring (Optional[str]):\n Raw docstring text extracted from the source code.\n\n members (Dict[str, DocObject]):\n Mapping of member names to child `DocObject` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -195,14 +195,14 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.DocObject.get_member", "path": "docforge.renderers.mcp_renderer.DocObject.get_member",
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>", "signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: Name of the member to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If the member does not exist." "docstring": "Retrieve a member object by name.\n\nArgs:\n name (str):\n Name of the member to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If the member does not exist."
}, },
"get_all_members": { "get_all_members": {
"name": "get_all_members", "name": "get_all_members",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.DocObject.get_all_members", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
"docstring": "Return all child members of the object.\n\nReturns:\n An iterable of ``DocObject`` instances representing nested members." "docstring": "Return all child members of the object.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing nested members."
} }
} }
}, },
@@ -210,7 +210,7 @@
"name": "MCPRenderer", "name": "MCPRenderer",
"kind": "class", "kind": "class",
"path": "docforge.renderers.mcp_renderer.MCPRenderer", "path": "docforge.renderers.mcp_renderer.MCPRenderer",
"signature": "<bound method Class.signature of Class('MCPRenderer', 8, 138)>", "signature": "<bound method Class.signature of Class('MCPRenderer', 17, 159)>",
"docstring": "Renderer that generates MCP-compatible documentation resources.\n\nThis renderer converts doc-forge project models into structured JSON\nresources suitable for consumption by systems implementing the Model\nContext Protocol (MCP).", "docstring": "Renderer that generates MCP-compatible documentation resources.\n\nThis renderer converts doc-forge project models into structured JSON\nresources suitable for consumption by systems implementing the Model\nContext Protocol (MCP).",
"members": { "members": {
"name": { "name": {
@@ -224,8 +224,8 @@
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mcp_renderer.MCPRenderer.generate_sources", "path": "docforge.renderers.mcp_renderer.MCPRenderer.generate_sources",
"signature": "<bound method Function.signature of Function('generate_sources', 19, 60)>", "signature": "<bound method Function.signature of Function('generate_sources', 28, 72)>",
"docstring": "Generate MCP documentation resources for a project.\n\nThe renderer serializes each module into a JSON resource and produces\nsupporting metadata files such as ``nav.json`` and ``index.json``.\n\nArgs:\n project: Documentation project model to render.\n out_dir: Directory where MCP resources will be written." "docstring": "Generate MCP documentation resources for a project.\n\nThe renderer serializes each module into a JSON resource and produces\nsupporting metadata files such as `nav.json` and `index.json`.\n\nArgs:\n project (Project):\n Documentation project model to render.\n\n out_dir (Path):\n Directory where MCP resources will be written."
} }
} }
} }

View File

@@ -2,7 +2,7 @@
"module": "docforge.renderers.mkdocs_renderer", "module": "docforge.renderers.mkdocs_renderer",
"content": { "content": {
"path": "docforge.renderers.mkdocs_renderer", "path": "docforge.renderers.mkdocs_renderer",
"docstring": "MkDocs renderer implementation.\n\nThis module defines the ``MkDocsRenderer`` class, which generates Markdown\ndocumentation sources compatible with MkDocs Material and the mkdocstrings\nplugin.\n\nThe renderer ensures a consistent documentation structure by:\n\n- Creating a root ``index.md`` if one does not exist\n- Generating package index pages automatically\n- Linking child modules within parent package pages\n- Optionally generating ``README.md`` from the root package docstring", "docstring": "# Summary\n\nMkDocs renderer implementation.\n\nThis module defines the `MkDocsRenderer` class, which generates Markdown\ndocumentation sources compatible with MkDocs Material and the mkdocstrings\nplugin.\n\nThe renderer ensures a consistent documentation structure by:\n\n- Creating a root `index.md` if one does not exist\n- Generating package index pages automatically\n- Linking child modules within parent package pages\n- Optionally generating `README.md` from the root package docstring",
"objects": { "objects": {
"Path": { "Path": {
"name": "Path", "name": "Path",
@@ -16,7 +16,7 @@
"kind": "class", "kind": "class",
"path": "docforge.renderers.mkdocs_renderer.Project", "path": "docforge.renderers.mkdocs_renderer.Project",
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>", "signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
"docstring": "Representation of a documentation project.\n\nA ``Project`` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name: Name of the project.\n modules: Mapping of module paths to ``Module`` instances.", "docstring": "Representation of a documentation project.\n\nA `Project` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name (str):\n Name of the project.\n\n modules (Dict[str, Module]):\n Mapping of module paths to `Module` instances.",
"members": { "members": {
"name": { "name": {
"name": "name", "name": "name",
@@ -37,28 +37,28 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.Project.add_module", "path": "docforge.renderers.mkdocs_renderer.Project.add_module",
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>", "signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
"docstring": "Register a module in the project.\n\nArgs:\n module: Module instance to add to the project." "docstring": "Register a module in the project.\n\nArgs:\n module (Module):\n Module instance to add to the project."
}, },
"get_module": { "get_module": {
"name": "get_module", "name": "get_module",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.Project.get_module", "path": "docforge.renderers.mkdocs_renderer.Project.get_module",
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.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: Fully qualified dotted module path (for example ``pkg.module``).\n\nReturns:\n The corresponding ``Module`` instance.\n\nRaises:\n KeyError: If the module does not exist in the project." "docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path (str):\n Fully qualified dotted module path (for example `pkg.module`).\n\nReturns:\n Module:\n The corresponding `Module` instance.\n\nRaises:\n KeyError:\n If the module does not exist in the project."
}, },
"get_all_modules": { "get_all_modules": {
"name": "get_all_modules", "name": "get_all_modules",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.Project.get_all_modules", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
"docstring": "Return all modules contained in the project.\n\nReturns:\n An iterable of ``Module`` instances." "docstring": "Return all modules contained in the project.\n\nReturns:\n Iterable[Module]:\n An iterable of `Module` instances."
}, },
"get_module_list": { "get_module_list": {
"name": "get_module_list", "name": "get_module_list",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.Project.get_module_list", "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')>", "signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
"docstring": "Return the list of module import paths.\n\nReturns:\n A list containing the dotted paths of all modules in the project." "docstring": "Return the list of module import paths.\n\nReturns:\n list[str]:\n A list containing the dotted paths of all modules in the project."
} }
} }
}, },
@@ -67,7 +67,7 @@
"kind": "class", "kind": "class",
"path": "docforge.renderers.mkdocs_renderer.Module", "path": "docforge.renderers.mkdocs_renderer.Module",
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>", "signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>",
"docstring": "Representation of a documented Python module or package.\n\nA ``Module`` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level documentation string, if present.\n members: Mapping of object names to their corresponding\n ``DocObject`` representations.", "docstring": "Representation of a documented Python module or package.\n\nA `Module` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path (str):\n Dotted import path of the module.\n\n docstring (Optional[str]):\n Module-level documentation string, if present.\n\n members (Dict[str, DocObject]):\n Mapping of object names to their corresponding `DocObject` representations.",
"members": { "members": {
"path": { "path": {
"name": "path", "name": "path",
@@ -95,21 +95,21 @@
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.Module.add_object", "path": "docforge.renderers.mkdocs_renderer.Module.add_object",
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.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: Documentation object to register as a top-level\n member of the module." "docstring": "Add a documented object to the module.\n\nArgs:\n obj (DocObject):\n Documentation object to register as a top-level member of the module."
}, },
"get_object": { "get_object": {
"name": "get_object", "name": "get_object",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.Module.get_object", "path": "docforge.renderers.mkdocs_renderer.Module.get_object",
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>", "signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
"docstring": "Retrieve a documented object by name.\n\nArgs:\n name: Name of the object to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If no object with the given name exists." "docstring": "Retrieve a documented object by name.\n\nArgs:\n name (str):\n Name of the object to retrieve.\n\nReturns:\n DocObject:\n The corresponding `DocObject` instance.\n\nRaises:\n KeyError:\n If no object with the given name exists."
}, },
"get_all_objects": { "get_all_objects": {
"name": "get_all_objects", "name": "get_all_objects",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.Module.get_all_objects", "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')>", "signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
"docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n An iterable of ``DocObject`` instances representing the\n module's public members." "docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n Iterable[DocObject]:\n An iterable of `DocObject` instances representing the module's public members."
} }
} }
}, },
@@ -117,7 +117,7 @@
"name": "MkDocsRenderer", "name": "MkDocsRenderer",
"kind": "class", "kind": "class",
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer", "path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer",
"signature": "<bound method Class.signature of Class('MkDocsRenderer', 20, 272)>", "signature": "<bound method Class.signature of Class('MkDocsRenderer', 22, 305)>",
"docstring": "Renderer that produces Markdown documentation for MkDocs.\n\nGenerated pages use mkdocstrings directives to reference Python modules,\nallowing MkDocs to render API documentation dynamically.", "docstring": "Renderer that produces Markdown documentation for MkDocs.\n\nGenerated pages use mkdocstrings directives to reference Python modules,\nallowing MkDocs to render API documentation dynamically.",
"members": { "members": {
"name": { "name": {
@@ -131,15 +131,15 @@
"name": "generate_sources", "name": "generate_sources",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources", "path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources",
"signature": "<bound method Function.signature of Function('generate_sources', 34, 71)>", "signature": "<bound method Function.signature of Function('generate_sources', 36, 78)>",
"docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project: Project model containing modules to document.\n out_dir: Directory where generated Markdown files will be written.\n module_is_source: If True, treat the specified module as the\n documentation root rather than nesting it inside a folder." "docstring": "Generate Markdown documentation files for a project.\n\nThis method renders a documentation structure from the provided\nproject model and writes the resulting Markdown files to the\nspecified output directory.\n\nArgs:\n project (Project):\n Project model containing modules to document.\n\n out_dir (Path):\n Directory where generated Markdown files will be written.\n\n module_is_source (bool, optional):\n If True, treat the specified module as the documentation root\n rather than nesting it inside a folder."
}, },
"generate_readme": { "generate_readme": {
"name": "generate_readme", "name": "generate_readme",
"kind": "function", "kind": "function",
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme", "path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme",
"signature": "<bound method Function.signature of Function('generate_readme', 73, 128)>", "signature": "<bound method Function.signature of Function('generate_readme', 80, 139)>",
"docstring": "Generate a ``README.md`` file from the root module docstring.\n\nBehavior:\n\n- If ``module_is_source`` is True, ``README.md`` is written to the\n project root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project: Project model containing documentation metadata.\n docs_dir: Directory containing generated documentation sources.\n module_is_source: Whether the module is treated as the project\n source root." "docstring": "Generate a `README.md` file from the root module docstring.\n\nBehavior:\n\n- If `module_is_source` is True, `README.md` is written to the project\n root directory.\n- If False, README generation is currently not implemented.\n\nArgs:\n project (Project):\n Project model containing documentation metadata.\n\n docs_dir (Path):\n Directory containing generated documentation sources.\n\n module_is_source (bool, optional):\n Whether the module is treated as the project source root."
} }
} }
} }

View File

@@ -2,7 +2,7 @@
"module": "docforge.servers", "module": "docforge.servers",
"content": { "content": {
"path": "docforge.servers", "path": "docforge.servers",
"docstring": "Server layer for doc-forge.\n\nThis module exposes server implementations used to provide live access\nto generated documentation resources. Currently, it includes the MCP\ndocumentation server.\n\n---", "docstring": "# Summary\n\nServer layer for doc-forge.\n\nThis module exposes server implementations used to provide live access\nto generated documentation resources. Currently, it includes the MCP\ndocumentation server.\n\n---",
"objects": { "objects": {
"MCPServer": { "MCPServer": {
"name": "MCPServer", "name": "MCPServer",
@@ -30,7 +30,7 @@
"kind": "function", "kind": "function",
"path": "docforge.servers.MCPServer.run", "path": "docforge.servers.MCPServer.run",
"signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>", "signature": "<bound method Alias.signature of Alias('run', 'docforge.servers.mcp_server.MCPServer.run')>",
"docstring": "Start the MCP server.\n\nArgs:\n transport: Transport mechanism used by the MCP server. Supported\n options include ``stdio``, ``sse``, and ``streamable-http``." "docstring": "Start the MCP server.\n\nArgs:\n transport (Literal[\"stdio\", \"sse\", \"streamable-http\"]):\n Transport mechanism used by the MCP server. Supported options\n include `stdio`, `sse`, and `streamable-http`."
} }
} }
}, },
@@ -39,7 +39,7 @@
"kind": "module", "kind": "module",
"path": "docforge.servers.mcp_server", "path": "docforge.servers.mcp_server",
"signature": null, "signature": null,
"docstring": null, "docstring": "# Summary\n\nMCP server implementation.\n\nThis module defines the `MCPServer` class, which serves pre-generated\ndocumentation bundles through the Model Context Protocol (MCP).",
"members": { "members": {
"annotations": { "annotations": {
"name": "annotations", "name": "annotations",
@@ -87,7 +87,7 @@
"name": "MCPServer", "name": "MCPServer",
"kind": "class", "kind": "class",
"path": "docforge.servers.mcp_server.MCPServer", "path": "docforge.servers.mcp_server.MCPServer",
"signature": "<bound method Class.signature of Class('MCPServer', 10, 122)>", "signature": "<bound method Class.signature of Class('MCPServer', 19, 136)>",
"docstring": "MCP server for serving a pre-generated documentation bundle.\n\nThe server exposes documentation resources and diagnostic tools through\nMCP endpoints backed by JSON files generated by the MCP renderer.", "docstring": "MCP server for serving a pre-generated documentation bundle.\n\nThe server exposes documentation resources and diagnostic tools through\nMCP endpoints backed by JSON files generated by the MCP renderer.",
"members": { "members": {
"mcp_root": { "mcp_root": {
@@ -108,8 +108,8 @@
"name": "run", "name": "run",
"kind": "function", "kind": "function",
"path": "docforge.servers.mcp_server.MCPServer.run", "path": "docforge.servers.mcp_server.MCPServer.run",
"signature": "<bound method Function.signature of Function('run', 111, 122)>", "signature": "<bound method Function.signature of Function('run', 124, 136)>",
"docstring": "Start the MCP server.\n\nArgs:\n transport: Transport mechanism used by the MCP server. Supported\n options include ``stdio``, ``sse``, and ``streamable-http``." "docstring": "Start the MCP server.\n\nArgs:\n transport (Literal[\"stdio\", \"sse\", \"streamable-http\"]):\n Transport mechanism used by the MCP server. Supported options\n include `stdio`, `sse`, and `streamable-http`."
} }
} }
} }

View File

@@ -2,7 +2,7 @@
"module": "docforge.servers.mcp_server", "module": "docforge.servers.mcp_server",
"content": { "content": {
"path": "docforge.servers.mcp_server", "path": "docforge.servers.mcp_server",
"docstring": null, "docstring": "# Summary\n\nMCP server implementation.\n\nThis module defines the `MCPServer` class, which serves pre-generated\ndocumentation bundles through the Model Context Protocol (MCP).",
"objects": { "objects": {
"annotations": { "annotations": {
"name": "annotations", "name": "annotations",
@@ -50,7 +50,7 @@
"name": "MCPServer", "name": "MCPServer",
"kind": "class", "kind": "class",
"path": "docforge.servers.mcp_server.MCPServer", "path": "docforge.servers.mcp_server.MCPServer",
"signature": "<bound method Class.signature of Class('MCPServer', 10, 122)>", "signature": "<bound method Class.signature of Class('MCPServer', 19, 136)>",
"docstring": "MCP server for serving a pre-generated documentation bundle.\n\nThe server exposes documentation resources and diagnostic tools through\nMCP endpoints backed by JSON files generated by the MCP renderer.", "docstring": "MCP server for serving a pre-generated documentation bundle.\n\nThe server exposes documentation resources and diagnostic tools through\nMCP endpoints backed by JSON files generated by the MCP renderer.",
"members": { "members": {
"mcp_root": { "mcp_root": {
@@ -71,8 +71,8 @@
"name": "run", "name": "run",
"kind": "function", "kind": "function",
"path": "docforge.servers.mcp_server.MCPServer.run", "path": "docforge.servers.mcp_server.MCPServer.run",
"signature": "<bound method Function.signature of Function('run', 111, 122)>", "signature": "<bound method Function.signature of Function('run', 124, 136)>",
"docstring": "Start the MCP server.\n\nArgs:\n transport: Transport mechanism used by the MCP server. Supported\n options include ``stdio``, ``sse``, and ``streamable-http``." "docstring": "Start the MCP server.\n\nArgs:\n transport (Literal[\"stdio\", \"sse\", \"streamable-http\"]):\n Transport mechanism used by the MCP server. Supported options\n include `stdio`, `sse`, and `streamable-http`."
} }
} }
} }

View File

@@ -17,6 +17,19 @@ authors = [
maintainers = [ maintainers = [
{ name = "Aetos Skia", email = "dev@aetoskia.com" } { name = "Aetos Skia", email = "dev@aetoskia.com" }
] ]
keywords = [
"documentation",
"docs",
"compiler",
"mkdocs",
"mcp",
"griffe",
"docstrings",
"sphinx",
]
classifiers = [ classifiers = [
"Development Status :: 3 - Alpha", "Development Status :: 3 - Alpha",
"Intended Audience :: Developers", "Intended Audience :: Developers",
@@ -25,9 +38,12 @@ classifiers = [
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Framework :: FastAPI", "Framework :: FastAPI",
"Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP :: HTTP Servers",
"Topic :: Documentation",
"Typing :: Typed",
] ]
@@ -57,14 +73,25 @@ sphinx = [
"sphinx-autodoc-typehints>=1.19.0", "sphinx-autodoc-typehints>=1.19.0",
] ]
mcp = [ mcp = [
"mcp>=1.0.0", "mcp>=1.0.0,<2.0.0",
] ]
dev = [ dev = [
"pytest>=7.0.0", "pytest>=8.0.0",
"pytest-cov>=4.0.0", "pytest-asyncio>=0.21.0",
"pytest-cov>=4.1.0",
"black>=23.0.0", "black>=23.0.0",
"ruff>=0.1.0", "ruff>=0.3.0",
"mypy>=1.0.0", "mypy>=1.8.0",
"build>=1.0.0",
"twine>=4.0.0",
"pre-commit>=3.4.0",
]
docs = [
"doc-forge[mkdocs]",
]
all = [
"doc-forge[dev,docs,mcp]",
] ]
@@ -80,15 +107,100 @@ Versions = "https://git.aetoskia.com/aetos/doc-forge/tags"
packages = { find = { include = ["docforge*"] } } packages = { find = { include = ["docforge*"] } }
[tool.setuptools.package-data] [tool.setuptools.package-data]
docforge = ["templates/*.yml"] docforge = ["py.typed", "templates/*.yml"]
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--strict-markers",
"--strict-config",
"--cov=docforge",
"--cov-report=term-missing",
"--cov-report=html",
"--cov-report=xml",
]
[tool.black]
line-length = 88
target-version = ["py310", "py311", "py312", "py313"]
include = '\.pyi?$'
extend-exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
)/
'''
[tool.ruff] [tool.ruff]
line-length = 100 line-length = 88
target-version = "py310" target-version = "py310"
[tool.ruff.lint]
select = [
"E",
"W",
"F",
"I",
"B",
"C4",
"UP",
]
ignore = [
"E501",
"B008",
"C901",
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "I001"]
"tests/*" = ["B008"]
[tool.mypy] [tool.mypy]
python_version = "3.10" python_version = "3.10"
strict = true strict = true
exclude = [
"tests/",
]
files = ["docforge"]
[[tool.mypy.overrides]]
module = [
"griffe.*",
"mcp.*",
"click",
"pydantic",
]
ignore_missing_imports = true ignore_missing_imports = true
[tool.coverage.run]
source = ["docforge"]
omit = [
"*/tests/*",
"*/test_*.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if __name__ == .__main__.:",
"raise AssertionError",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"@abstractmethod",
]

View File

@@ -1,6 +1,8 @@
from pathlib import Path from pathlib import Path
from docforge.cli.main import cli from docforge.cli.main import cli
def test_mcp_build(cli_runner): def test_mcp_build(cli_runner):
with cli_runner.isolated_filesystem(): with cli_runner.isolated_filesystem():
cwd = Path.cwd() cwd = Path.cwd()

View File

@@ -1,6 +1,8 @@
from pathlib import Path from pathlib import Path
from docforge.cli.main import cli from docforge.cli.main import cli
def test_mkdocs_build_full_flow( def test_mkdocs_build_full_flow(
cli_runner, cli_runner,
mock_mkdocs_build, mock_mkdocs_build,
@@ -43,11 +45,13 @@ def test_mkdocs_build_full_flow(
assert (cwd / "mkdocs.yml").exists() assert (cwd / "mkdocs.yml").exists()
assert (cwd / "docs" / "testpkg" / "mod.md").exists() assert (cwd / "docs" / "testpkg" / "mod.md").exists()
def test_mkdocs_build_missing_module_fails(cli_runner): def test_mkdocs_build_missing_module_fails(cli_runner):
result = cli_runner.invoke(cli, ["build", "--mkdocs", "--site-name", "Test"]) result = cli_runner.invoke(cli, ["build", "--mkdocs", "--site-name", "Test"])
assert result.exit_code != 0 assert result.exit_code != 0
assert "--module is required" in result.output assert "--module is required" in result.output
def test_mkdocs_build_without_site_name_uses_module_as_default_full_flow( def test_mkdocs_build_without_site_name_uses_module_as_default_full_flow(
cli_runner, cli_runner,
mock_mkdocs_build, mock_mkdocs_build,

View File

@@ -1,5 +1,6 @@
from docforge.cli.main import cli from docforge.cli.main import cli
def test_mcp_serve( def test_mcp_serve(
cli_runner, cli_runner,
fake_mcp_docs, fake_mcp_docs,

View File

@@ -1,5 +1,6 @@
from docforge.cli.main import cli from docforge.cli.main import cli
def test_mkdocs_serve( def test_mkdocs_serve(
cli_runner, cli_runner,
fake_mkdocs_yml, fake_mkdocs_yml,

View File

@@ -1,8 +1,8 @@
import sys
import json import json
import pytest import sys
from pathlib import Path from pathlib import Path
import pytest
from click.testing import CliRunner from click.testing import CliRunner
@@ -45,6 +45,7 @@ plugins:
@pytest.fixture @pytest.fixture
def mock_mkdocs_load_config(monkeypatch): def mock_mkdocs_load_config(monkeypatch):
"""Mock mkdocs.config.load_config.""" """Mock mkdocs.config.load_config."""
def fake_load_config(path): def fake_load_config(path):
return object() # dummy config object return object() # dummy config object
@@ -81,6 +82,7 @@ def mock_mkdocs_serve(monkeypatch):
) )
return lambda: called["value"] return lambda: called["value"]
@pytest.fixture @pytest.fixture
def fake_mcp_docs(tmp_path: Path) -> Path: def fake_mcp_docs(tmp_path: Path) -> Path:
""" """

View File

@@ -2,11 +2,9 @@ from docforge import GriffeLoader
def test_alias_does_not_crash(temp_package): def test_alias_does_not_crash(temp_package):
(temp_package / "alias.py").write_text( (temp_package / "alias.py").write_text("""from typing import List
'''from typing import List
Alias = List[int] Alias = List[int]
''' """)
)
loader = GriffeLoader() loader = GriffeLoader()
project = loader.load_project(["testpkg.alias"]) project = loader.load_project(["testpkg.alias"])

View File

@@ -2,15 +2,13 @@ from docforge import GriffeLoader
def test_class_and_methods(temp_package): def test_class_and_methods(temp_package):
(temp_package / "cls.py").write_text( (temp_package / "cls.py").write_text('''class MyClass:
'''class MyClass:
"""Class doc.""" """Class doc."""
def method(self, x: int) -> int: def method(self, x: int) -> int:
"""Method doc.""" """Method doc."""
return x return x
''' ''')
)
loader = GriffeLoader() loader = GriffeLoader()
project = loader.load_project(["testpkg.cls"]) project = loader.load_project(["testpkg.cls"])

View File

@@ -2,12 +2,10 @@ from docforge import GriffeLoader
def test_function_signature(temp_package): def test_function_signature(temp_package):
(temp_package / "fn.py").write_text( (temp_package / "fn.py").write_text('''def add(a: int, b: int = 1) -> int:
'''def add(a: int, b: int = 1) -> int:
"""Adds numbers.""" """Adds numbers."""
return a + b return a + b
''' ''')
)
loader = GriffeLoader() loader = GriffeLoader()
project = loader.load_project(["testpkg.fn"]) project = loader.load_project(["testpkg.fn"])

View File

@@ -1,4 +1,5 @@
import pytest import pytest
from docforge import GriffeLoader from docforge import GriffeLoader
@@ -6,9 +7,8 @@ def test_load_project_raises_on_missing_module_by_default():
loader = GriffeLoader() loader = GriffeLoader()
with pytest.raises(ImportError): with pytest.raises(ImportError):
loader.load_project( loader.load_project(["nonexistent.module", "sys"])
["nonexistent.module", "sys"]
)
def test_load_project_skips_missing_modules_when_enabled(): def test_load_project_skips_missing_modules_when_enabled():
loader = GriffeLoader() loader = GriffeLoader()

View File

@@ -2,9 +2,7 @@ from docforge import GriffeLoader
def test_missing_docstrings(temp_package): def test_missing_docstrings(temp_package):
(temp_package / "nodoc.py").write_text( (temp_package / "nodoc.py").write_text("""def f(): pass""")
'''def f(): pass'''
)
loader = GriffeLoader() loader = GriffeLoader()
project = loader.load_project(["testpkg.nodoc"]) project = loader.load_project(["testpkg.nodoc"])

View File

@@ -2,11 +2,9 @@ from docforge import GriffeLoader
def test_private_members_excluded(temp_package): def test_private_members_excluded(temp_package):
(temp_package / "priv.py").write_text( (temp_package / "priv.py").write_text("""def _hidden(): pass
'''def _hidden(): pass
def visible(): pass def visible(): pass
''' """)
)
loader = GriffeLoader() loader = GriffeLoader()
project = loader.load_project(["testpkg.priv"]) project = loader.load_project(["testpkg.priv"])

View File

@@ -2,13 +2,11 @@ from docforge import GriffeLoader
def test_load_single_module(temp_package): def test_load_single_module(temp_package):
(temp_package / "mod.py").write_text( (temp_package / "mod.py").write_text('''"""Module docstring."""\n
'''"""Module docstring."""\n
def foo(): def foo():
"""Foo docstring.""" """Foo docstring."""
pass pass
''' ''')
)
loader = GriffeLoader() loader = GriffeLoader()
project = loader.load_project(["testpkg.mod"]) project = loader.load_project(["testpkg.mod"])

View File

@@ -1,7 +1,6 @@
from pathlib import Path from pathlib import Path
from docforge.nav import ResolvedNav from docforge.nav import MkDocsNavEmitter, ResolvedNav
from docforge.nav import MkDocsNavEmitter
def test_emit_mkdocs_nav(): def test_emit_mkdocs_nav():

View File

@@ -2,8 +2,7 @@ from pathlib import Path
import pytest import pytest
from docforge.nav import NavSpec from docforge.nav import NavSpec, resolve_nav
from docforge.nav import resolve_nav
def _write_docs(root: Path, paths: list[str]) -> None: def _write_docs(root: Path, paths: list[str]) -> None:

View File

@@ -2,7 +2,7 @@ import json
from pathlib import Path from pathlib import Path
from docforge import MCPRenderer from docforge import MCPRenderer
from docforge.models import Project, Module from docforge.models import Module, Project
def test_mcp_file_content(tmp_path: Path): def test_mcp_file_content(tmp_path: Path):

View File

@@ -1,7 +1,7 @@
from pathlib import Path from pathlib import Path
from docforge import MCPRenderer from docforge import MCPRenderer
from docforge.models import Project, Module from docforge.models import Module, Project
def test_mcp_idempotent(tmp_path: Path): def test_mcp_idempotent(tmp_path: Path):

View File

@@ -1,7 +1,7 @@
from pathlib import Path from pathlib import Path
from docforge.loaders import GriffeLoader, discover_module_paths
from docforge import MCPRenderer from docforge import MCPRenderer
from docforge.loaders import GriffeLoader, discover_module_paths
def test_mcp_emits_all_modules(tmp_path: Path) -> None: def test_mcp_emits_all_modules(tmp_path: Path) -> None:
@@ -22,10 +22,7 @@ def test_mcp_emits_all_modules(tmp_path: Path) -> None:
for p in (tmp_path / "modules").rglob("*.json") for p in (tmp_path / "modules").rglob("*.json")
} }
expected = { expected = {f"modules/{m.path}.json" for m in project.get_all_modules()}
f"modules/{m.path}.json"
for m in project.get_all_modules()
}
missing = expected - emitted missing = expected - emitted
assert not missing, f"Missing MCP module JSON files: {missing}" assert not missing, f"Missing MCP module JSON files: {missing}"

View File

@@ -1,7 +1,7 @@
from pathlib import Path from pathlib import Path
from docforge import MCPRenderer from docforge import MCPRenderer
from docforge.models import Project, Module from docforge.models import Module, Project
def test_mcp_directory_structure(tmp_path: Path): def test_mcp_directory_structure(tmp_path: Path):

View File

@@ -1,7 +1,7 @@
from pathlib import Path from pathlib import Path
from docforge import MkDocsRenderer from docforge import MkDocsRenderer
from docforge.models import Project, Module from docforge.models import Module, Project
def test_mkdocs_file_content(tmp_path: Path): def test_mkdocs_file_content(tmp_path: Path):

View File

@@ -1,7 +1,7 @@
from pathlib import Path from pathlib import Path
from docforge import MkDocsRenderer from docforge import MkDocsRenderer
from docforge.models import Project, Module from docforge.models import Module, Project
def test_mkdocs_idempotent(tmp_path: Path): def test_mkdocs_idempotent(tmp_path: Path):

View File

@@ -1,7 +1,7 @@
from pathlib import Path from pathlib import Path
from docforge.loaders import GriffeLoader, discover_module_paths
from docforge import MkDocsRenderer from docforge import MkDocsRenderer
from docforge.loaders import GriffeLoader, discover_module_paths
def test_mkdocs_emits_all_modules(tmp_path: Path) -> None: def test_mkdocs_emits_all_modules(tmp_path: Path) -> None:
@@ -23,10 +23,7 @@ def test_mkdocs_emits_all_modules(tmp_path: Path) -> None:
module_is_source=True, module_is_source=True,
) )
emitted = { emitted = {p.relative_to(tmp_path).as_posix() for p in tmp_path.rglob("*.md")}
p.relative_to(tmp_path).as_posix()
for p in tmp_path.rglob("*.md")
}
module_paths = [m.path for m in project.get_all_modules()] module_paths = [m.path for m in project.get_all_modules()]
@@ -34,8 +31,7 @@ def test_mkdocs_emits_all_modules(tmp_path: Path) -> None:
for path in module_paths: for path in module_paths:
parts = path.split(".") parts = path.split(".")
is_package = any( is_package = any(
other != path and other.startswith(path + ".") other != path and other.startswith(path + ".") for other in module_paths
for other in module_paths
) )
if is_package: if is_package:

View File

@@ -1,7 +1,7 @@
from pathlib import Path from pathlib import Path
from docforge import MkDocsRenderer from docforge import MkDocsRenderer
from docforge.models import Project, Module from docforge.models import Module, Project
def test_mkdocs_directory_structure(tmp_path: Path): def test_mkdocs_directory_structure(tmp_path: Path):