From e63a96410888ab279fe401d8820dd1eec7e56a3e Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 21 Jul 2026 20:54:19 +0000 Subject: [PATCH] fix: render TOC hyperlinks as simple references for PyPI The TOC generator emitted self-referential indirect hyperlink targets (`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 Claude-Session: https://claude.ai/code/session_01PvMnQEiprU5XKUHukXEpAJ --- README.rst | 62 +++++++++++++++++++++--------------------- generate-readme-toc.js | 2 +- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/README.rst b/README.rst index 9207baa3..948a6443 100644 --- a/README.rst +++ b/README.rst @@ -29,67 +29,67 @@ accurate and fully typed. Contents -------- -* `Installation `_ +* `Installation`_ -* `Usage `_ +* `Usage`_ - * `Examples `_ + * `Examples`_ - * `List devices `_ + * `List devices`_ - * `Unlock a door `_ + * `Unlock a door`_ - * `Authentication Method `_ + * `Authentication Method`_ - * `API Key `_ + * `API Key`_ - * `Personal Access Token `_ + * `Personal Access Token`_ - * `Action Attempts `_ + * `Action Attempts`_ - * `Pagination `_ + * `Pagination`_ - * `Manually fetch pages with the nextPageCursor `_ + * `Manually fetch pages with the nextPageCursor`_ - * `Resume pagination `_ + * `Resume pagination`_ - * `Iterate over all resources `_ + * `Iterate over all resources`_ - * `Return all resources across all pages as a list `_ + * `Return all resources across all pages as a list`_ - * `Interacting with Multiple Workspaces `_ + * `Interacting with Multiple Workspaces`_ - * `Webhooks `_ + * `Webhooks`_ - * `Advanced Usage `_ + * `Advanced Usage`_ - * `Setting the endpoint `_ + * `Setting the endpoint`_ -* `Development and Testing `_ +* `Development and Testing`_ - * `Quickstart `_ + * `Quickstart`_ - * `Source Code `_ + * `Source Code`_ - * `Requirements `_ + * `Requirements`_ - * `Tests `_ + * `Tests`_ - * `Publishing `_ + * `Publishing`_ - * `Automatic `_ + * `Automatic`_ - * `Manual `_ + * `Manual`_ -* `GitHub Actions `_ +* `GitHub Actions`_ - * `Secrets for Optional GitHub Actions `_ + * `Secrets for Optional GitHub Actions`_ -* `Contributing `_ +* `Contributing`_ -* `License `_ +* `License`_ -* `Warranty `_ +* `Warranty`_ Installation ------------ diff --git a/generate-readme-toc.js b/generate-readme-toc.js index 2a0968db..8aa08ef8 100644 --- a/generate-readme-toc.js +++ b/generate-readme-toc.js @@ -47,7 +47,7 @@ async function generateTableOfContents(content) { headings.forEach((heading) => { const indent = ' '.repeat(heading.level - 1) - toc.push(`${indent}* \`${heading.text} <${heading.text}_>\`_`) + toc.push(`${indent}* \`${heading.text}\`_`) toc.push('') })