fix: resolve the two docutils ERRORs in the Sphinx build - #39
Merged
Conversation
Both were "Unexpected indentation" from malformed RST, confirmed by feeding the exact generated/cleaned docstring text through docutils.core.publish_doctree in isolation before and after each fix: - gat.registry.plot_function: the Example section's code wasn't marked as an RST literal block, so the doubly-indented `...` line broke paragraph parsing. Added the `::` marker. - `gat project scenario add` CLI help: the bullet list right after "For Sienna scenarios:" had no blank line separating it from the preceding paragraph, which is required for RST to recognize it as a list rather than a paragraph continuation. Verified with a full `sphinx-build -b html docs/source docs/build/html` -- zero ERROR lines remain (down from 2), no new warnings introduced.
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.
Closes #3.
Root causes (confirmed, not guessed)
Reproduced both by extracting the exact post-processing text (Napoleon-rendered RST for the docstring,
inspect.cleandoc-dedented text for the CLI help) and feeding it throughdocutils.core.publish_doctreein isolation -- confirmed each error, applied the fix, re-ran to confirm clean.gat.registry.plot_functiondocstring (src/gat/registry/__init__.py): theExample:section's code sample wasn't marked as an RST literal block. Napoleon passes the section body through mostly as-is, so@plot_function(...)/def ...:formed a plain paragraph, and the further-indented...line broke paragraph parsing. Added a::marker so it's a proper literal block.gat project scenario addCLI help (src/gat/cli_projects_v1.py): the bullet list under "For Sienna scenarios:" had no blank line separating it from that heading paragraph -- required for RST to recognize the-lines as a list rather than a continuation of the paragraph. Added the blank line.Verification
sphinx-build -b html docs/source docs/build/html: 0ERRORlines (down from 2); no new warnings introduced by either changeblack --check/ruff checkon both touched files: cleanpytest -k "registry or cli": 3 passed🤖 Generated with Claude Code