docs: output generated sources under docs/lib and docs/mcp

This commit is contained in:
2026-09-10 21:11:30 +05:30
parent d4b79cf95a
commit a1c5f046d4
6 changed files with 26 additions and 16 deletions

View File

@@ -82,6 +82,7 @@ class MkDocsRenderer:
project: Project,
docs_dir: Path,
module_is_source: bool | None = None,
readme_dir: Path | None = None,
) -> None:
"""
Generate a `README.md` file from the root module docstring.
@@ -99,15 +100,20 @@ class MkDocsRenderer:
docs_dir (Path):
Directory containing generated documentation sources.
module_is_source (bool, optional):
module_is_source (Optional[bool]):
Whether the module is treated as the project source root.
readme_dir (Optional[Path]):
Directory where the generated README.md should be written.
Defaults to the parent of `docs_dir`.
"""
if not module_is_source:
# Future: support README generation per module
return
readme_path = docs_dir.parent / "README.md"
readme_root = readme_dir if readme_dir is not None else docs_dir.parent
readme_path = readme_root / "README.md"
root_module = None
for module in project.get_all_modules():