Compare commits
16 Commits
0.0.3
...
f8ca6075fb
| Author | SHA1 | Date | |
|---|---|---|---|
| f8ca6075fb | |||
| 3f68e51e58 | |||
| 87a7f4eee1 | |||
| b5379cd82e | |||
| caeda0ad5c | |||
| 7643e27358 | |||
| 04db9f44d8 | |||
| 6c8da4b43b | |||
| 066e710dee | |||
| ed0fac8b3d | |||
| fbe9e1f109 | |||
| 22fceef020 | |||
| 56fb39de08 | |||
| 8a509e590a | |||
| cb68b0b93f | |||
| 2ed962d639 |
@@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="pytest" type="tests" factoryName="py.test">
|
||||
<configuration default="false" name="pytests" type="tests" factoryName="py.test">
|
||||
<module name="docforge" />
|
||||
<option name="ENV_FILES" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
327
ADS.llm.md
327
ADS.llm.md
@@ -1,327 +0,0 @@
|
||||
# doc-forge — Architecture & Design Specification
|
||||
|
||||
**doc-forge** is a renderer-agnostic Python documentation compiler. It converts Python source code and docstrings into a structured, semantic documentation model and then emits multiple downstream representations, including:
|
||||
|
||||
* Human-facing documentation sites (MkDocs, Sphinx)
|
||||
* Machine-facing documentation bundles (MCP JSON)
|
||||
* Live documentation APIs (MCP servers)
|
||||
|
||||
This document is the **authoritative design and codebase specification** for the library. It is written to be both **LLM-friendly** and **developer-facing**, and should be treated as the canonical reference for implementation decisions.
|
||||
|
||||
---
|
||||
|
||||
## 1. Design Goals
|
||||
|
||||
1. **Single Source of Truth**
|
||||
Python source code and docstrings are the only authoritative input.
|
||||
|
||||
2. **Renderer Agnosticism**
|
||||
MkDocs, Sphinx, MCP, or future renderers must not influence the core model.
|
||||
|
||||
3. **Deterministic Output**
|
||||
Given the same codebase, outputs must be reproducible.
|
||||
|
||||
4. **AI-Native Documentation**
|
||||
Documentation must be structured, queryable, and machine-consumable.
|
||||
|
||||
5. **Library-First, CLI-Second**
|
||||
All functionality must be accessible as a Python API. The CLI is a thin wrapper.
|
||||
|
||||
---
|
||||
|
||||
## 2. Core Mental Model
|
||||
|
||||
### Fundamental Abstraction
|
||||
|
||||
> **The atomic unit of documentation is a Python import path**
|
||||
|
||||
Examples:
|
||||
|
||||
* `mail_intake`
|
||||
* `mail_intake.config`
|
||||
* `mail_intake.adapters.base`
|
||||
|
||||
Files, Markdown, HTML, and JSON are *representations*, not documentation units.
|
||||
|
||||
---
|
||||
|
||||
## 3. High-Level Architecture
|
||||
|
||||
```
|
||||
Python Source Code
|
||||
↓
|
||||
Introspection Layer (Griffe)
|
||||
↓
|
||||
Documentation Model (doc-forge core)
|
||||
↓
|
||||
Renderer / Exporter Layer
|
||||
├── MkDocs
|
||||
├── Sphinx
|
||||
├── MCP (static JSON)
|
||||
└── MCP Server (live)
|
||||
```
|
||||
|
||||
Only the **Documentation Model** is shared across all outputs.
|
||||
|
||||
---
|
||||
|
||||
## 4. Package Layout (Proposed)
|
||||
|
||||
```
|
||||
docforge/
|
||||
├── __init__.py
|
||||
├── model/
|
||||
│ ├── project.py
|
||||
│ ├── module.py
|
||||
│ ├── object.py
|
||||
│ └── nav.py
|
||||
├── loader/
|
||||
│ └── griffe_loader.py
|
||||
├── renderers/
|
||||
│ ├── base.py
|
||||
│ ├── mkdocs.py
|
||||
│ └── sphinx.py
|
||||
├── exporters/
|
||||
│ └── mcp.py
|
||||
├── server/
|
||||
│ └── mcp_server.py
|
||||
├── cli/
|
||||
│ └── main.py
|
||||
└── utils/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. Documentation Model (Core)
|
||||
|
||||
The documentation model is renderer-neutral and must not contain any MkDocs-, Sphinx-, or MCP-specific logic.
|
||||
|
||||
### 5.1 Project
|
||||
|
||||
```python
|
||||
class Project:
|
||||
name: str
|
||||
version: str | None
|
||||
modules: dict[str, Module]
|
||||
nav: Navigation
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 5.2 Module
|
||||
|
||||
```python
|
||||
class Module:
|
||||
path: str # import path
|
||||
docstring: str | None
|
||||
members: dict[str, DocObject]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 5.3 DocObject
|
||||
|
||||
Represents classes, functions, variables, etc.
|
||||
|
||||
```python
|
||||
class DocObject:
|
||||
name: str
|
||||
kind: str # class, function, attribute, module
|
||||
path: str
|
||||
signature: str | None
|
||||
docstring: str | None
|
||||
members: dict[str, DocObject]
|
||||
```
|
||||
|
||||
Private members (`_name`) are excluded by default.
|
||||
|
||||
---
|
||||
|
||||
### 5.4 Navigation
|
||||
|
||||
```python
|
||||
class Navigation:
|
||||
entries: list[NavEntry]
|
||||
|
||||
class NavEntry:
|
||||
title: str
|
||||
module: str
|
||||
```
|
||||
|
||||
Navigation is derived, not authored.
|
||||
|
||||
---
|
||||
|
||||
## 6. Introspection Layer
|
||||
|
||||
### 6.1 Griffe Loader
|
||||
|
||||
Griffe is the **only supported introspection backend**.
|
||||
|
||||
Responsibilities:
|
||||
|
||||
* Load modules by import path
|
||||
* Resolve docstrings, signatures, and members
|
||||
* Tolerate alias resolution failures
|
||||
|
||||
Output: fully populated `Project` and `Module` objects.
|
||||
|
||||
---
|
||||
|
||||
## 7. Renderer Interface
|
||||
|
||||
Renderers consume the documentation model and emit renderer-specific source trees.
|
||||
|
||||
```python
|
||||
class DocRenderer(Protocol):
|
||||
name: str
|
||||
|
||||
def generate_sources(self, project: Project, out_dir: Path) -> None:
|
||||
"""Generate renderer-specific source files."""
|
||||
|
||||
def build(self, config: RendererConfig) -> None:
|
||||
"""Build final artifacts (HTML, site, etc.)."""
|
||||
|
||||
def serve(self, config: RendererConfig) -> None:
|
||||
"""Serve documentation locally (optional)."""
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 8. MkDocs Renderer
|
||||
|
||||
### Source Generation
|
||||
|
||||
* Emits `.md` files
|
||||
* One file per module
|
||||
* Uses `mkdocstrings` directives exclusively
|
||||
|
||||
```md
|
||||
# Config
|
||||
|
||||
::: mail_intake.config
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
* Uses `mkdocs.commands.build`
|
||||
|
||||
### Serve
|
||||
|
||||
* Uses `mkdocs.commands.serve`
|
||||
|
||||
MkDocs-specific configuration lives outside the core model.
|
||||
|
||||
---
|
||||
|
||||
## 9. Sphinx Renderer
|
||||
|
||||
### Source Generation
|
||||
|
||||
* Emits `.rst` files
|
||||
* Uses `autodoc` directives
|
||||
|
||||
```rst
|
||||
mail_intake.config
|
||||
==================
|
||||
|
||||
.. automodule:: mail_intake.config
|
||||
:members:
|
||||
:undoc-members:
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
* Uses `sphinx.application.Sphinx` directly
|
||||
|
||||
### Serve
|
||||
|
||||
* Optional (static build is sufficient)
|
||||
|
||||
---
|
||||
|
||||
## 10. MCP Exporter (Static)
|
||||
|
||||
The MCP exporter bypasses renderers entirely.
|
||||
|
||||
### Output Structure
|
||||
|
||||
```
|
||||
mcp/
|
||||
├── index.json
|
||||
├── nav.json
|
||||
└── modules/
|
||||
└── package.module.json
|
||||
```
|
||||
|
||||
### Design Principles
|
||||
|
||||
* Alias-safe
|
||||
* Deterministic
|
||||
* Fully self-contained
|
||||
* No Markdown, HTML, or templates
|
||||
|
||||
---
|
||||
|
||||
## 11. MCP Server (Live)
|
||||
|
||||
The MCP server exposes documentation as queryable resources.
|
||||
|
||||
### Resources
|
||||
|
||||
* `docs://index`
|
||||
* `docs://nav`
|
||||
* `docs://module/{module}`
|
||||
|
||||
### Characteristics
|
||||
|
||||
* Read-only
|
||||
* Stateless
|
||||
* Backed by MCP JSON bundle
|
||||
|
||||
---
|
||||
|
||||
## 12. CLI Design
|
||||
|
||||
The CLI is a thin orchestration layer.
|
||||
|
||||
```bash
|
||||
doc-forge generate --renderer mkdocs
|
||||
doc-forge generate --renderer sphinx
|
||||
|
||||
doc-forge build --renderer mkdocs
|
||||
doc-forge serve --renderer mkdocs
|
||||
|
||||
doc-forge export mcp
|
||||
```
|
||||
|
||||
Renderer choice never affects the core model.
|
||||
|
||||
---
|
||||
|
||||
## 13. Explicit Non-Goals
|
||||
|
||||
* Markdown authoring
|
||||
* Theme design
|
||||
* Runtime code execution
|
||||
* Code formatting or linting
|
||||
|
||||
---
|
||||
|
||||
## 14. Invariants (Must Never Break)
|
||||
|
||||
1. Import paths are canonical identifiers
|
||||
2. Core model contains no renderer logic
|
||||
3. MCP does not depend on MkDocs or Sphinx
|
||||
4. Renderers do not introspect Python directly
|
||||
5. All outputs trace back to the same model
|
||||
|
||||
---
|
||||
|
||||
## 15. One-Line Definition
|
||||
|
||||
> **doc-forge is a documentation compiler that turns Python code into structured knowledge and emits it through multiple human and machine interfaces.**
|
||||
|
||||
---
|
||||
|
||||
*End of specification.*
|
||||
@@ -1,26 +1,26 @@
|
||||
home: docforge/index.md
|
||||
home: index.md
|
||||
groups:
|
||||
Loaders:
|
||||
- docforge/loaders/index.md
|
||||
- docforge/loaders/griffe_loader.md
|
||||
- loaders/index.md
|
||||
- loaders/griffe_loader.md
|
||||
Models:
|
||||
- docforge/models/index.md
|
||||
- docforge/models/module.md
|
||||
- docforge/models/object.md
|
||||
- docforge/models/project.md
|
||||
- models/index.md
|
||||
- models/module.md
|
||||
- models/object.md
|
||||
- models/project.md
|
||||
Navigation:
|
||||
- docforge/nav/index.md
|
||||
- docforge/nav/spec.md
|
||||
- docforge/nav/resolver.md
|
||||
- docforge/nav/mkdocs.md
|
||||
- nav/index.md
|
||||
- nav/spec.md
|
||||
- nav/resolver.md
|
||||
- nav/mkdocs.md
|
||||
Renderers:
|
||||
- docforge/renderers/index.md
|
||||
- docforge/renderers/base.md
|
||||
- docforge/renderers/mkdocs_renderer.md
|
||||
- docforge/renderers/mcp_renderer.md
|
||||
- renderers/index.md
|
||||
- renderers/base.md
|
||||
- renderers/mkdocs_renderer.md
|
||||
- renderers/mcp_renderer.md
|
||||
CLI:
|
||||
- docforge/cli/index.md
|
||||
- docforge/cli/main.md
|
||||
- docforge/cli/commands.md
|
||||
- docforge/cli/mcp_utils.md
|
||||
- docforge/cli/mkdocs_utils.md
|
||||
- cli/index.md
|
||||
- cli/main.md
|
||||
- cli/commands.md
|
||||
- cli/mcp_utils.md
|
||||
- cli/mkdocs_utils.md
|
||||
|
||||
@@ -1,63 +1,536 @@
|
||||
"""
|
||||
# doc-forge
|
||||
Renderer-agnostic Python documentation compiler that converts Python docstrings
|
||||
into structured documentation for both humans (MkDocs) and machines (MCP / AI agents).
|
||||
|
||||
`doc-forge` is a renderer-agnostic Python documentation compiler designed for
|
||||
speed, flexibility, and beautiful output. It decouples the introspection of
|
||||
your code from the rendering process, allowing you to generate documentation
|
||||
for various platforms (starting with MkDocs) from a single internal models.
|
||||
`doc-forge` statically analyzes source code, builds a semantic model of modules,
|
||||
classes, functions, and attributes, and renders that model into documentation
|
||||
outputs without executing user code.
|
||||
|
||||
## Available Commands
|
||||
|
||||
- **build**: Build documentation (MkDocs site or MCP resources).
|
||||
- **serve**: Serve documentation (MkDocs or MCP).
|
||||
- **tree**: Visualize the introspected project structure.
|
||||
---
|
||||
|
||||
## Installation
|
||||
|
||||
Install using `pip` with the optional `mkdocs` dependencies for a complete setup:
|
||||
Install using pip:
|
||||
|
||||
```bash
|
||||
pip install doc-forge
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
---
|
||||
|
||||
1. **Build Documentation**:
|
||||
Introspect your package and generate documentation in one step:
|
||||
```bash
|
||||
# Build MkDocs site
|
||||
doc-forge build --mkdocs --module my_package --site-name "My Docs"
|
||||
## Quick start
|
||||
|
||||
Generate a MkDocs site from a Python package:
|
||||
|
||||
doc-forge build --mkdocs --module my_package
|
||||
|
||||
Generate MCP JSON documentation:
|
||||
|
||||
# Build MCP resources
|
||||
doc-forge build --mcp --module my_package
|
||||
```
|
||||
|
||||
2. **Define Navigation**:
|
||||
Create a `docforge.nav.yml` to organize your documentation:
|
||||
```yaml
|
||||
home: my_package/index.md
|
||||
groups:
|
||||
Core API:
|
||||
- my_package/core/*.md
|
||||
Utilities:
|
||||
- my_package/utils.md
|
||||
```
|
||||
Serve documentation locally:
|
||||
|
||||
3. **Preview**:
|
||||
```bash
|
||||
# Serve MkDocs site
|
||||
doc-forge serve --mkdocs
|
||||
doc-forge serve --mkdocs --module my_package
|
||||
|
||||
# Serve MCP documentation
|
||||
doc-forge serve --mcp
|
||||
```
|
||||
---
|
||||
|
||||
## Project Structure
|
||||
## Core concepts
|
||||
|
||||
- `docforge.loaders`: Introspects source code using static analysis (`griffe`).
|
||||
- `docforge.models`: The internal representation of your project, modules, and objects.
|
||||
- `docforge.renderers`: Converters that turn the models into physical files.
|
||||
- `docforge.nav`: Managers for logical-to-physical path mapping and navigation.
|
||||
**Loader**
|
||||
|
||||
Extracts symbols, signatures, and docstrings using static analysis.
|
||||
|
||||
**Semantic model**
|
||||
|
||||
Structured, renderer-agnostic representation of the API.
|
||||
|
||||
**Renderer**
|
||||
|
||||
Converts the semantic model into output formats such as MkDocs or MCP JSON.
|
||||
|
||||
**Symbol**
|
||||
|
||||
Any documentable object:
|
||||
|
||||
- module
|
||||
- class
|
||||
- function
|
||||
- method
|
||||
- property
|
||||
- attribute
|
||||
|
||||
---
|
||||
|
||||
## Architecture
|
||||
|
||||
`doc-forge` follows a compiler architecture:
|
||||
|
||||
Front-end:
|
||||
|
||||
Static analysis of modules, classes, functions, type hints, and docstrings.
|
||||
|
||||
Middle-end:
|
||||
|
||||
Builds a semantic model describing symbols and relationships.
|
||||
|
||||
Back-end:
|
||||
|
||||
Renders documentation using interchangeable renderers.
|
||||
|
||||
This architecture ensures deterministic documentation generation.
|
||||
|
||||
---
|
||||
|
||||
## Rendering pipeline
|
||||
|
||||
Typical flow:
|
||||
|
||||
Python package
|
||||
↓
|
||||
Loader (static analysis)
|
||||
↓
|
||||
Semantic model
|
||||
↓
|
||||
Renderer
|
||||
↓
|
||||
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)
|
||||
|
||||
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.
|
||||
- doc-forge compiles docstrings but does not generate documentation content.
|
||||
- Documentation follows the Python import hierarchy.
|
||||
- Every public symbol should have a complete and accurate docstring.
|
||||
|
||||
---
|
||||
|
||||
## General rules
|
||||
|
||||
- Use **Markdown headings** at package and module 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.
|
||||
- Write summaries in imperative form.
|
||||
- Sections are separated by ```---```
|
||||
|
||||
---
|
||||
|
||||
## Package docstrings
|
||||
|
||||
- Package docstrings act as the documentation home page.
|
||||
|
||||
Recommended sections:
|
||||
|
||||
## Summary
|
||||
## Installation
|
||||
## Quick start
|
||||
## Core concepts
|
||||
## Architecture
|
||||
## Rendering pipeline
|
||||
## CLI usage
|
||||
## Public API
|
||||
## Examples
|
||||
## Notes
|
||||
|
||||
Example:
|
||||
Package Doc String:
|
||||
|
||||
'''
|
||||
Foo-bar processing framework.
|
||||
|
||||
Provides tools for defining Foo objects and executing Bar pipelines.
|
||||
|
||||
---
|
||||
|
||||
# Installation
|
||||
|
||||
pip install foo-bar
|
||||
|
||||
---
|
||||
|
||||
# Quick start
|
||||
|
||||
from foobar import Foo, BarEngine
|
||||
|
||||
foo = Foo("example")
|
||||
engine = BarEngine([foo])
|
||||
|
||||
result = engine.run()
|
||||
|
||||
---
|
||||
|
||||
# Public API
|
||||
|
||||
Foo
|
||||
Bar
|
||||
BarEngine
|
||||
|
||||
---
|
||||
'''
|
||||
|
||||
---
|
||||
|
||||
## Module docstrings
|
||||
|
||||
- Module docstrings describe a subsystem.
|
||||
|
||||
Recommended sections:
|
||||
|
||||
## Summary
|
||||
## Examples
|
||||
## Notes
|
||||
## Public API
|
||||
|
||||
Example:
|
||||
Module Doc String:
|
||||
|
||||
'''
|
||||
Foo execution subsystem.
|
||||
|
||||
Provides utilities for executing Foo objects through Bar stages.
|
||||
|
||||
---
|
||||
|
||||
Example:
|
||||
|
||||
from foobar.engine import BarEngine
|
||||
from foobar.foo import Foo
|
||||
|
||||
foo = Foo("example")
|
||||
|
||||
engine = BarEngine([foo])
|
||||
engine.run()
|
||||
|
||||
---
|
||||
'''
|
||||
|
||||
---
|
||||
|
||||
## Class docstrings
|
||||
|
||||
- Class docstrings define object responsibility, lifecycle, and attributes.
|
||||
|
||||
Recommended sections:
|
||||
|
||||
Attributes:
|
||||
Notes:
|
||||
Example:
|
||||
Raises:
|
||||
|
||||
Example:
|
||||
Simple Foo:
|
||||
|
||||
class Foo:
|
||||
'''
|
||||
Represents a unit of work.
|
||||
|
||||
Attributes:
|
||||
name (str):
|
||||
Identifier of the foo instance.
|
||||
|
||||
value (int):
|
||||
Numeric value associated with foo.
|
||||
|
||||
Notes:
|
||||
Guarantees:
|
||||
|
||||
- instances are immutable after creation
|
||||
|
||||
Lifecycle:
|
||||
|
||||
- create instance
|
||||
- pass to processing engine
|
||||
|
||||
Example:
|
||||
Create and inspect a Foo:
|
||||
|
||||
foo = Foo("example", value=42)
|
||||
print(foo.name)
|
||||
'''
|
||||
|
||||
Complex Bar:
|
||||
|
||||
class BarEngine:
|
||||
'''
|
||||
Executes Foo objects through Bar stages.
|
||||
|
||||
Attributes:
|
||||
foos (tuple[Foo, ...]):
|
||||
Foo instances managed by the engine.
|
||||
|
||||
Notes:
|
||||
Guarantees:
|
||||
|
||||
- deterministic execution order
|
||||
|
||||
Example:
|
||||
Run engine:
|
||||
|
||||
foo1 = Foo("a")
|
||||
foo2 = Foo("b")
|
||||
|
||||
engine = BarEngine([foo1, foo2])
|
||||
engine.run()
|
||||
'''
|
||||
|
||||
---
|
||||
|
||||
## Function and method docstrings
|
||||
|
||||
- Function docstrings define API contracts.
|
||||
|
||||
Recommended sections:
|
||||
|
||||
Args:
|
||||
Returns:
|
||||
Raises:
|
||||
Yields:
|
||||
Notes:
|
||||
Example:
|
||||
|
||||
Example:
|
||||
Simple process method:
|
||||
|
||||
def process(foo: Foo, multiplier: int) -> int:
|
||||
'''
|
||||
Process a Foo instance.
|
||||
|
||||
Args:
|
||||
foo (Foo):
|
||||
Foo instance to process.
|
||||
|
||||
multiplier (int):
|
||||
Value used to scale foo.
|
||||
|
||||
Returns:
|
||||
int:
|
||||
Processed result.
|
||||
|
||||
Raises:
|
||||
ValueError:
|
||||
If multiplier is negative.
|
||||
|
||||
Notes:
|
||||
Guarantees:
|
||||
|
||||
- foo is not modified
|
||||
|
||||
Example:
|
||||
Process foo:
|
||||
|
||||
foo = Foo("example", value=10)
|
||||
|
||||
result = process(foo, multiplier=2)
|
||||
print(result)
|
||||
'''
|
||||
|
||||
Multiple Examples:
|
||||
|
||||
def combine(foo_a: Foo, foo_b: Foo) -> Foo:
|
||||
'''
|
||||
Combine two Foo instances.
|
||||
|
||||
Args:
|
||||
foo_a (Foo):
|
||||
First foo.
|
||||
|
||||
foo_b (Foo):
|
||||
Second foo.
|
||||
|
||||
Returns:
|
||||
Foo:
|
||||
Combined foo.
|
||||
|
||||
Example:
|
||||
Basic usage:
|
||||
|
||||
foo1 = Foo("a")
|
||||
foo2 = Foo("b")
|
||||
|
||||
combined = combine(foo1, foo2)
|
||||
|
||||
Pipeline usage:
|
||||
|
||||
engine = BarEngine([foo1, foo2])
|
||||
engine.run()
|
||||
'''
|
||||
|
||||
---
|
||||
|
||||
## Property docstrings
|
||||
|
||||
- Properties must document return values.
|
||||
|
||||
Example:
|
||||
Property Doc String:
|
||||
|
||||
@property
|
||||
def foos(self) -> tuple[Foo, ...]:
|
||||
'''
|
||||
Return contained Foo instances.
|
||||
|
||||
Returns:
|
||||
tuple[Foo, ...]:
|
||||
Stored foo objects.
|
||||
|
||||
Example:
|
||||
container = FooContainer()
|
||||
|
||||
foos = container.foos
|
||||
'''
|
||||
|
||||
---
|
||||
|
||||
## Attribute documentation
|
||||
|
||||
- Document attributes in class docstrings using Attributes:.
|
||||
|
||||
Example:
|
||||
Attribute Doc String:
|
||||
|
||||
'''
|
||||
Represents a processing stage.
|
||||
|
||||
Attributes:
|
||||
id (str):
|
||||
Unique identifier.
|
||||
|
||||
enabled (bool):
|
||||
Whether the stage is active.
|
||||
'''
|
||||
|
||||
---
|
||||
|
||||
## Notes subsection grouping
|
||||
|
||||
- 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:
|
||||
|
||||
- symbol kind (module, class, function, property, attribute)
|
||||
- symbol name
|
||||
- parameters
|
||||
- return values
|
||||
- attributes
|
||||
- examples
|
||||
- structured Notes subsections
|
||||
|
||||
This enables:
|
||||
|
||||
- reliable MkDocs rendering
|
||||
- deterministic MCP export
|
||||
- accurate AI semantic interpretation
|
||||
|
||||
---
|
||||
|
||||
Notes:
|
||||
- doc-forge never executes analyzed modules.
|
||||
- Documentation is generated entirely through static analysis.
|
||||
"""
|
||||
|
||||
from .loaders import GriffeLoader, discover_module_paths
|
||||
|
||||
@@ -18,6 +18,7 @@ def cli() -> None:
|
||||
@cli.command()
|
||||
@click.option("--mcp", is_flag=True, help="Build MCP resources")
|
||||
@click.option("--mkdocs", is_flag=True, help="Build MkDocs site")
|
||||
@click.option("--module-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("--project-name", help="Project name override")
|
||||
# MkDocs specific
|
||||
@@ -32,6 +33,7 @@ def cli() -> None:
|
||||
def build(
|
||||
mcp: bool,
|
||||
mkdocs: bool,
|
||||
module_is_source: bool,
|
||||
module: Optional[str],
|
||||
project_name: Optional[str],
|
||||
site_name: Optional[str],
|
||||
@@ -52,7 +54,8 @@ def build(
|
||||
Args:
|
||||
mcp: Use the MCP documentation builder.
|
||||
mkdocs: Use the MkDocs documentation builder.
|
||||
module: The dotted path of the module to document.
|
||||
module_is_source: Module is the source folder and to be treated as the root folder.
|
||||
module: The dotted path of the module to the document.
|
||||
project_name: Optional override for the project name.
|
||||
site_name: (MkDocs) The site display name. Defaults to module name.
|
||||
docs_dir: (MkDocs) Target directory for Markdown sources.
|
||||
@@ -71,7 +74,12 @@ def build(
|
||||
site_name = module
|
||||
|
||||
click.echo(f"Generating MkDocs sources in {docs_dir}...")
|
||||
mkdocs_utils.generate_sources(module, project_name, docs_dir)
|
||||
mkdocs_utils.generate_sources(
|
||||
module,
|
||||
docs_dir,
|
||||
project_name,
|
||||
module_is_source,
|
||||
)
|
||||
|
||||
click.echo(f"Generating MkDocs config {mkdocs_yml}...")
|
||||
mkdocs_utils.generate_config(docs_dir, nav_file, template, mkdocs_yml, site_name)
|
||||
@@ -92,11 +100,13 @@ def build(
|
||||
@cli.command()
|
||||
@click.option("--mcp", is_flag=True, help="Serve MCP documentation")
|
||||
@click.option("--mkdocs", is_flag=True, help="Serve MkDocs site")
|
||||
@click.option("--module", help="Python module to serve")
|
||||
@click.option("--mkdocs-yml", type=click.Path(path_type=Path), default=Path("mkdocs.yml"), help="MkDocs config path")
|
||||
@click.option("--out-dir", type=click.Path(path_type=Path), default=Path("mcp_docs"), help="MCP root directory")
|
||||
def serve(
|
||||
mcp: bool,
|
||||
mkdocs: bool,
|
||||
module: Optional[str],
|
||||
mkdocs_yml: Path,
|
||||
out_dir: Path,
|
||||
) -> None:
|
||||
@@ -106,6 +116,7 @@ def serve(
|
||||
Args:
|
||||
mcp: Serve MCP resources via an MCP server.
|
||||
mkdocs: Serve the MkDocs site using the built-in development server.
|
||||
module: The dotted path of the module to serve.
|
||||
mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.
|
||||
out_dir: (MCP) Path to the mcp_docs/ directory.
|
||||
"""
|
||||
@@ -113,37 +124,38 @@ def serve(
|
||||
raise click.UsageError("Cannot specify both --mcp and --mkdocs")
|
||||
if not mcp and not mkdocs:
|
||||
raise click.UsageError("Must specify either --mcp or --mkdocs")
|
||||
if mcp and not module:
|
||||
raise click.UsageError("--module is required for MCP serve")
|
||||
|
||||
if mkdocs:
|
||||
mkdocs_utils.serve(mkdocs_yml)
|
||||
elif mcp:
|
||||
mcp_utils.serve(out_dir)
|
||||
mcp_utils.serve(module, out_dir)
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.option(
|
||||
"--modules",
|
||||
multiple=True,
|
||||
"--module",
|
||||
required=True,
|
||||
help="Python module import paths to introspect",
|
||||
help="Python module import path to introspect",
|
||||
)
|
||||
@click.option(
|
||||
"--project-name",
|
||||
help="Project name (defaults to first module)",
|
||||
help="Project name (defaults to specified module)",
|
||||
)
|
||||
def tree(
|
||||
modules: Sequence[str],
|
||||
module: str,
|
||||
project_name: Optional[str],
|
||||
) -> None:
|
||||
"""
|
||||
Visualize the project structure in the terminal.
|
||||
|
||||
Args:
|
||||
modules: List of module import paths to recursively introspect.
|
||||
module: The module import path to recursively introspect.
|
||||
project_name: Optional override for the project name shown at the root.
|
||||
"""
|
||||
loader = GriffeLoader()
|
||||
project = loader.load_project(list(modules), project_name)
|
||||
project = loader.load_project([module], project_name)
|
||||
|
||||
click.echo(project.name)
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ cli: Group
|
||||
def build(
|
||||
mcp: bool,
|
||||
mkdocs: bool,
|
||||
module_is_source: bool,
|
||||
module: Optional[str],
|
||||
project_name: Optional[str],
|
||||
site_name: Optional[str],
|
||||
@@ -20,12 +21,13 @@ def build(
|
||||
def serve(
|
||||
mcp: bool,
|
||||
mkdocs: bool,
|
||||
module: Optional[str],
|
||||
mkdocs_yml: Path,
|
||||
out_dir: Path,
|
||||
) -> None: ...
|
||||
|
||||
def tree(
|
||||
modules: Sequence[str],
|
||||
module: str,
|
||||
project_name: Optional[str],
|
||||
) -> None: ...
|
||||
|
||||
|
||||
@@ -20,11 +20,12 @@ def generate_resources(module: str, project_name: str | None, out_dir: Path) ->
|
||||
renderer = MCPRenderer()
|
||||
renderer.generate_sources(project, out_dir)
|
||||
|
||||
def serve(mcp_root: Path) -> None:
|
||||
def serve(module: str, mcp_root: Path) -> None:
|
||||
"""
|
||||
Serve MCP documentation from a pre-built bundle.
|
||||
|
||||
Args:
|
||||
module: The dotted path of the primary module to serve.
|
||||
mcp_root: Path to the directory containing index.json, nav.json, and modules/.
|
||||
"""
|
||||
if not mcp_root.exists():
|
||||
@@ -42,6 +43,6 @@ def serve(mcp_root: Path) -> None:
|
||||
|
||||
server = MCPServer(
|
||||
mcp_root=mcp_root,
|
||||
name="doc-forge-mcp",
|
||||
name=f"{module}-mcp",
|
||||
)
|
||||
server.run()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from pathlib import Path
|
||||
|
||||
def generate_resources(module: str, project_name: str | None, out_dir: Path) -> None: ...
|
||||
def serve(mcp_root: Path) -> None: ...
|
||||
def serve(module: str, mcp_root: Path) -> None: ...
|
||||
|
||||
@@ -6,7 +6,12 @@ from docforge.loaders import GriffeLoader, discover_module_paths
|
||||
from docforge.renderers import MkDocsRenderer
|
||||
from docforge.nav import load_nav_spec, resolve_nav, MkDocsNavEmitter
|
||||
|
||||
def generate_sources(module: str, project_name: str | None, docs_dir: Path) -> None:
|
||||
def generate_sources(
|
||||
module: str,
|
||||
docs_dir: Path,
|
||||
project_name: str | None = None,
|
||||
module_is_source: bool | None = None,
|
||||
) -> None:
|
||||
"""
|
||||
Generate Markdown source files for the specified module.
|
||||
|
||||
@@ -14,13 +19,18 @@ def generate_sources(module: str, project_name: str | None, docs_dir: Path) -> N
|
||||
module: The dotted path of the primary module to document.
|
||||
project_name: Optional override for the project name.
|
||||
docs_dir: Directory where the generated Markdown files will be written.
|
||||
module_is_source: Module is the source folder and to be treated as the root folder.
|
||||
"""
|
||||
loader = GriffeLoader()
|
||||
discovered_paths = discover_module_paths(module)
|
||||
project = loader.load_project(discovered_paths, project_name)
|
||||
|
||||
renderer = MkDocsRenderer()
|
||||
renderer.generate_sources(project, docs_dir)
|
||||
renderer.generate_sources(
|
||||
project,
|
||||
docs_dir,
|
||||
module_is_source,
|
||||
)
|
||||
|
||||
def generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None:
|
||||
"""
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
from pathlib import Path
|
||||
|
||||
def generate_sources(module: str, project_name: str | None, docs_dir: Path) -> None: ...
|
||||
def generate_sources(
|
||||
module: str,
|
||||
docs_dir: Path,
|
||||
project_name: str | None = None,
|
||||
module_is_source: bool | None = None,
|
||||
) -> None: ...
|
||||
def generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None: ...
|
||||
def build(mkdocs_yml: Path) -> None: ...
|
||||
def serve(mkdocs_yml: Path) -> None: ...
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
"""
|
||||
This module implements the MkDocsRenderer, which generates Markdown source files
|
||||
compatible with the MkDocs 'material' theme and 'mkdocstrings' extension.
|
||||
MkDocsRenderer
|
||||
|
||||
Generates Markdown source files compatible with MkDocs Material
|
||||
and mkdocstrings, ensuring:
|
||||
|
||||
- Root index.md always exists
|
||||
- Parent package indexes are created automatically
|
||||
- Child modules are linked in parent index files
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from docforge.models import Project
|
||||
from docforge.models import Project, Module
|
||||
|
||||
|
||||
class MkDocsRenderer:
|
||||
@@ -16,7 +21,15 @@ class MkDocsRenderer:
|
||||
|
||||
name = "mkdocs"
|
||||
|
||||
def generate_sources(self, project: Project, out_dir: Path) -> None:
|
||||
# -------------------------
|
||||
# Public API
|
||||
# -------------------------
|
||||
def generate_sources(
|
||||
self,
|
||||
project: Project,
|
||||
out_dir: Path,
|
||||
module_is_source: bool | None = None,
|
||||
) -> None:
|
||||
"""
|
||||
Produce a set of Markdown files in the output directory based on the
|
||||
provided Project models.
|
||||
@@ -24,7 +37,11 @@ class MkDocsRenderer:
|
||||
Args:
|
||||
project: The project models to render.
|
||||
out_dir: Target directory for documentation files.
|
||||
module_is_source: Module is the source folder and to be treated as the root folder.
|
||||
"""
|
||||
out_dir.mkdir(parents=True, exist_ok=True)
|
||||
self._ensure_root_index(project, out_dir)
|
||||
|
||||
modules = list(project.get_all_modules())
|
||||
paths = {m.path for m in modules}
|
||||
|
||||
@@ -35,12 +52,23 @@ class MkDocsRenderer:
|
||||
}
|
||||
|
||||
for module in modules:
|
||||
self._write_module(module, packages, out_dir)
|
||||
self._write_module(
|
||||
module,
|
||||
packages,
|
||||
out_dir,
|
||||
module_is_source,
|
||||
)
|
||||
|
||||
# -------------------------
|
||||
# Internal helpers
|
||||
# -------------------------
|
||||
def _write_module(self, module, packages: set[str], out_dir: Path) -> None:
|
||||
def _write_module(
|
||||
self,
|
||||
module: Module,
|
||||
packages: set[str],
|
||||
out_dir: Path,
|
||||
module_is_source: bool | None = None,
|
||||
) -> None:
|
||||
"""
|
||||
Write a single module's documentation file. Packages are written as
|
||||
'index.md' inside their respective directories.
|
||||
@@ -49,31 +77,37 @@ class MkDocsRenderer:
|
||||
module: The module to write.
|
||||
packages: A set of module paths that are identified as packages.
|
||||
out_dir: The base output directory.
|
||||
module_is_source: Module is the source folder and to be treated as the root folder.
|
||||
"""
|
||||
parts = module.path.split(".")
|
||||
|
||||
if module_is_source:
|
||||
module_name, parts = parts[0], parts[1:]
|
||||
else:
|
||||
module_name, parts = parts[0], parts
|
||||
|
||||
if module.path in packages:
|
||||
# package → index.md
|
||||
# Package → directory/index.md
|
||||
dir_path = out_dir.joinpath(*parts)
|
||||
dir_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
md_path = dir_path / "index.md"
|
||||
title = parts[-1].replace("_", " ").title()
|
||||
link_target = f"{parts[-1]}/" if parts else None
|
||||
else:
|
||||
# leaf module → <name>.md
|
||||
# Leaf module → parent_dir/<name>.md
|
||||
dir_path = out_dir.joinpath(*parts[:-1])
|
||||
dir_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
md_path = dir_path / f"{parts[-1]}.md"
|
||||
title = parts[-1].replace("_", " ").title()
|
||||
link_target = f"{parts[-1]}.md" if parts else None
|
||||
|
||||
title = parts[-1].replace("_", " ").title() if parts else module_name
|
||||
content = self._render_markdown(title, module.path)
|
||||
|
||||
if md_path.exists() and md_path.read_text(encoding="utf-8") == content:
|
||||
return
|
||||
|
||||
if not md_path.exists() or md_path.read_text(encoding="utf-8") != content:
|
||||
md_path.write_text(content, encoding="utf-8")
|
||||
|
||||
if not module_is_source:
|
||||
self._ensure_parent_index(parts, out_dir, link_target, title)
|
||||
|
||||
def _render_markdown(self, title: str, module_path: str) -> str:
|
||||
"""
|
||||
Generate the Markdown content for a module file.
|
||||
@@ -89,3 +123,46 @@ class MkDocsRenderer:
|
||||
f"# {title}\n\n"
|
||||
f"::: {module_path}\n"
|
||||
)
|
||||
|
||||
def _ensure_root_index(
|
||||
self,
|
||||
project: Project,
|
||||
out_dir: Path
|
||||
) -> None:
|
||||
root_index = out_dir / "index.md"
|
||||
|
||||
if not root_index.exists():
|
||||
root_index.write_text(
|
||||
f"# {project.name}\n\n"
|
||||
"## Modules\n\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
def _ensure_parent_index(
|
||||
self,
|
||||
parts: list[str],
|
||||
out_dir: Path,
|
||||
link_target: str,
|
||||
title: str,
|
||||
) -> None:
|
||||
if len(parts) == 1:
|
||||
parent_index = out_dir / "index.md"
|
||||
link = f"- [{title}]({link_target})\n"
|
||||
else:
|
||||
parent_dir = out_dir.joinpath(*parts[:-1])
|
||||
parent_dir.mkdir(parents=True, exist_ok=True)
|
||||
parent_index = parent_dir / "index.md"
|
||||
|
||||
link = f"- [{title}]({link_target})\n"
|
||||
|
||||
if not parent_index.exists():
|
||||
parent_title = parts[-2].replace("_", " ").title()
|
||||
parent_index.write_text(
|
||||
f"# {parent_title}\n\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
content = parent_index.read_text(encoding="utf-8")
|
||||
|
||||
if link not in content:
|
||||
parent_index.write_text(content + link, encoding="utf-8")
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
from pathlib import Path
|
||||
from typing import Set
|
||||
|
||||
from docforge.models import Project, Module
|
||||
|
||||
|
||||
class MkDocsRenderer:
|
||||
name: str
|
||||
|
||||
def generate_sources(self, project: Project, out_dir: Path) -> None: ...
|
||||
def generate_sources(
|
||||
self,
|
||||
project: Project,
|
||||
out_dir: Path,
|
||||
module_is_source: bool | None = None,
|
||||
) -> None: ...
|
||||
|
||||
def _write_module(
|
||||
self,
|
||||
module: Module,
|
||||
packages: Set[str],
|
||||
packages: set[str],
|
||||
out_dir: Path,
|
||||
module_is_source: bool | None = None,
|
||||
) -> None: ...
|
||||
|
||||
def _render_markdown(self, title: str, module_path: str) -> str: ...
|
||||
|
||||
def _ensure_root_index(self, project, out_dir) -> None: ...
|
||||
|
||||
def _ensure_parent_index(self, parts, out_dir, link_target, title) -> None: ...
|
||||
|
||||
@@ -31,3 +31,8 @@ plugins:
|
||||
annotations_path: brief
|
||||
show_root_heading: true
|
||||
group_by_category: true
|
||||
|
||||
markdown_extensions:
|
||||
- pymdownx.superfences
|
||||
- pymdownx.tabbed:
|
||||
alternate_style: true
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# Docforge
|
||||
# docforge
|
||||
|
||||
::: docforge
|
||||
@@ -139,7 +139,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -178,7 +178,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.mkdocs_utils.generate_sources",
|
||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.cli.mkdocs_utils.generate_sources')>",
|
||||
"docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written."
|
||||
"docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
},
|
||||
"generate_config": {
|
||||
"name": "generate_config",
|
||||
@@ -319,7 +319,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.mcp_utils.serve",
|
||||
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp_utils.serve')>",
|
||||
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/."
|
||||
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n module: The dotted path of the primary module to serve.\n mcp_root: Path to the directory containing index.json, nav.json, and modules/."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -334,22 +334,22 @@
|
||||
"name": "build",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.build",
|
||||
"signature": "<bound method Function.signature of Function('build', 18, 89)>",
|
||||
"docstring": "Build documentation (MkDocs site or MCP resources).\n\nThis command orchestrates the full build process:\n1. Introspects the code (Griffe)\n2. Renders sources (MkDocs Markdown or MCP JSON)\n3. (MkDocs only) Generates config and runs the final site build.\n\nArgs:\n mcp: Use the MCP documentation builder.\n mkdocs: Use the MkDocs documentation builder.\n module: The dotted path of the module to document.\n project_name: Optional override for the project name.\n site_name: (MkDocs) The site display name. Defaults to module name.\n docs_dir: (MkDocs) Target directory for Markdown sources.\n nav_file: (MkDocs) Path to the docforge.nav.yml specification.\n template: (MkDocs) Optional custom mkdocs.yml template.\n mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.\n out_dir: (MCP) Target directory for MCP JSON resources."
|
||||
"signature": "<bound method Function.signature of Function('build', 18, 97)>",
|
||||
"docstring": "Build documentation (MkDocs site or MCP resources).\n\nThis command orchestrates the full build process:\n1. Introspects the code (Griffe)\n2. Renders sources (MkDocs Markdown or MCP JSON)\n3. (MkDocs only) Generates config and runs the final site build.\n\nArgs:\n mcp: Use the MCP documentation builder.\n mkdocs: Use the MkDocs documentation builder.\n module_is_source: Module is the source folder and to be treated as the root folder.\n module: The dotted path of the module to the document.\n project_name: Optional override for the project name.\n site_name: (MkDocs) The site display name. Defaults to module name.\n docs_dir: (MkDocs) Target directory for Markdown sources.\n nav_file: (MkDocs) Path to the docforge.nav.yml specification.\n template: (MkDocs) Optional custom mkdocs.yml template.\n mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.\n out_dir: (MCP) Target directory for MCP JSON resources."
|
||||
},
|
||||
"serve": {
|
||||
"name": "serve",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.serve",
|
||||
"signature": "<bound method Function.signature of Function('serve', 92, 120)>",
|
||||
"docstring": "Serve documentation (MkDocs or MCP).\n\nArgs:\n mcp: Serve MCP resources via an MCP server.\n mkdocs: Serve the MkDocs site using the built-in development server.\n mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.\n out_dir: (MCP) Path to the mcp_docs/ directory."
|
||||
"signature": "<bound method Function.signature of Function('serve', 100, 133)>",
|
||||
"docstring": "Serve documentation (MkDocs or MCP).\n\nArgs:\n mcp: Serve MCP resources via an MCP server.\n mkdocs: Serve the MkDocs site using the built-in development server.\n module: The dotted path of the module to serve.\n mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.\n out_dir: (MCP) Path to the mcp_docs/ directory."
|
||||
},
|
||||
"tree": {
|
||||
"name": "tree",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.tree",
|
||||
"signature": "<bound method Function.signature of Function('tree', 123, 153)>",
|
||||
"docstring": "Visualize the project structure in the terminal.\n\nArgs:\n modules: List of module import paths to recursively introspect.\n project_name: Optional override for the project name shown at the root."
|
||||
"signature": "<bound method Function.signature of Function('tree', 136, 165)>",
|
||||
"docstring": "Visualize the project structure in the terminal.\n\nArgs:\n module: The module import path to recursively introspect.\n project_name: Optional override for the project name shown at the root."
|
||||
},
|
||||
"Group": {
|
||||
"name": "Group",
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -208,7 +208,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.mkdocs_utils.generate_sources",
|
||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.cli.mkdocs_utils.generate_sources')>",
|
||||
"docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written."
|
||||
"docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
},
|
||||
"generate_config": {
|
||||
"name": "generate_config",
|
||||
@@ -349,7 +349,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.mcp_utils.serve",
|
||||
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp_utils.serve')>",
|
||||
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/."
|
||||
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n module: The dotted path of the primary module to serve.\n mcp_root: Path to the directory containing index.json, nav.json, and modules/."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -364,22 +364,22 @@
|
||||
"name": "build",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.build",
|
||||
"signature": "<bound method Function.signature of Function('build', 18, 89)>",
|
||||
"docstring": "Build documentation (MkDocs site or MCP resources).\n\nThis command orchestrates the full build process:\n1. Introspects the code (Griffe)\n2. Renders sources (MkDocs Markdown or MCP JSON)\n3. (MkDocs only) Generates config and runs the final site build.\n\nArgs:\n mcp: Use the MCP documentation builder.\n mkdocs: Use the MkDocs documentation builder.\n module: The dotted path of the module to document.\n project_name: Optional override for the project name.\n site_name: (MkDocs) The site display name. Defaults to module name.\n docs_dir: (MkDocs) Target directory for Markdown sources.\n nav_file: (MkDocs) Path to the docforge.nav.yml specification.\n template: (MkDocs) Optional custom mkdocs.yml template.\n mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.\n out_dir: (MCP) Target directory for MCP JSON resources."
|
||||
"signature": "<bound method Function.signature of Function('build', 18, 97)>",
|
||||
"docstring": "Build documentation (MkDocs site or MCP resources).\n\nThis command orchestrates the full build process:\n1. Introspects the code (Griffe)\n2. Renders sources (MkDocs Markdown or MCP JSON)\n3. (MkDocs only) Generates config and runs the final site build.\n\nArgs:\n mcp: Use the MCP documentation builder.\n mkdocs: Use the MkDocs documentation builder.\n module_is_source: Module is the source folder and to be treated as the root folder.\n module: The dotted path of the module to the document.\n project_name: Optional override for the project name.\n site_name: (MkDocs) The site display name. Defaults to module name.\n docs_dir: (MkDocs) Target directory for Markdown sources.\n nav_file: (MkDocs) Path to the docforge.nav.yml specification.\n template: (MkDocs) Optional custom mkdocs.yml template.\n mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.\n out_dir: (MCP) Target directory for MCP JSON resources."
|
||||
},
|
||||
"serve": {
|
||||
"name": "serve",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.serve",
|
||||
"signature": "<bound method Function.signature of Function('serve', 92, 120)>",
|
||||
"docstring": "Serve documentation (MkDocs or MCP).\n\nArgs:\n mcp: Serve MCP resources via an MCP server.\n mkdocs: Serve the MkDocs site using the built-in development server.\n mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.\n out_dir: (MCP) Path to the mcp_docs/ directory."
|
||||
"signature": "<bound method Function.signature of Function('serve', 100, 133)>",
|
||||
"docstring": "Serve documentation (MkDocs or MCP).\n\nArgs:\n mcp: Serve MCP resources via an MCP server.\n mkdocs: Serve the MkDocs site using the built-in development server.\n module: The dotted path of the module to serve.\n mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.\n out_dir: (MCP) Path to the mcp_docs/ directory."
|
||||
},
|
||||
"tree": {
|
||||
"name": "tree",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.tree",
|
||||
"signature": "<bound method Function.signature of Function('tree', 123, 153)>",
|
||||
"docstring": "Visualize the project structure in the terminal.\n\nArgs:\n modules: List of module import paths to recursively introspect.\n project_name: Optional override for the project name shown at the root."
|
||||
"signature": "<bound method Function.signature of Function('tree', 136, 165)>",
|
||||
"docstring": "Visualize the project structure in the terminal.\n\nArgs:\n module: The module import path to recursively introspect.\n project_name: Optional override for the project name shown at the root."
|
||||
},
|
||||
"Group": {
|
||||
"name": "Group",
|
||||
@@ -512,8 +512,8 @@
|
||||
"name": "serve",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mcp_utils.serve",
|
||||
"signature": "<bound method Function.signature of Function('serve', 23, 47)>",
|
||||
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/."
|
||||
"signature": "<bound method Function.signature of Function('serve', 23, 48)>",
|
||||
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n module: The dotted path of the primary module to serve.\n mcp_root: Path to the directory containing index.json, nav.json, and modules/."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -601,7 +601,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -639,28 +639,28 @@
|
||||
"name": "generate_sources",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.generate_sources",
|
||||
"signature": "<bound method Function.signature of Function('generate_sources', 9, 23)>",
|
||||
"docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written."
|
||||
"signature": "<bound method Function.signature of Function('generate_sources', 9, 33)>",
|
||||
"docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
},
|
||||
"generate_config": {
|
||||
"name": "generate_config",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.generate_config",
|
||||
"signature": "<bound method Function.signature of Function('generate_config', 25, 59)>",
|
||||
"signature": "<bound method Function.signature of Function('generate_config', 35, 69)>",
|
||||
"docstring": "Generate an mkdocs.yml configuration file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template (overrides built-in).\n out: Path where the final mkdocs.yml will be written.\n site_name: The display name for the documentation site."
|
||||
},
|
||||
"build": {
|
||||
"name": "build",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.build",
|
||||
"signature": "<bound method Function.signature of Function('build', 61, 74)>",
|
||||
"signature": "<bound method Function.signature of Function('build', 71, 84)>",
|
||||
"docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
|
||||
},
|
||||
"serve": {
|
||||
"name": "serve",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.serve",
|
||||
"signature": "<bound method Function.signature of Function('serve', 76, 87)>",
|
||||
"signature": "<bound method Function.signature of Function('serve', 86, 97)>",
|
||||
"docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,8 +112,8 @@
|
||||
"name": "serve",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mcp_utils.serve",
|
||||
"signature": "<bound method Function.signature of Function('serve', 23, 47)>",
|
||||
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/."
|
||||
"signature": "<bound method Function.signature of Function('serve', 23, 48)>",
|
||||
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n module: The dotted path of the primary module to serve.\n mcp_root: Path to the directory containing index.json, nav.json, and modules/."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -119,28 +119,28 @@
|
||||
"name": "generate_sources",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.generate_sources",
|
||||
"signature": "<bound method Function.signature of Function('generate_sources', 9, 23)>",
|
||||
"docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written."
|
||||
"signature": "<bound method Function.signature of Function('generate_sources', 9, 33)>",
|
||||
"docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
},
|
||||
"generate_config": {
|
||||
"name": "generate_config",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.generate_config",
|
||||
"signature": "<bound method Function.signature of Function('generate_config', 25, 59)>",
|
||||
"signature": "<bound method Function.signature of Function('generate_config', 35, 69)>",
|
||||
"docstring": "Generate an mkdocs.yml configuration file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template (overrides built-in).\n out: Path where the final mkdocs.yml will be written.\n site_name: The display name for the documentation site."
|
||||
},
|
||||
"build": {
|
||||
"name": "build",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.build",
|
||||
"signature": "<bound method Function.signature of Function('build', 61, 74)>",
|
||||
"signature": "<bound method Function.signature of Function('build', 71, 84)>",
|
||||
"docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
|
||||
},
|
||||
"serve": {
|
||||
"name": "serve",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.serve",
|
||||
"signature": "<bound method Function.signature of Function('serve', 76, 87)>",
|
||||
"signature": "<bound method Function.signature of Function('serve', 86, 97)>",
|
||||
"docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "docforge",
|
||||
"content": {
|
||||
"path": "docforge",
|
||||
"docstring": "# doc-forge\n\n`doc-forge` is a renderer-agnostic Python documentation compiler designed for\nspeed, flexibility, and beautiful output. It decouples the introspection of\nyour code from the rendering process, allowing you to generate documentation\nfor various platforms (starting with MkDocs) from a single internal models.\n\n## Available Commands\n\n- **build**: Build documentation (MkDocs site or MCP resources).\n- **serve**: Serve documentation (MkDocs or MCP).\n- **tree**: Visualize the introspected project structure.\n\n## Installation\n\nInstall using `pip` with the optional `mkdocs` dependencies for a complete setup:\n\n```bash\npip install doc-forge\n```\n\n## Quick Start\n\n1. **Build Documentation**:\n Introspect your package and generate documentation in one step:\n ```bash\n # Build MkDocs site\n doc-forge build --mkdocs --module my_package --site-name \"My Docs\"\n\n # Build MCP resources\n doc-forge build --mcp --module my_package\n ```\n\n2. **Define Navigation**:\n Create a `docforge.nav.yml` to organize your documentation:\n ```yaml\n home: my_package/index.md\n groups:\n Core API:\n - my_package/core/*.md\n Utilities:\n - my_package/utils.md\n ```\n\n3. **Preview**:\n ```bash\n # Serve MkDocs site\n doc-forge serve --mkdocs\n\n # Serve MCP documentation\n doc-forge serve --mcp\n ```\n\n## Project Structure\n\n- `docforge.loaders`: Introspects source code using static analysis (`griffe`).\n- `docforge.models`: The internal representation of your project, modules, and objects.\n- `docforge.renderers`: Converters that turn the models into physical files.\n- `docforge.nav`: Managers for logical-to-physical path mapping and navigation.",
|
||||
"docstring": "Renderer-agnostic Python documentation compiler that converts docstrings into\nstructured documentation for both humans (MkDocs) and machines (MCP / AI agents).\n\n`doc-forge` statically analyzes your source code, builds a semantic model of\nmodules and objects, and renders that model into documentation outputs without\nexecuting your code.\n---\n\n# Core Philosophy\n\n`doc-forge` follows a compiler architecture:\n\n1. **Front-end (Introspection)**\n Static analysis of modules, classes, functions, signatures, and docstrings.\n\n2. **Middle-end (Semantic Model)**\n Renderer-neutral structured representation of your API.\n\n3. **Back-end (Renderers)**\n\n * MkDocs → human documentation\n * MCP JSON → AI-readable documentation\n---\n\n# Docstring Writing Standard\n\nDocstrings are the single source of truth. `doc-forge` does not generate content.\nIt compiles and renders what you write.\n\nDocumentation follows the Python import hierarchy.\n---\n\n# Package docstring (`package/__init__.py`) — Full user guide\n\nThis is the landing page. A developer must be able to install and use the\npackage after reading only this docstring.\n\n## Example:\n\n '''\n Short description of what this package provides.\n\n # Installation\n\n ```bash\n pip install my-package\n ```\n\n # Quick start\n\n ```python\n from my_package.foo import Bar\n\n bar = Bar()\n result = bar.process(\"example\")\n ```\n ---\n\n # Core concepts\n\n ## Bar\n - Primary object exposed by the package.\n\n ## foo module\n - Provides core functionality.\n ---\n\n # Typical workflow\n\n 1. Import public objects\n 2. Initialize objects\n 3. Call methods\n ---\n\n # Public API\n\n foo.Bar\n foo.helper_function\n ---\n '''\n---\n\n# Submodule docstring (`package/foo/__init__.py`) — Subsystem guide\n\nExplains a specific subsystem.\n\n## Example:\n\n '''\n Provides core functionality.\n\n # Usage\n\n ```python\n from my_package.foo import Bar\n\n bar = Bar()\n bar.process(\"example\")\n ```\n ---\n '''\n---\n\n# Class docstring — Object contract\n\nDefines responsibility and behavior.\n\n## Example:\n\n```python\nclass Bar:\n '''\n Performs processing on input data.\n\n Instances may be reused across multiple calls.\n ---\n '''\n```\n\nInclude:\n\n* Responsibility\n* Lifecycle expectations\n* Thread safety (if relevant)\n* Performance characteristics (if relevant)\n---\n\n# Function and method docstrings — API specification\n\n## Example:\n\n```python\ndef process(\n self,\n value1: str,\n value2: str | None = \"default value\",\n value3: str | None = None,\n) -> str:\n '''\n Process an input value.\n ---\n\n Parameters\n ----------\n value1 : str\n required: True\n value to be processed\n Example:\n 'string'\n\n value2 : str\n required: False\n default: \"default value\"\n value to be processed\n Example:\n 'string'\n\n value3 : str\n required: False\n value to be processed\n Example:\n 'string'\n ---\n\n Returns\n -------\n processed value : str\n result after processing value\n ---\n\n Behavior\n --------\n - behaviour 1\n - behaviour 2\n ---\n '''\n```\n---\n\n# Attribute docstrings (optional)\n\n## Example:\n\n```python\nclass Class\n '''\n attribute1 : str\n required: True\n default: \"default value\"\n attribute description\n\n attribute2 : str\n required: False\n attribute description\n\n attribute2 : str\n required: False\n default: \"default value\"\n attribute description\n '''\n\n attribute1: str = \"default value\"\n attribute2: str | None = None\n attribute3: str | None = \"default value\"\n```\n---\n\n# Writing Rules\n\n**Heading hierarchy**\n\nModule docstring\n\n- Examples\n- Usage\n- Core concepts\n- Public API\n\nClass docstring\n\n- Attributes\n- Execution contract\n- Lifecycle\n- Thread safety\n- Notes\n\nMethod docstring\n\n- Parameters\n- Returns\n- Raises\n- Yields\n- Behavior\n\n**Required**\n\n* Use Markdown headings\n* Use Markdown line separator `---`\n* Line separator should be followed by a blank line\n* Provide real import examples\n* Document all public APIs\n* Keep descriptions precise and factual\n\n**Avoid**\n\n* Plain-text separators like `====`\n* Duplicate external documentation\n* Informal or conversational language\n---\n\n# How doc-forge uses these docstrings\n\n## Build MkDocs site:\n\n```bash\ndoc-forge build --mkdocs --module my_package\n```\n\n## Build MCP documentation:\n\n```bash\ndoc-forge build --mcp --module my_package\n```\n\nBoth outputs are generated directly from docstrings.\n---",
|
||||
"objects": {
|
||||
"GriffeLoader": {
|
||||
"name": "GriffeLoader",
|
||||
@@ -53,7 +53,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -275,7 +275,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.mkdocs_utils.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -314,7 +314,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.mkdocs_utils.generate_sources",
|
||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.cli.mkdocs_utils.generate_sources')>",
|
||||
"docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written."
|
||||
"docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
},
|
||||
"generate_config": {
|
||||
"name": "generate_config",
|
||||
@@ -455,7 +455,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.mcp_utils.serve",
|
||||
"signature": "<bound method Alias.signature of Alias('serve', 'docforge.cli.mcp_utils.serve')>",
|
||||
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/."
|
||||
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n module: The dotted path of the primary module to serve.\n mcp_root: Path to the directory containing index.json, nav.json, and modules/."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -470,22 +470,22 @@
|
||||
"name": "build",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.build",
|
||||
"signature": "<bound method Function.signature of Function('build', 18, 89)>",
|
||||
"docstring": "Build documentation (MkDocs site or MCP resources).\n\nThis command orchestrates the full build process:\n1. Introspects the code (Griffe)\n2. Renders sources (MkDocs Markdown or MCP JSON)\n3. (MkDocs only) Generates config and runs the final site build.\n\nArgs:\n mcp: Use the MCP documentation builder.\n mkdocs: Use the MkDocs documentation builder.\n module: The dotted path of the module to document.\n project_name: Optional override for the project name.\n site_name: (MkDocs) The site display name. Defaults to module name.\n docs_dir: (MkDocs) Target directory for Markdown sources.\n nav_file: (MkDocs) Path to the docforge.nav.yml specification.\n template: (MkDocs) Optional custom mkdocs.yml template.\n mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.\n out_dir: (MCP) Target directory for MCP JSON resources."
|
||||
"signature": "<bound method Function.signature of Function('build', 18, 97)>",
|
||||
"docstring": "Build documentation (MkDocs site or MCP resources).\n\nThis command orchestrates the full build process:\n1. Introspects the code (Griffe)\n2. Renders sources (MkDocs Markdown or MCP JSON)\n3. (MkDocs only) Generates config and runs the final site build.\n\nArgs:\n mcp: Use the MCP documentation builder.\n mkdocs: Use the MkDocs documentation builder.\n module_is_source: Module is the source folder and to be treated as the root folder.\n module: The dotted path of the module to the document.\n project_name: Optional override for the project name.\n site_name: (MkDocs) The site display name. Defaults to module name.\n docs_dir: (MkDocs) Target directory for Markdown sources.\n nav_file: (MkDocs) Path to the docforge.nav.yml specification.\n template: (MkDocs) Optional custom mkdocs.yml template.\n mkdocs_yml: (MkDocs) Target path for the generated mkdocs.yml.\n out_dir: (MCP) Target directory for MCP JSON resources."
|
||||
},
|
||||
"serve": {
|
||||
"name": "serve",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.serve",
|
||||
"signature": "<bound method Function.signature of Function('serve', 92, 120)>",
|
||||
"docstring": "Serve documentation (MkDocs or MCP).\n\nArgs:\n mcp: Serve MCP resources via an MCP server.\n mkdocs: Serve the MkDocs site using the built-in development server.\n mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.\n out_dir: (MCP) Path to the mcp_docs/ directory."
|
||||
"signature": "<bound method Function.signature of Function('serve', 100, 133)>",
|
||||
"docstring": "Serve documentation (MkDocs or MCP).\n\nArgs:\n mcp: Serve MCP resources via an MCP server.\n mkdocs: Serve the MkDocs site using the built-in development server.\n module: The dotted path of the module to serve.\n mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.\n out_dir: (MCP) Path to the mcp_docs/ directory."
|
||||
},
|
||||
"tree": {
|
||||
"name": "tree",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.commands.tree",
|
||||
"signature": "<bound method Function.signature of Function('tree', 123, 153)>",
|
||||
"docstring": "Visualize the project structure in the terminal.\n\nArgs:\n modules: List of module import paths to recursively introspect.\n project_name: Optional override for the project name shown at the root."
|
||||
"signature": "<bound method Function.signature of Function('tree', 136, 165)>",
|
||||
"docstring": "Visualize the project structure in the terminal.\n\nArgs:\n module: The module import path to recursively introspect.\n project_name: Optional override for the project name shown at the root."
|
||||
},
|
||||
"Group": {
|
||||
"name": "Group",
|
||||
@@ -618,8 +618,8 @@
|
||||
"name": "serve",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mcp_utils.serve",
|
||||
"signature": "<bound method Function.signature of Function('serve', 23, 47)>",
|
||||
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n mcp_root: Path to the directory containing index.json, nav.json, and modules/."
|
||||
"signature": "<bound method Function.signature of Function('serve', 23, 48)>",
|
||||
"docstring": "Serve MCP documentation from a pre-built bundle.\n\nArgs:\n module: The dotted path of the primary module to serve.\n mcp_root: Path to the directory containing index.json, nav.json, and modules/."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -707,7 +707,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -745,28 +745,28 @@
|
||||
"name": "generate_sources",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.generate_sources",
|
||||
"signature": "<bound method Function.signature of Function('generate_sources', 9, 23)>",
|
||||
"docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written."
|
||||
"signature": "<bound method Function.signature of Function('generate_sources', 9, 33)>",
|
||||
"docstring": "Generate Markdown source files for the specified module.\n\nArgs:\n module: The dotted path of the primary module to document.\n project_name: Optional override for the project name.\n docs_dir: Directory where the generated Markdown files will be written.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
},
|
||||
"generate_config": {
|
||||
"name": "generate_config",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.generate_config",
|
||||
"signature": "<bound method Function.signature of Function('generate_config', 25, 59)>",
|
||||
"signature": "<bound method Function.signature of Function('generate_config', 35, 69)>",
|
||||
"docstring": "Generate an mkdocs.yml configuration file.\n\nArgs:\n docs_dir: Path to the directory containing documentation Markdown files.\n nav_file: Path to the docforge.nav.yml specification.\n template: Optional path to an mkdocs.yml template (overrides built-in).\n out: Path where the final mkdocs.yml will be written.\n site_name: The display name for the documentation site."
|
||||
},
|
||||
"build": {
|
||||
"name": "build",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.build",
|
||||
"signature": "<bound method Function.signature of Function('build', 61, 74)>",
|
||||
"signature": "<bound method Function.signature of Function('build', 71, 84)>",
|
||||
"docstring": "Build the documentation site using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
|
||||
},
|
||||
"serve": {
|
||||
"name": "serve",
|
||||
"kind": "function",
|
||||
"path": "docforge.cli.mkdocs_utils.serve",
|
||||
"signature": "<bound method Function.signature of Function('serve', 76, 87)>",
|
||||
"signature": "<bound method Function.signature of Function('serve', 86, 97)>",
|
||||
"docstring": "Serve the documentation site with live-reload using MkDocs.\n\nArgs:\n mkdocs_yml: Path to the mkdocs.yml configuration file."
|
||||
}
|
||||
}
|
||||
@@ -2079,7 +2079,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.renderers.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2465,7 +2465,7 @@
|
||||
"kind": "module",
|
||||
"path": "docforge.renderers.mkdocs_renderer",
|
||||
"signature": null,
|
||||
"docstring": "This module implements the MkDocsRenderer, which generates Markdown source files\ncompatible with the MkDocs 'material' theme and 'mkdocstrings' extension.",
|
||||
"docstring": "MkDocsRenderer\n\nGenerates Markdown source files compatible with MkDocs Material\nand mkdocstrings, ensuring:\n\n- Root index.md always exists\n- Parent package indexes are created automatically\n- Child modules are linked in parent index files",
|
||||
"members": {
|
||||
"Path": {
|
||||
"name": "Path",
|
||||
@@ -2525,36 +2525,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"MkDocsRenderer": {
|
||||
"name": "MkDocsRenderer",
|
||||
"kind": "class",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer",
|
||||
"signature": "<bound method Class.signature of Class('MkDocsRenderer', 11, 91)>",
|
||||
"docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
|
||||
"members": {
|
||||
"name": {
|
||||
"name": "name",
|
||||
"kind": "attribute",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.name",
|
||||
"signature": null,
|
||||
"docstring": null
|
||||
},
|
||||
"generate_sources": {
|
||||
"name": "generate_sources",
|
||||
"kind": "function",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Function.signature of Function('generate_sources', 19, 38)>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
|
||||
}
|
||||
}
|
||||
},
|
||||
"Set": {
|
||||
"name": "Set",
|
||||
"kind": "alias",
|
||||
"path": "docforge.renderers.mkdocs_renderer.Set",
|
||||
"signature": "<bound method Alias.signature of Alias('Set', 'typing.Set')>",
|
||||
"docstring": null
|
||||
},
|
||||
"Module": {
|
||||
"name": "Module",
|
||||
"kind": "class",
|
||||
@@ -2605,6 +2575,29 @@
|
||||
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||
}
|
||||
}
|
||||
},
|
||||
"MkDocsRenderer": {
|
||||
"name": "MkDocsRenderer",
|
||||
"kind": "class",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer",
|
||||
"signature": "<bound method Class.signature of Class('MkDocsRenderer', 16, 168)>",
|
||||
"docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
|
||||
"members": {
|
||||
"name": {
|
||||
"name": "name",
|
||||
"kind": "attribute",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.name",
|
||||
"signature": null,
|
||||
"docstring": null
|
||||
},
|
||||
"generate_sources": {
|
||||
"name": "generate_sources",
|
||||
"kind": "function",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Function.signature of Function('generate_sources', 27, 60)>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.renderers.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Alias.signature of Alias('generate_sources', 'docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources')>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -409,7 +409,7 @@
|
||||
"kind": "module",
|
||||
"path": "docforge.renderers.mkdocs_renderer",
|
||||
"signature": null,
|
||||
"docstring": "This module implements the MkDocsRenderer, which generates Markdown source files\ncompatible with the MkDocs 'material' theme and 'mkdocstrings' extension.",
|
||||
"docstring": "MkDocsRenderer\n\nGenerates Markdown source files compatible with MkDocs Material\nand mkdocstrings, ensuring:\n\n- Root index.md always exists\n- Parent package indexes are created automatically\n- Child modules are linked in parent index files",
|
||||
"members": {
|
||||
"Path": {
|
||||
"name": "Path",
|
||||
@@ -469,36 +469,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"MkDocsRenderer": {
|
||||
"name": "MkDocsRenderer",
|
||||
"kind": "class",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer",
|
||||
"signature": "<bound method Class.signature of Class('MkDocsRenderer', 11, 91)>",
|
||||
"docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
|
||||
"members": {
|
||||
"name": {
|
||||
"name": "name",
|
||||
"kind": "attribute",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.name",
|
||||
"signature": null,
|
||||
"docstring": null
|
||||
},
|
||||
"generate_sources": {
|
||||
"name": "generate_sources",
|
||||
"kind": "function",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Function.signature of Function('generate_sources', 19, 38)>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
|
||||
}
|
||||
}
|
||||
},
|
||||
"Set": {
|
||||
"name": "Set",
|
||||
"kind": "alias",
|
||||
"path": "docforge.renderers.mkdocs_renderer.Set",
|
||||
"signature": "<bound method Alias.signature of Alias('Set', 'typing.Set')>",
|
||||
"docstring": null
|
||||
},
|
||||
"Module": {
|
||||
"name": "Module",
|
||||
"kind": "class",
|
||||
@@ -549,6 +519,29 @@
|
||||
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||
}
|
||||
}
|
||||
},
|
||||
"MkDocsRenderer": {
|
||||
"name": "MkDocsRenderer",
|
||||
"kind": "class",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer",
|
||||
"signature": "<bound method Class.signature of Class('MkDocsRenderer', 16, 168)>",
|
||||
"docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
|
||||
"members": {
|
||||
"name": {
|
||||
"name": "name",
|
||||
"kind": "attribute",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.name",
|
||||
"signature": null,
|
||||
"docstring": null
|
||||
},
|
||||
"generate_sources": {
|
||||
"name": "generate_sources",
|
||||
"kind": "function",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Function.signature of Function('generate_sources', 27, 60)>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "docforge.renderers.mkdocs_renderer",
|
||||
"content": {
|
||||
"path": "docforge.renderers.mkdocs_renderer",
|
||||
"docstring": "This module implements the MkDocsRenderer, which generates Markdown source files\ncompatible with the MkDocs 'material' theme and 'mkdocstrings' extension.",
|
||||
"docstring": "MkDocsRenderer\n\nGenerates Markdown source files compatible with MkDocs Material\nand mkdocstrings, ensuring:\n\n- Root index.md always exists\n- Parent package indexes are created automatically\n- Child modules are linked in parent index files",
|
||||
"objects": {
|
||||
"Path": {
|
||||
"name": "Path",
|
||||
@@ -62,36 +62,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"MkDocsRenderer": {
|
||||
"name": "MkDocsRenderer",
|
||||
"kind": "class",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer",
|
||||
"signature": "<bound method Class.signature of Class('MkDocsRenderer', 11, 91)>",
|
||||
"docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
|
||||
"members": {
|
||||
"name": {
|
||||
"name": "name",
|
||||
"kind": "attribute",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.name",
|
||||
"signature": null,
|
||||
"docstring": null
|
||||
},
|
||||
"generate_sources": {
|
||||
"name": "generate_sources",
|
||||
"kind": "function",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Function.signature of Function('generate_sources', 19, 38)>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files."
|
||||
}
|
||||
}
|
||||
},
|
||||
"Set": {
|
||||
"name": "Set",
|
||||
"kind": "alias",
|
||||
"path": "docforge.renderers.mkdocs_renderer.Set",
|
||||
"signature": "<bound method Alias.signature of Alias('Set', 'typing.Set')>",
|
||||
"docstring": null
|
||||
},
|
||||
"Module": {
|
||||
"name": "Module",
|
||||
"kind": "class",
|
||||
@@ -142,6 +112,29 @@
|
||||
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||
}
|
||||
}
|
||||
},
|
||||
"MkDocsRenderer": {
|
||||
"name": "MkDocsRenderer",
|
||||
"kind": "class",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer",
|
||||
"signature": "<bound method Class.signature of Class('MkDocsRenderer', 16, 168)>",
|
||||
"docstring": "Renderer that generates Markdown source files formatted for the MkDocs\n'mkdocstrings' plugin.",
|
||||
"members": {
|
||||
"name": {
|
||||
"name": "name",
|
||||
"kind": "attribute",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.name",
|
||||
"signature": null,
|
||||
"docstring": null
|
||||
},
|
||||
"generate_sources": {
|
||||
"name": "generate_sources",
|
||||
"kind": "function",
|
||||
"path": "docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources",
|
||||
"signature": "<bound method Function.signature of Function('generate_sources', 27, 60)>",
|
||||
"docstring": "Produce a set of Markdown files in the output directory based on the\nprovided Project models.\n\nArgs:\n project: The project models to render.\n out_dir: Target directory for documentation files.\n module_is_source: Module is the source folder and to be treated as the root folder."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
48
mkdocs.yml
48
mkdocs.yml
@@ -1,5 +1,3 @@
|
||||
site_name: docforge
|
||||
|
||||
theme:
|
||||
name: material
|
||||
palette:
|
||||
@@ -33,30 +31,34 @@ plugins:
|
||||
annotations_path: brief
|
||||
show_root_heading: true
|
||||
group_by_category: true
|
||||
|
||||
markdown_extensions:
|
||||
- pymdownx.superfences
|
||||
- pymdownx.tabbed:
|
||||
alternate_style: true
|
||||
site_name: docforge
|
||||
nav:
|
||||
- Home: docforge/index.md
|
||||
- Home: index.md
|
||||
- Loaders:
|
||||
- docforge/loaders/index.md
|
||||
- docforge/loaders/griffe_loader.md
|
||||
- loaders/index.md
|
||||
- loaders/griffe_loader.md
|
||||
- Models:
|
||||
- docforge/models/index.md
|
||||
- docforge/models/module.md
|
||||
- docforge/models/object.md
|
||||
- docforge/models/project.md
|
||||
- models/index.md
|
||||
- models/module.md
|
||||
- models/object.md
|
||||
- models/project.md
|
||||
- Navigation:
|
||||
- docforge/nav/index.md
|
||||
- docforge/nav/spec.md
|
||||
- docforge/nav/resolver.md
|
||||
- docforge/nav/mkdocs.md
|
||||
- nav/index.md
|
||||
- nav/spec.md
|
||||
- nav/resolver.md
|
||||
- nav/mkdocs.md
|
||||
- Renderers:
|
||||
- docforge/renderers/index.md
|
||||
- docforge/renderers/base.md
|
||||
- docforge/renderers/mkdocs_renderer.md
|
||||
- docforge/renderers/mcp_renderer.md
|
||||
- renderers/index.md
|
||||
- renderers/base.md
|
||||
- renderers/mkdocs_renderer.md
|
||||
- renderers/mcp_renderer.md
|
||||
- CLI:
|
||||
- docforge/cli/index.md
|
||||
- docforge/cli/main.md
|
||||
- docforge/cli/commands.md
|
||||
- docforge/cli/mcp_utils.md
|
||||
- docforge/cli/mkdocs_utils.md
|
||||
- cli/index.md
|
||||
- cli/main.md
|
||||
- cli/commands.md
|
||||
- cli/mcp_utils.md
|
||||
- cli/mkdocs_utils.md
|
||||
|
||||
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "doc-forge"
|
||||
version = "0.0.3"
|
||||
version = "0.0.5"
|
||||
description = "A renderer-agnostic Python documentation compiler"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
@@ -10,7 +10,7 @@ def test_mcp_serve(
|
||||
|
||||
result = cli_runner.invoke(
|
||||
cli,
|
||||
["serve", "--mcp", "--out-dir", str(fake_mcp_docs)],
|
||||
["serve", "--mcp", "--module", "fake_module", "--out-dir", str(fake_mcp_docs)],
|
||||
)
|
||||
|
||||
assert result.exit_code == 0
|
||||
|
||||
Reference in New Issue
Block a user