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:
@@ -7,6 +7,13 @@ This module defines the `Module` class used in the doc-forge documentation
|
||||
model. A `Module` acts as a container for top-level documented objects
|
||||
(classes, functions, variables, and other members) discovered during
|
||||
introspection.
|
||||
|
||||
---
|
||||
|
||||
Notes:
|
||||
- Only public members are stored; private names are filtered by the loader.
|
||||
|
||||
---
|
||||
"""
|
||||
|
||||
from collections.abc import Iterable
|
||||
@@ -26,10 +33,10 @@ class Module:
|
||||
path (str):
|
||||
Dotted import path of the module.
|
||||
|
||||
docstring (Optional[str]):
|
||||
docstring (str | None):
|
||||
Module-level documentation string, if present.
|
||||
|
||||
members (Dict[str, DocObject]):
|
||||
members (dict[str, DocObject]):
|
||||
Mapping of object names to their corresponding `DocObject` representations.
|
||||
"""
|
||||
|
||||
@@ -45,7 +52,7 @@ class Module:
|
||||
path (str):
|
||||
Dotted import path identifying the module.
|
||||
|
||||
docstring (Optional[str]):
|
||||
docstring (str | None):
|
||||
Module-level documentation text, if available.
|
||||
"""
|
||||
self.path = path
|
||||
|
||||
@@ -7,6 +7,14 @@ This module defines the `DocObject` class, the fundamental recursive unit of
|
||||
the doc-forge documentation model. Each `DocObject` represents a Python
|
||||
entity such as a class, function, method, or attribute, and may contain nested
|
||||
members that form a hierarchical documentation structure.
|
||||
|
||||
---
|
||||
|
||||
Notes:
|
||||
- `DocObject` instances form a tree mirroring the Python import hierarchy.
|
||||
- Objects are renderer-agnostic and may be consumed by any renderer.
|
||||
|
||||
---
|
||||
"""
|
||||
|
||||
from collections.abc import Iterable
|
||||
@@ -30,13 +38,13 @@ class DocObject:
|
||||
path (str):
|
||||
Fully qualified dotted path to the object.
|
||||
|
||||
signature (Optional[str]):
|
||||
signature (str | None):
|
||||
Callable signature if the object represents a callable.
|
||||
|
||||
docstring (Optional[str]):
|
||||
docstring (str | None):
|
||||
Raw docstring text extracted from the source code.
|
||||
|
||||
members (Dict[str, DocObject]):
|
||||
members (dict[str, DocObject]):
|
||||
Mapping of member names to child `DocObject` instances.
|
||||
"""
|
||||
|
||||
@@ -61,10 +69,10 @@ class DocObject:
|
||||
path (str):
|
||||
Fully qualified dotted path of the object.
|
||||
|
||||
signature (Optional[str]):
|
||||
signature (str | None):
|
||||
Callable signature if applicable.
|
||||
|
||||
docstring (Optional[str]):
|
||||
docstring (str | None):
|
||||
Documentation string associated with the object.
|
||||
"""
|
||||
self.name = name
|
||||
@@ -82,7 +90,8 @@ class DocObject:
|
||||
nested objects to their parent containers.
|
||||
|
||||
Args:
|
||||
obj: Documentation object to add as a member.
|
||||
obj (DocObject):
|
||||
Documentation object to add as a member.
|
||||
"""
|
||||
self.members[obj.name] = obj
|
||||
|
||||
|
||||
@@ -6,6 +6,14 @@ Documentation model representing a project.
|
||||
This module defines the `Project` class, the top-level container used by
|
||||
doc-forge to represent a documented codebase. A `Project` aggregates multiple
|
||||
modules and provides access to them through a unified interface.
|
||||
|
||||
---
|
||||
|
||||
Notes:
|
||||
- Modules are keyed by their dotted import path.
|
||||
- Objects are renderer-agnostic; the same model feeds every renderer.
|
||||
|
||||
---
|
||||
"""
|
||||
|
||||
from collections.abc import Iterable
|
||||
@@ -24,7 +32,7 @@ class Project:
|
||||
name (str):
|
||||
Name of the project.
|
||||
|
||||
modules (Dict[str, Module]):
|
||||
modules (dict[str, Module]):
|
||||
Mapping of module paths to `Module` instances.
|
||||
"""
|
||||
|
||||
@@ -35,6 +43,14 @@ class Project:
|
||||
Args:
|
||||
name (str):
|
||||
Name used to identify the documentation project.
|
||||
|
||||
Example:
|
||||
Create a project and register a module:
|
||||
|
||||
```python
|
||||
project = Project("mypackage")
|
||||
project.add_module(module)
|
||||
```
|
||||
"""
|
||||
self.name = name
|
||||
self.modules: dict[str, Module] = {}
|
||||
|
||||
Reference in New Issue
Block a user