Flatten MkDocs Structure + --module-is-source Support
#4
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix-missing-index"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Merge Request: Flatten MkDocs Structure +
--module-is-sourceSupportSummary
This MR introduces structural improvements to the MkDocs generation pipeline to:
docs/index.mdalways existsdocs/<module>/nesting by default)--module-is-sourceto treat the module as the documentation rootdocforge.nav.yml) with the new flat layoutThis resolves static hosting issues (e.g., Nginx 403 due to missing
site/index.html) and makes each generated MkDocs site deployable as a standalone static website.Motivation
Previously, documentation was generated under:
Which resulted in:
When deployed at
/libs/<project>/, this caused:site/index.htmlThis MR corrects the architecture so each MkDocs build is a valid static site with a root entry point.
Key Changes
1️⃣ Flattened Docs Structure
Before
After
All documentation paths were updated accordingly:
docs/docforge/cli/...→docs/cli/...docs/docforge/models/...→docs/models/...docs/docforge/renderers/...→docs/renderers/...Navigation updated to match the flat layout.
2️⃣ Root Index Enforcement
MkDocsRenderernow guarantees:docs/index.mdis always createdindex.mdfiles are auto-generated if missingThis ensures:
Always exists after
mkdocs build.3️⃣ New CLI Flag:
--module-is-sourceAdded option:
Behavior:
Updated components:
cli.commands.buildmkdocs_utils.generate_sourcesMkDocsRenderer.generate_sources.pyi)4️⃣ Navigation Spec Update
docforge.nav.ymlupdated:Before
After
All group paths adjusted to remove
docforge/prefix.5️⃣ MkDocs Config Update
mkdocs.ymlupdated to:site_namebelow theme/pluginsindex.md6️⃣ MCP Artifact Regeneration
Updated:
module_is_source)Ensures MCP output matches updated API.
Architectural Outcome
Each project now produces a valid standalone static site:
Safe for deployment under:
No Nginx rewrites required.
No directory-index issues.
No nested-site ambiguity.
Backward Compatibility
--module-is-sourceis optionalDeployment Impact
After merge:
Testing
site/index.htmlResult
The documentation compiler now:
This aligns doc-forge with proper static-site architectural invariants.