updated docs strings and added README.md

This commit is contained in:
2026-03-08 17:59:55 +05:30
parent e8e16f3996
commit 8253c25928
37 changed files with 1091 additions and 834 deletions

View File

@@ -1,5 +1,7 @@
# docforge
# Summary
Renderer-agnostic Python documentation compiler that converts Python docstrings
into structured documentation for both humans (MkDocs) and machines (MCP / AI agents).
@@ -102,13 +104,13 @@ This architecture ensures deterministic documentation generation.
Typical flow:
Python package
|
Loader (static analysis)
|
Semantic model
|
Renderer
|
MkDocs site or MCP JSON
---
@@ -118,7 +120,7 @@ Typical flow:
GSDFC defines how docstrings must be written so they render correctly in MkDocs and remain machine-parsable by doc-forge and AI tooling.
- Docstrings are the single source of truth.
- doc-forge compiles docstrings but does not generate documentation content.
- `doc-forge` compiles docstrings but does not generate documentation content.
- Documentation follows the Python import hierarchy.
- Every public symbol should have a complete and accurate docstring.
@@ -130,34 +132,33 @@ GSDFC defines how docstrings must be written so they render correctly in MkDocs
- Use **Google-style structured sections** at class, function, and method level.
- Use type hints in signatures instead of duplicating types in prose.
- Write summaries in imperative form.
- Sections are separated by ```---```
- Sections are separated by `---`
---
## Notes subsection grouping
# Notes subsection grouping
- Group related information using labeled subsections.
Group related information using labeled subsections.
Example:
Notes Example:
Notes:
**Guarantees:**
Notes:
**Guarantees:**
- deterministic behavior
- deterministic behavior
**Lifecycle:**
**Lifecycle:**
- created during initialization
- reused across executions
- created during initialization
- reused across executions
**Thread safety:**
**Thread safety:**
- safe for concurrent reads
- safe for concurrent reads
---
## Example formatting
# Example formatting
- Use indentation for examples.
- Indent section contents using four spaces.
@@ -193,9 +194,10 @@ Avoid fenced code blocks inside structured sections.
---
## Separator rules
# Separator rules
Use horizontal separators only at docstring root level to separate sections:
```markdown
---
```
@@ -210,9 +212,9 @@ Do not use separators inside code sections.
---
## Package docstrings
# Package docstrings
- Package docstrings act as the documentation home page.
Package docstrings act as the documentation home page.
Recommended sections:
@@ -230,6 +232,8 @@ Example:
Package Doc String:
'''
# Summary
Foo-bar processing framework.
Provides tools for defining Foo objects and executing Bar pipelines.
@@ -260,9 +264,9 @@ Example:
---
## Module docstrings
# Module docstrings
- Module docstrings describe a subsystem.
Module docstrings describe a subsystem.
Recommended sections:
@@ -274,6 +278,8 @@ Example:
Module Doc String:
'''
# Summary
Foo execution subsystem.
Provides utilities for executing Foo objects through Bar stages.
@@ -297,9 +303,9 @@ Example:
---
## Class docstrings
# Class docstrings
- Class docstrings define object responsibility, lifecycle, and attributes.
Class docstrings define object responsibility, lifecycle, and attributes.
Recommended sections:
@@ -374,9 +380,9 @@ Example:
---
## Function and method docstrings
# Function and method docstrings
- Function docstrings define API contracts.
Function docstrings define API contracts.
Recommended sections:
@@ -466,9 +472,9 @@ Example:
---
## Property docstrings
# Property docstrings
- Properties must document return values.
Properties must document return values.
Example:
Property Doc String:
@@ -494,9 +500,9 @@ Example:
---
## Attribute documentation
# Attribute documentation
- Document attributes in class docstrings using Attributes:.
Document attributes in class docstrings using `Attributes:`.
Example:
Attribute Doc String:
@@ -516,7 +522,7 @@ Example:
---
## Parsing guarantees
# Parsing guarantees
GSDFC ensures doc-forge can deterministically extract: