docs: bring docforge docstrings and wiki to GSDFC standard
- fix GSDFC spec contradictions in __init__ docstring (parenthesized types, fenced-block rule) and sync generated README - rewrite docstrings across loaders, models, nav, servers, renderers, cli; sync .pyi stubs - add pydoclint (google style) gate to dev extras and pyproject config - fix mcp nav resources doc:// -> docs:// - refresh docs/lib and docs/mcp, drop stale docforge/ duplicate group - update wiki pages and add GSDFC + MCP guides under 05_development
This commit is contained in:
@@ -2,6 +2,15 @@
|
||||
# Summary
|
||||
|
||||
Utilities for working with MkDocs in the doc-forge CLI.
|
||||
|
||||
---
|
||||
|
||||
Notes:
|
||||
- A single generated `mkdocs.yml` serves lib, api, and wiki content with
|
||||
merged navigation. Wiki navigation, when enabled, precedes every other
|
||||
group and its `index.md` becomes the site `Home`.
|
||||
|
||||
---
|
||||
"""
|
||||
|
||||
import os
|
||||
@@ -44,14 +53,14 @@ def generate_sources(
|
||||
docs_dir (Path):
|
||||
Directory where the generated Markdown files will be written.
|
||||
|
||||
project_name (Optional[str]):
|
||||
project_name (str | None):
|
||||
Optional override for the project name used in documentation metadata.
|
||||
|
||||
module_is_source (Optional[bool]):
|
||||
module_is_source (bool | None):
|
||||
If True, treat the specified module directory as the project root
|
||||
rather than a nested module.
|
||||
|
||||
readme_dir (Optional[Path]):
|
||||
readme_dir (Path | None):
|
||||
Directory where the generated README.md should be written. If not
|
||||
provided, defaults to the parent of ``docs_dir``.
|
||||
"""
|
||||
@@ -105,7 +114,7 @@ def generate_config(
|
||||
nav_file (Path):
|
||||
Path to the `docforge.nav.yml` navigation specification.
|
||||
|
||||
template (Optional[Path]):
|
||||
template (Path | None):
|
||||
Optional path to a fully custom MkDocs configuration template.
|
||||
If not provided, built-in templates are merged; the provided
|
||||
template replaces the built-in templates entirely.
|
||||
@@ -116,19 +125,19 @@ def generate_config(
|
||||
site_name (str):
|
||||
Display name for the generated documentation site.
|
||||
|
||||
modes (Optional[Iterable[str]]):
|
||||
modes (Iterable[str] | None):
|
||||
Documentation modes to enable. Each mode contributes its own
|
||||
built-in template fragment (for example ``lib``, ``api``, or
|
||||
``wiki``), merged on top of the shared ``mkdocs.common.yml``
|
||||
template.
|
||||
|
||||
site_description (Optional[str]):
|
||||
site_description (str | None):
|
||||
Optional site description written into the configuration.
|
||||
|
||||
site_author (Optional[str]):
|
||||
site_author (str | None):
|
||||
Optional site author written into the configuration.
|
||||
|
||||
wiki_dir (Optional[Path]):
|
||||
wiki_dir (Path | None):
|
||||
Optional path to a hand-written wiki directory (for example
|
||||
``docs/wiki``). When provided, the site navigation is derived
|
||||
from the wiki file structure and placed before the navigation
|
||||
@@ -186,13 +195,13 @@ def _load_template(
|
||||
|
||||
When a custom template path is provided, it is used as-is. Otherwise the
|
||||
shared ``mkdocs.common.yml`` template is deep-merged with the fragments
|
||||
contributed by each enabled mode (``lib`` or ``api``).
|
||||
contributed by each enabled mode (``lib``, ``api``, or ``wiki``).
|
||||
|
||||
Args:
|
||||
template (Optional[Path]):
|
||||
template (Path | None):
|
||||
Optional fully custom template that replaces the built-ins.
|
||||
|
||||
modes (Optional[Iterable[str]]):
|
||||
modes (Iterable[str] | None):
|
||||
Documentation modes whose template fragments should be merged.
|
||||
|
||||
Returns:
|
||||
@@ -237,7 +246,8 @@ def _item_name(item: object) -> str:
|
||||
first key. This is used to deduplicate plugin and extension lists.
|
||||
|
||||
Args:
|
||||
item: List entry, either a string or a single-key mapping.
|
||||
item (object):
|
||||
List entry, either a string or a single-key mapping.
|
||||
|
||||
Returns:
|
||||
str:
|
||||
@@ -253,8 +263,10 @@ def _merge_list(base: list, added: list) -> list:
|
||||
Merge two lists, preserving order and dropping duplicates by name.
|
||||
|
||||
Args:
|
||||
base: Existing list entries.
|
||||
added: Entries to append when not already present.
|
||||
base (list):
|
||||
Existing list entries.
|
||||
added (list):
|
||||
Entries to append when not already present.
|
||||
|
||||
Returns:
|
||||
list:
|
||||
@@ -279,8 +291,10 @@ def _deep_merge(base: dict, part: dict) -> dict:
|
||||
the fragment override the base.
|
||||
|
||||
Args:
|
||||
base: Configuration being built up.
|
||||
part: Template fragment to merge into the base.
|
||||
base (dict):
|
||||
Configuration being built up.
|
||||
part (dict):
|
||||
Template fragment to merge into the base.
|
||||
|
||||
Returns:
|
||||
dict:
|
||||
|
||||
Reference in New Issue
Block a user