Skip to content

fix: RST table of contents link formatting blocking publish#583

Merged
razor-x merged 1 commit into
mainfrom
claude/pypi-description-render-error-k0p19o
Jul 21, 2026
Merged

fix: RST table of contents link formatting blocking publish#583
razor-x merged 1 commit into
mainfrom
claude/pypi-description-render-error-k0p19o

Conversation

@razor-x

@razor-x razor-x commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

This PR fixes the reStructuredText (RST) table of contents formatting in the README by removing redundant anchor text from internal links.

Key Changes

  • README.rst: Updated all table of contents links to use simplified RST reference syntax

    • Changed from \Text <Text_>`format to`Text`` format
    • This removes the explicit anchor target which is unnecessary when the link text matches the section heading
    • Affects 48 table of contents entries across all documentation sections
  • generate-readme-toc.js: Updated the TOC generation script to match the new format

    • Modified the template string to generate simplified links without redundant anchor text
    • Ensures future auto-generated TOCs will follow the same pattern

Implementation Details

The simplified RST link format \Text`is equivalent to the explicit format`Text <Text>`_` when the link text exactly matches the section heading. This change improves readability of the source documentation while maintaining identical rendering in the final output.

https://claude.ai/code/session_01PvMnQEiprU5XKUHukXEpAJ

The TOC generator emitted self-referential indirect hyperlink targets
(`Text <Text_>`_) for each entry. These collide with the identically
named implicit section targets, which newer docutils (used by PyPI's
readme_renderer) rejects with an ERROR, causing the long_description to
fail rendering and the PyPI upload to return HTTP 400.

Emit simple phrase references (`Text`_) that point directly at the
implicit section targets instead. Older docutils tolerated the previous
form, so local rstcheck passed while PyPI upload failed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PvMnQEiprU5XKUHukXEpAJ
@razor-x razor-x changed the title Fix RST table of contents link formatting fix: RST table of contents link formatting Jul 21, 2026
@razor-x razor-x changed the title fix: RST table of contents link formatting fix: RST table of contents link formatting blocking publish Jul 21, 2026
@razor-x
razor-x marked this pull request as ready for review July 21, 2026 20:59
@razor-x
razor-x requested a review from a team as a code owner July 21, 2026 20:59
@razor-x
razor-x merged commit 61b2173 into main Jul 21, 2026
18 checks passed
@razor-x
razor-x deleted the claude/pypi-description-render-error-k0p19o branch July 21, 2026 20:59
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.

2 participants