docs(wiki): align wiki structure with Aetoskia AGENTS.md guidelines
- Renamed `02_architecture.md` to `02_components.md` to match the standard component page naming convention.
- Updated `docs/mkdocs.wiki.yml` to reflect renamed pages and fix navigation label acronym casing (GSDFC, MCP, MkDocs).
- Updated `index.md` to include the mandatory doc model blockquote, standardize section headers with emojis, and accurately map the `Documentation Structure` table to the navigation menu.
- Standardized all wiki pages (`01_overview.md`, `02_components.md`, `03_conventions.md`, `04_iterative_workflow.md`, and `05_development/*`) by:
- Adding horizontal rules (`---`) between major sections.
- Applying emoji-prefixed H2 headings for recognizable section types.
- Appending `## Related` or `## ➡️ Read Next` footers with standard relative cross-links.
- Adjusting H1 headers to match guide anatomy (e.g., `# Library Overview` on the overview page).
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
# Overview
|
||||
# Library Overview
|
||||
|
||||
`docforge` turns GSDFC-compliant Python docstrings into maintainable reference
|
||||
documentation. It never edits source docstrings; it reads them, renders them,
|
||||
and assembles documentation sites from all available material.
|
||||
|
||||
## What it generates
|
||||
---
|
||||
|
||||
## 🧭 Which Build Should You Use?
|
||||
|
||||
| Kind | Source | Output |
|
||||
|-----------|----------------------------|---------------------------------|
|
||||
@@ -13,7 +15,9 @@ and assembles documentation sites from all available material.
|
||||
| `wiki` | Hand-written markdown | `docs/wiki/**` (unchanged) |
|
||||
| `mcp` | GSDFC docstrings + renderers | `docs/mcp/**` structured JSON |
|
||||
|
||||
## Per-kind MkDocs builds
|
||||
---
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
Each enabled site kind produces its own MkDocs configuration and build:
|
||||
|
||||
@@ -25,8 +29,15 @@ Every site is self-contained (own theme assets and search index) with
|
||||
navigation derived or scoped to that kind. Hand-written wiki content is never
|
||||
overwritten or regenerated — only its navigation is derived automatically.
|
||||
|
||||
## MCP bundle
|
||||
---
|
||||
|
||||
## 🔄 Lifecycle Rules
|
||||
|
||||
`docs/mcp/**` is a self-contained, machine-readable reference generated from
|
||||
docforge's own GSDFC docstrings. `doc-forge serve --mcp --module docforge`
|
||||
serves it over MCP. See the [MCP Guide](05_development/04_mcp_guide.md).
|
||||
serves it over MCP. See the [MCP Guide](05_development/04_mcp_guide.md).
|
||||
|
||||
---
|
||||
|
||||
## ➡️ Read Next
|
||||
- [02 – Components](02_components.md) · [03 – Conventions](03_conventions.md)
|
||||
@@ -1,35 +1,45 @@
|
||||
# Architecture
|
||||
# Components
|
||||
|
||||
`docforge` is split into four horizontal layers. Everything flows top to
|
||||
bottom through the CLI.
|
||||
|
||||
## Loaders → Models
|
||||
---
|
||||
|
||||
## 1. Loaders & Models
|
||||
|
||||
The `docforge/loaders` package wraps `griffe` to extract modules, functions,
|
||||
classes, and Google-style docstring sections. Loaded data is normalized into
|
||||
the object model under `docforge/models` (`Project`, `Module`, `DocObject`).
|
||||
|
||||
## Navigation
|
||||
---
|
||||
|
||||
## 2. Navigation
|
||||
|
||||
`docforge/nav` parses `docforge.nav.yml` specs (`NavSpec`, `Resolver`, and the
|
||||
MkDocs nav emitter) and, since the wiki kind, derives wiki navigation from the
|
||||
file structure via `build_wiki_nav`.
|
||||
|
||||
## Renderers
|
||||
---
|
||||
|
||||
## 3. Renderers
|
||||
|
||||
`docforge/renderers` turn model data into artifacts:
|
||||
|
||||
- `MkDocsRenderer` → `docs/lib/**` reference markdown
|
||||
- `MCPRenderer` → `docs/mcp/**` structured documentation
|
||||
|
||||
## Servers
|
||||
---
|
||||
|
||||
## 4. Servers
|
||||
|
||||
`docforge/servers` serves generated artifacts over live protocols:
|
||||
|
||||
- `MCPServer` → serves a pre-generated `docs/mcp/**` bundle through MCP
|
||||
resources (`docs://index`, `docs://nav`, `docs://modules/{module}`)
|
||||
|
||||
## CLI
|
||||
---
|
||||
|
||||
## 5. CLI
|
||||
|
||||
`docforge/cli` wires it all together:
|
||||
|
||||
@@ -37,4 +47,9 @@ file structure via `build_wiki_nav`.
|
||||
/ `--mcp` modes
|
||||
- `mkdocs_utils.py` — per-kind config generation (`docs/mkdocs.{lib,api,wiki}.yml`)
|
||||
with navigation re-rooted to each kind's `docs_dir`
|
||||
- `api_utils.py` — OpenAPI loading and API docs generation
|
||||
- `api_utils.py` — OpenAPI loading and API docs generation
|
||||
|
||||
---
|
||||
|
||||
## Related
|
||||
- [01 – Overview](01_overview.md) · [03 – Conventions](03_conventions.md)
|
||||
@@ -1,5 +1,7 @@
|
||||
# Conventions
|
||||
|
||||
---
|
||||
|
||||
## GSDFC docstrings
|
||||
|
||||
All documented source uses the Google-Styled Doc-Forge Convention (GSDFC):
|
||||
@@ -12,31 +14,42 @@ package docstring, which is exported verbatim into
|
||||
|
||||
Key rules:
|
||||
|
||||
- Use parenthesized types in prose entries (`name (Type):`) that match the
|
||||
signature types.
|
||||
- Use `# Summary`, `# Examples`, and `# Notes` sections at module level.
|
||||
- Use `Args:`, `Returns:`, `Raises:`, `Yields:`, `Notes:`, and `Example:`
|
||||
sections at function and method level.
|
||||
- Always update the matching `.pyi` stub alongside the `.py` implementation.
|
||||
1. Use parenthesized types in prose entries (`name (Type):`) that match the
|
||||
signature types.
|
||||
2. Use `# Summary`, `# Examples`, and `# Notes` sections at module level.
|
||||
3. Use `Args:`, `Returns:`, `Raises:`, `Yields:`, `Notes:`, and `Example:`
|
||||
sections at function and method level.
|
||||
4. Always update the matching `.pyi` stub alongside the `.py` implementation.
|
||||
|
||||
---
|
||||
|
||||
## `.pyi` stubs
|
||||
|
||||
Every module ships a matching `.pyi` stub kept in sync with the `.py`
|
||||
implementation. When signatures change, update both files.
|
||||
|
||||
---
|
||||
|
||||
## Wiki pages
|
||||
|
||||
- Hand-written markdown lives in `docs/wiki/**` and is never generated.
|
||||
- File names use a numeric prefix: `01_overview.md`, `02_architecture.md`.
|
||||
- Nested directories become nested navigation groups:
|
||||
`05_development/01_environment.md` → group *Development*.
|
||||
- `index.md` is the site `Home` at the root, and a section root inside a
|
||||
directory.
|
||||
- Navigation labels are derived by stripping the numeric prefix and applying
|
||||
title case on the remaining words.
|
||||
1. Hand-written markdown lives in `docs/wiki/**` and is never generated.
|
||||
2. File names use a numeric prefix: `01_overview.md`, `02_components.md`.
|
||||
3. Nested directories become nested navigation groups:
|
||||
`05_development/01_environment.md` → group *Development*.
|
||||
4. `index.md` is the site `Home` at the root, and a section root inside a
|
||||
directory.
|
||||
5. Navigation labels are derived by stripping the numeric prefix and applying
|
||||
title case on the remaining words.
|
||||
|
||||
---
|
||||
|
||||
## Templates
|
||||
|
||||
MkDocs config fragments live in `docforge/templates`. The `mkdocs.wiki.yml`
|
||||
fragment carries only the `search` plugin, since wiki pages contain no
|
||||
mkdocstrings directives.
|
||||
mkdocstrings directives.
|
||||
|
||||
---
|
||||
|
||||
## Related
|
||||
- [02 – Components](02_components.md) · [04 – Iterative Workflow](04_iterative_workflow.md)
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
A docs build runs through the CLI in a single pass.
|
||||
|
||||
## Build commands
|
||||
---
|
||||
|
||||
## 🚀 Build commands
|
||||
|
||||
```bash
|
||||
# Library reference only
|
||||
@@ -18,7 +20,9 @@ doc-forge build --wiki --site-name docforge
|
||||
doc-forge build --mcp --module docforge
|
||||
```
|
||||
|
||||
## What a build does
|
||||
---
|
||||
|
||||
## 🔄 What a build does
|
||||
|
||||
1. Validates the requested modes (`--mkdocs`, `--api`, `--wiki`, `--mcp`).
|
||||
2. Generates library sources under `docs/lib/**` with `MkDocsRenderer`.
|
||||
@@ -29,7 +33,9 @@ doc-forge build --mcp --module docforge
|
||||
6. Runs `mkdocs build` once per config, emitting self-contained sites
|
||||
`site/lib/`, `site/api/`, and `site/wiki/`.
|
||||
|
||||
## Explore the sites
|
||||
---
|
||||
|
||||
## 🧭 Explore the sites
|
||||
|
||||
```bash
|
||||
doc-forge build --wiki --mkdocs --module docforge
|
||||
@@ -40,9 +46,16 @@ doc-forge serve --api
|
||||
doc-forge serve --mkdocs --mkdocs-yml docs/mkdocs.wiki.yml
|
||||
```
|
||||
|
||||
## Serve the MCP bundle
|
||||
---
|
||||
|
||||
## 📦 Serve the MCP bundle
|
||||
|
||||
```bash
|
||||
doc-forge build --mcp --module docforge
|
||||
doc-forge serve --mcp --module docforge
|
||||
```
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Related
|
||||
- [03 – Conventions](03_conventions.md) · [01 – Environment](05_development/01_environment.md)
|
||||
@@ -1,6 +1,8 @@
|
||||
# Environment Setup
|
||||
|
||||
## Create the environment
|
||||
---
|
||||
|
||||
## 🚀 Create the environment
|
||||
|
||||
```bash
|
||||
python -m venv .venv
|
||||
@@ -10,7 +12,9 @@ pip install -e .
|
||||
|
||||
Requires Python 3.10+ (per `pyproject.toml`).
|
||||
|
||||
## Dependencies
|
||||
---
|
||||
|
||||
## 📦 Dependencies
|
||||
|
||||
Development extras include:
|
||||
|
||||
@@ -18,4 +22,9 @@ Development extras include:
|
||||
- `ruff` — lint and format checking
|
||||
- `black` — auto-formatting
|
||||
- `mypy` — strict typing checks
|
||||
- `pydoclint` — docstring ↔ signature consistency checks
|
||||
- `pydoclint` — docstring ↔ signature consistency checks
|
||||
|
||||
---
|
||||
|
||||
## Related
|
||||
- [04 – Iterative Workflow](../04_iterative_workflow.md) · [02 – Quality Gates](02_quality_gates.md)
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
Run all checks before pushing:
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Commands
|
||||
|
||||
```bash
|
||||
.venv\Scripts\python.exe -m pytest
|
||||
.venv\Scripts\python.exe -m ruff check docforge tests
|
||||
@@ -10,7 +14,9 @@ Run all checks before pushing:
|
||||
.venv\Scripts\pydoclint.exe docforge
|
||||
```
|
||||
|
||||
## Test layout
|
||||
---
|
||||
|
||||
## 📁 Test layout
|
||||
|
||||
| Path | Covers |
|
||||
|--------------------------|------------------------------------|
|
||||
@@ -20,4 +26,9 @@ Run all checks before pushing:
|
||||
|
||||
CLI tests use the `cli_runner` fixture with `mock_mkdocs_build` and
|
||||
`mock_mkdocs_load_config` so they exercise the full flow without invoking a
|
||||
real MkDocs build.
|
||||
real MkDocs build.
|
||||
|
||||
---
|
||||
|
||||
## Related
|
||||
- [01 – Environment](01_environment.md) · [03 – GSDFC Guide](03_gsdfc_guide.md)
|
||||
@@ -5,7 +5,9 @@ in the `docforge/__init__.py` package docstring. It describes how to write
|
||||
docstrings that render correctly in MkDocs and stay machine-parseable by
|
||||
doc-forge, MkDocs, and MCP clients.
|
||||
|
||||
## Overview
|
||||
---
|
||||
|
||||
## 🧭 Overview
|
||||
|
||||
- Docstrings are the single source of truth.
|
||||
- `doc-forge` compiles docstrings but never rewrites them.
|
||||
@@ -13,7 +15,9 @@ doc-forge, MkDocs, and MCP clients.
|
||||
- Type hints live in signatures; prose entries repeat the type in
|
||||
parentheses and must match the signature.
|
||||
|
||||
## Module docstrings
|
||||
---
|
||||
|
||||
## 📦 Module docstrings
|
||||
|
||||
Modules use Markdown headings and `---` separators.
|
||||
|
||||
@@ -23,7 +27,9 @@ Recommended sections:
|
||||
- `# Examples` — a representative usage snippet
|
||||
- `# Notes` — guarantees, lifecycle, and thread-safety notes
|
||||
|
||||
## Class docstrings
|
||||
---
|
||||
|
||||
## 📦 Class docstrings
|
||||
|
||||
Recommended sections, in order:
|
||||
|
||||
@@ -32,7 +38,9 @@ Recommended sections, in order:
|
||||
- `Notes:` — grouped subsections such as **Guarantees**, **Lifecycle**
|
||||
- `Example:` — indented `python` code block
|
||||
|
||||
## Function and method docstrings
|
||||
---
|
||||
|
||||
## 📦 Function and method docstrings
|
||||
|
||||
Recommended section order:
|
||||
|
||||
@@ -53,12 +61,16 @@ Formatting rules:
|
||||
- Fenced `python` blocks are allowed inside `Example:` sections, indented
|
||||
four spaces.
|
||||
|
||||
## Property docstrings
|
||||
---
|
||||
|
||||
## 📦 Property docstrings
|
||||
|
||||
Properties document their return values with a `Returns:` section and, when
|
||||
meaningful, an `Example:`.
|
||||
|
||||
## Example
|
||||
---
|
||||
|
||||
## 🚀 Example
|
||||
|
||||
```python
|
||||
def process(foo: Foo, multiplier: int) -> int:
|
||||
@@ -90,13 +102,17 @@ def process(foo: Foo, multiplier: int) -> int:
|
||||
"""
|
||||
```
|
||||
|
||||
## Keeping stubs in sync
|
||||
---
|
||||
|
||||
## 🔄 Keeping stubs in sync
|
||||
|
||||
Every `.py` module ships a matching `.pyi` stub. When a signature or a public
|
||||
symbol changes, update both files. Signature annotations in the stub must
|
||||
match the implementation.
|
||||
|
||||
## Enforcement
|
||||
---
|
||||
|
||||
## 🛡️ Enforcement
|
||||
|
||||
`pydoclint` (Google style) runs in CI and verifies that `Args:`/`Returns:`
|
||||
sections match function signatures, including types.
|
||||
@@ -105,4 +121,9 @@ sections match function signatures, including types.
|
||||
- `skip-checking-raises = true` — `Raises:` sections are descriptive and are
|
||||
not required to map to literal `raise` statements.
|
||||
- `check-class-attributes = false` — `Attributes:` sections document instance
|
||||
attributes without class-level annotations.
|
||||
attributes without class-level annotations.
|
||||
|
||||
---
|
||||
|
||||
## Related
|
||||
- [02 – Quality Gates](02_quality_gates.md) · [04 – MCP Guide](04_mcp_guide.md)
|
||||
@@ -5,7 +5,9 @@ GSDFC docstrings and serve that bundle over the Model Context Protocol (MCP).
|
||||
The bundle is self-contained: readers can derive the full API reference —
|
||||
signatures, docstrings, and structure — for the documented project.
|
||||
|
||||
## Building the bundle
|
||||
---
|
||||
|
||||
## 🚀 Building the bundle
|
||||
|
||||
```bash
|
||||
doc-forge build --mcp --module docforge
|
||||
@@ -17,7 +19,9 @@ This writes structured JSON into `docs/mcp/`:
|
||||
- `nav.json` — module list with `docs://modules/{module}` resource URIs
|
||||
- `modules/{dotted.path}.json` — per-module serialized documentation
|
||||
|
||||
## Serving the bundle
|
||||
---
|
||||
|
||||
## 🚀 Serving the bundle
|
||||
|
||||
```bash
|
||||
doc-forge serve --mcp --module docforge
|
||||
@@ -36,7 +40,9 @@ Missing resources are returned as structured error dictionaries rather than
|
||||
exceptions. The default transport is `streamable-http`; `stdio` and `sse` are
|
||||
supported via `MCPServer.run`.
|
||||
|
||||
## Bundle contents
|
||||
---
|
||||
|
||||
## 📦 Bundle contents
|
||||
|
||||
Each module resource contains:
|
||||
|
||||
@@ -48,4 +54,9 @@ Each module resource contains:
|
||||
Because the bundle is generated from docstrings, the quality of the bundle
|
||||
equals the quality of the project's GSDFC docstrings. For docforge itself,
|
||||
the GSDFC specification is carried in `modules/docforge.json` via the
|
||||
`docforge/__init__.py` package docstring, making the bundle self-documenting.
|
||||
`docforge/__init__.py` package docstring, making the bundle self-documenting.
|
||||
|
||||
---
|
||||
|
||||
## Related
|
||||
- [03 – GSDFC Guide](03_gsdfc_guide.md) · [05 – MkDocs Configs](05_mkdocs_configs.md)
|
||||
@@ -5,7 +5,9 @@ repo that documents kind `{kind}` carries a config at `docs/mkdocs.{kind}.yml`
|
||||
that sets `docs_dir` to the kind's source directory and `site_dir` to
|
||||
`../site/{kind}`.
|
||||
|
||||
## File wins
|
||||
---
|
||||
|
||||
## 📄 File wins
|
||||
|
||||
`docs/mkdocs.{kind}.yml` is a repo-owned file, not a build byproduct:
|
||||
|
||||
@@ -19,7 +21,9 @@ that sets `docs_dir` to the kind's source directory and `site_dir` to
|
||||
Because a present file is never rewritten, rerunning a build is a no-op for
|
||||
versioned configs: the working tree stays clean.
|
||||
|
||||
## Templates
|
||||
---
|
||||
|
||||
## 🧩 Templates
|
||||
|
||||
The built-in defaults live in `docforge/templates/`:
|
||||
|
||||
@@ -36,7 +40,9 @@ kind fragment, then filling in generation-time values (`site_name`,
|
||||
theme `icon` from `docforge.nav.yml`). Pass `--template <path>` to replace the
|
||||
built-in templates entirely.
|
||||
|
||||
## Supported layouts
|
||||
---
|
||||
|
||||
## 🏗️ Supported layouts
|
||||
|
||||
- **Per-kind config** — the standard layout; each kind builds to
|
||||
`site/{kind}` and is served under `/<repo>/{kind}/`.
|
||||
@@ -45,4 +51,9 @@ built-in templates entirely.
|
||||
doc-forge never reads or writes root `mkdocs.yml`; the docs service maps the
|
||||
kind to the root `site/` dir in this case.
|
||||
|
||||
Commit `docs/mkdocs.{kind}.yml` so served docs are reproducible from source.
|
||||
Commit `docs/mkdocs.{kind}.yml` so served docs are reproducible from source.
|
||||
|
||||
---
|
||||
|
||||
## Related
|
||||
- [04 – MCP Guide](04_mcp_guide.md)
|
||||
@@ -1,9 +1,10 @@
|
||||
# 🔨 docforge — Docstring-Driven Documentation Forge
|
||||
# 🧩 docforge — Docstring-Driven Documentation Forge
|
||||
|
||||
`docforge` is an internal documentation tool that generates reference
|
||||
documentation from Google-Styled Doc-Forge Convention (GSDFC) docstrings and
|
||||
assembles it into per-kind MkDocs sites, alongside hand-written wiki pages and
|
||||
OpenAPI-based API docs.
|
||||
`docforge` is an internal documentation tool that generates reference documentation from Google-Styled Doc-Forge Convention (GSDFC) docstrings and assembles it into per-kind MkDocs sites, alongside hand-written wiki pages and OpenAPI-based API docs.
|
||||
|
||||
> **Doc model:** this wiki is written for humans — how‑to guides, examples,
|
||||
> and testing recipes. The authoritative API contracts live in the code
|
||||
> (docstrings) and the machine‑readable bundle under `docs/mcp/`.
|
||||
|
||||
---
|
||||
|
||||
@@ -17,17 +18,28 @@ OpenAPI-based API docs.
|
||||
|
||||
---
|
||||
|
||||
## 📦 Installation
|
||||
|
||||
```bash
|
||||
# Internal PyPI (TBD)
|
||||
pip install docforge
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📁 Documentation Structure
|
||||
|
||||
| Section | Description |
|
||||
|----------------------------------------------| -------------------------------------------------- |
|
||||
| [Overview](01_overview.md) | What docforge is and how it fits the pipeline |
|
||||
| [Architecture](02_architecture.md) | Loaders, models, nav, renderers, CLI, servers |
|
||||
| [Components](02_components.md) | Loaders, models, nav, renderers, CLI, servers |
|
||||
| [Conventions](03_conventions.md) | GSDFC, `.pyi` stubs, and template conventions |
|
||||
| [Iterative Workflow](04_iterative_workflow.md) | How a docs build runs end to end |
|
||||
| [Development](05_development/01_environment.md) | Environment setup and quality gates |
|
||||
| [Docstring Guide](05_development/03_gsdfc_guide.md) | How to write GSDFC-conformant docstrings |
|
||||
| [Environment](05_development/01_environment.md) | Environment setup |
|
||||
| [Quality Gates](05_development/02_quality_gates.md) | Test layout and quality checks |
|
||||
| [GSDFC Guide](05_development/03_gsdfc_guide.md) | How to write GSDFC-conformant docstrings |
|
||||
| [MCP Guide](05_development/04_mcp_guide.md) | Building, serving, and consuming the MCP bundle |
|
||||
| [MkDocs Configs](05_development/05_mkdocs_configs.md) | MkDocs config generation and templates |
|
||||
|
||||
---
|
||||
|
||||
@@ -301,4 +313,4 @@ Verification checklist:
|
||||
````
|
||||
---
|
||||
|
||||
© Aetoskia Internal
|
||||
© Aetoskia Internal — `docforge` 1.0
|
||||
Reference in New Issue
Block a user