Fix bugs in documentation build#849
Open
ehennestad wants to merge 9 commits into
Open
Conversation
Fixes bugs when rendering docs for generated classes
Speeds up the workflow by skipping Sphinx autodoc scanning of folders that aren't part of the published docs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Mirrors the same speedup applied to the GitHub Actions docs workflow. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…eline processDocstring used strsplit with default CollapseDelimiters=true, silently dropping blank lines between paragraphs in multiline schema docs. Combined with a one-space misalignment in fillConstructor's continuation prefix, this broke reST parsing for OnePhotonSeries and TwoPhotonSeries's data field docs and degraded plain `help` output. Regenerated the two affected generated files and removed the now-unnecessary reST reconstruction workaround from docstring_processors.py. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ehennestad
marked this pull request as ready for review
July 4, 2026 21:42
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #849 +/- ##
=======================================
Coverage 95.43% 95.43%
=======================================
Files 228 228
Lines 8064 8064
=======================================
Hits 7696 7696
Misses 368 368 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ehennestad
enabled auto-merge
July 5, 2026 18:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Problem — the Sphinx docs build has warnings, but nothing catches them: they don't fail CI, and they don't fail the production Read the Docs build. Broken heading structure, mis-rendered docstrings, and unlisted pages can ship straight to the published docs with no signal to anyone.
Solution — fix the current set of warnings, then make both CI and the production RTD build fail whenever a Sphinx warning appears, so future regressions are caught before merge instead of shipping silently.
What changed
untyped.rst(two subsections skipped a level)how_to_cite.rstas:orphan:— it's only reached via direct links, not a toctree, so Sphinx was warning that it's unreachable from navigation=or[)OnePhotonSeries/TwoPhotonSeriesdatafield warnings: the schema doc string for that field is valid reST as written, butfile.internal.processDocstringwas silently dropping the blank lines between its paragraphs while reflowing it into a MATLAB comment (defaultstrsplitbehavior), and a one-space indent mismatch infillConstructorthen broke the nested list alignment. Fixed both, and regenerated the two affected files.github/workflows/build_docs.yml: builds the docs on PRs/pushes touchingdocs/**or generated.mfiles, fails the job on any Sphinx warningfail_on_warning: trueto.readthedocs.yamlso the production RTD build also fails on warningsImplementation notes
Once the blank-line/indent bug above was fixed at the source, the docs-side workaround that had been reconstructing paragraph structure from the mangled text was no longer needed and was removed from
docstring_processors.py. That file now only contains the one remaining fix needed for auto-linked identifiers next to punctuation, which is unrelated to the blank-line issue.How to test
Run the Sphinx build with warnings treated as errors (
sphinx-build -b html -W --keep-going docs/source docs/build/html, after runningdocs/source/sphinx_extensions/copy_files.py) and confirm it succeeds with no warnings. The newBuild Sphinx docsCI check and the Read the Docs PR preview both do this automatically.Checklist
fix #XXwhereXXis the issue number?