feat: build each doc kind with its own MkDocs config and site

This commit is contained in:
2026-09-12 14:23:22 +05:30
parent 582b6809a0
commit 2ae96f58de
21 changed files with 942 additions and 443 deletions

View File

@@ -8,7 +8,7 @@ A docs build runs through the CLI in a single pass.
# Library reference only
doc-forge build --mkdocs --module docforge
# Wiki + library combined (single MkDocs build)
# Wiki + library (each an independent MkDocs build)
doc-forge build --wiki --mkdocs --module docforge
# Wiki only — no module required
@@ -18,21 +18,26 @@ doc-forge build --wiki --site-name docforge
doc-forge build --mcp --module docforge
```
## What a combined build does
## What a build does
1. Validates the requested modes (`--mkdocs`, `--api`, `--wiki`, `--mcp`).
2. Generates library sources under `docs/lib/**` with `MkDocsRenderer`.
3. Generates API sources under `docs/api/**` when `--api` is given.
4. Derives wiki navigation from `docs/wiki/**`.
5. Writes `mkdocs.yml` with merged navigation — wiki first, generated groups
appended, and the wiki `Home` replacing any spec `Home` entry.
6. Runs `mkdocs build` once and emits the site.
4. Derives the wiki navigation from `docs/wiki/**`.
5. Writes one MkDocs config per site kind (`docs/mkdocs.{lib,api,wiki}.yml`),
re-rooting navigation paths to each kind's `docs_dir`.
6. Runs `mkdocs build` once per config, emitting self-contained sites
`site/lib/`, `site/api/`, and `site/wiki/`.
## Explore the site
## Explore the sites
```bash
doc-forge build --wiki --mkdocs --module docforge
doc-forge serve --mkdocs --mkdocs-yml mkdocs.yml
doc-forge serve --wiki # serves site preview from docs/mkdocs.wiki.yml
doc-forge serve --lib
doc-forge serve --api
# or target any config directly:
doc-forge serve --mkdocs --mkdocs-yml docs/mkdocs.wiki.yml
```
## Serve the MCP bundle