Skip to content

fix: resolve the two docutils ERRORs in the Sphinx build - #39

Merged
micahpw merged 1 commit into
mainfrom
fix/sphinx-docutils-errors
Aug 7, 2026
Merged

fix: resolve the two docutils ERRORs in the Sphinx build#39
micahpw merged 1 commit into
mainfrom
fix/sphinx-docutils-errors

Conversation

@micahpw

@micahpw micahpw commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

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 through docutils.core.publish_doctree in isolation -- confirmed each error, applied the fix, re-ran to confirm clean.

  1. gat.registry.plot_function docstring (src/gat/registry/__init__.py): the Example: 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.
  2. gat project scenario add CLI 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: 0 ERROR lines (down from 2); no new warnings introduced by either change
  • black --check / ruff check on both touched files: clean
  • pytest -k "registry or cli": 3 passed

🤖 Generated with Claude Code

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.
@micahpw
micahpw merged commit 5c590b1 into main Aug 7, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix docutils warnings in the Sphinx build

1 participant