Sphinx-based documentation using automation to scale with the growing number of test functions.
Automation over manual updates. Adding a new test function should not require editing documentation files. The docs regenerate from source code.
docs/
├── _generators/ # Python scripts that generate RST content
│ ├── generate_catalogs.py # Function tables by category
│ ├── generate_plots.py # Surface/contour plots for 2D functions
│ ├── generate_diagrams.py # Module structure diagrams
│ └── generate_all.py # Master script
├── source/
│ ├── _generated/ # Auto-generated content (gitignored)
│ │ ├── catalogs/ # Function tables as RST
│ │ ├── plots/ # PNG visualizations
│ │ └── diagrams/ # Architecture diagrams
│ ├── _templates/ # Custom autosummary templates
│ ├── api_reference/ # Uses autosummary (no manual per-function RST)
│ └── user_guide/ # Narrative docs with included generated tables
└── requirements.txt
| Content | Generator | Trigger |
|---|---|---|
| Function catalog tables | generate_catalogs.py |
Functions in __all__ |
| Surface/contour plots | generate_plots.py |
2D functions with n_dim=2 |
| Module hierarchy diagram | generate_diagrams.py |
Package structure |
| API reference pages | Sphinx autosummary | Docstrings |
| Function counts | conf.py |
Runtime introspection |
- Create the class in the appropriate module
- Add it to
__all__in the module's__init__.py - Run
make docs
The generators handle everything else: API page, catalog entry, plots (if 2D), count updates.
# Install dependencies
pip install -r docs/requirements.txt
# Full build (generate + sphinx)
make docs
# Just regenerate assets
make docs-generate
# Just sphinx (faster, uses cached generated content)
make docs-quick
# Clean all generated content
make docs-cleanManual (narrative, curated):
index.rst- Landing page structureuser_guide/*.rst- Tutorials and explanations (include generated tables via RST directives)examples/*.rst- Code examplesapi_reference/base.rst- Base class documentation
Generated (automated):
_generated/catalogs/*.rst- Function tables_generated/plots/*.png- Visualizations_generated/diagrams/*.rst- Architecture diagrams_templates/autosummary/stubs - Individual API pages
The current structure supports 100+ functions without documentation overhead:
- No per-function RST files: Autosummary generates API pages from docstrings
- Declarative registration: Add to
__all__, docs update automatically - Cached plot generation: Only regenerates when function source changes
- Grouped catalogs: Functions organized by category, avoiding endless lists
- Dynamic counts: All statistics derived from source at build time
| Type | Current | Target |
|---|---|---|
| Manual RST files | ~15 | <15 |
| Generated RST files | ~20+ | Scales with functions |
| Per-function effort | 0 min | 0 min |
Detailed specifications in /home/me/github-workspace/999-private/project-planning/Surfaces/docs/:
001-documentation-strategy.md- Full strategy and rationale002-generator-specifications.md- Generator implementation details003-implementation-roadmap.md- Phased implementation plan