Sphinx setup for MCGrad #18
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Sphinx Documentation Setup
Summary
This PR adds Sphinx-based API documentation for MCGrad, following the same pattern as the Ax repository. The project now uses a dual documentation system:
This approach provides:
What Changed
New Files
sphinx/- Complete Sphinx documentation setupsource/conf.py- Sphinx configuration with autodoc, Napoleon (Google-style docstrings), type hintssource/index.rst- Main documentation entry pointsource/api/*.rst- Simple RST files for each module (usingautomoduledirective)Makefile- Build commandsrequirements.txt- Sphinx dependenciesREADME.md- Documentation for working with Sphinx.readthedocs.yaml- ReadTheDocs configuration (auto-detected when importing project)scripts/test_docs.sh- Automated test script for both Sphinx and Docusaurus buildsDOCUMENTATION_TESTING.md- Comprehensive guide for testing and validating documentationModified Files
.github/workflows/main.yaml- Addedsphinxjob to build and validate Sphinx docs on every pushwebsite/docusaurus.config.js- Added "API Reference" link in navbar pointing to ReadTheDocsREADME.md- Updated documentation section to explain dual documentation system.gitignore- Added Sphinx build artifacts (sphinx/build/,*.doctrees,.buildinfo)Testing the Documentation
Quick Test (Both Systems)
Run the automated test script: