Title: Sphinx linkcheck and broken/redirect occurrences in Python Docs · Issue #103484 · python/cpython · GitHub
Open Graph Title: Sphinx linkcheck and broken/redirect occurrences in Python Docs · Issue #103484 · python/cpython
X Title: Sphinx linkcheck and broken/redirect occurrences in Python Docs · Issue #103484 · python/cpython
Description: Running make linkcheck in Doc folder outputs thousands of broken and redirected status. It would be nice to clean this up so we can link-check Python in CI/CD for each commit, but right now it is too polluted. Some of these occurrences c...
Open Graph Description: Running make linkcheck in Doc folder outputs thousands of broken and redirected status. It would be nice to clean this up so we can link-check Python in CI/CD for each commit, but right now it is t...
X Description: Running make linkcheck in Doc folder outputs thousands of broken and redirected status. It would be nice to clean this up so we can link-check Python in CI/CD for each commit, but right now it is t...
Opengraph URL: https://github.com/python/cpython/issues/103484
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sphinx linkcheck and broken/redirect occurrences in Python Docs","articleBody":"Running `make linkcheck` in Doc folder outputs thousands of broken and redirected status. It would be nice to clean this up so we can link-check Python in CI/CD for each commit, but right now it is too polluted.\r\n\r\nSome of these occurrences could/should be fixed in the docs itself, others can benefit from [Sphinx's linkcheck configs](https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-the-linkcheck-builder) e.g. `linkcheck_ignore` and `linkcheck_allow_redirect`.\r\n\r\nSee [linkcheck-log.txt](https://github.com/python/cpython/files/11215133/linkcheck-log.txt) for the full log as of commit f2b7ecb.\r\n\r\nFun stats obtained from the above file:\r\n- Of its 8327 lines, where 7824 are related to BPO -\u003e GH issues. Of 7824, 5744 lines are from whatsnew/changelog and only 20 are not from whatsnew/\r\n- 241 lines are redirection of CPython CVS URL, fixing /tree/ to /blob/ in GitHub URL\r\n- 28 lines are broken links, where one broken link is 'https://' from an example in whatsnet/changelog\r\n\r\nThe way I see, this steps divide in:\r\n- Clean BPO to GH redirection messages\r\n- Fix broken links\r\n- Clean CPython CVS URL redirections\r\n- Clean GH issues to GH PR redirections\r\n- Fix the rest of the occurrences.\r\n\r\nlinkcheck_allow_redirect and linkcheck_ignore can be very handy in this case. linkcheck_allow_redirect makes 'ok' status a redirect that is being spotted by linkcheck, and we have linkcheck_ignore as the last resource.\r\n\r\nQuestions I have before implementing the solution:\r\n* Documentation hosted by Read The Docs may have language enabled so example.com is redirected to example.com/en/latest. To handle occurrences, I could add them to linkcheck_allow_redirect or we can use [sphinx-ext-intersphinx](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html) to map a keyword to the documentation URL (e.g 'rtd' for read-the-docs docs). The last option allows to map to proper language of the target URL linked, similar on how [Weblate did](https://github.com/WeblateOrg/weblate/blob/main/docs/conf.py#L213))\r\n- Is there any restrictions to fix broken/redirect links in old whatsnew/\u003crelease\u003e.rst?\r\n- Is there any restrictions to fix broken/redirect links in old whatsnew/changelog.rst (i.e. Misc/NEWS)?\r\n- Should I create a single Pull Request for all the fixes?\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-103569\n* gh-103602\n* gh-103608\n* gh-103683\n* gh-104001\n* gh-104088\n* gh-123019\n* gh-124136\n* gh-124137\n* gh-124144\n* gh-124151\n* gh-124152\n* gh-124169\n* gh-124179\n* gh-124180\n* gh-124183\n* gh-140012\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/rffontenelle","@type":"Person","name":"rffontenelle"},"datePublished":"2023-04-12T19:27:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":30},"url":"https://github.com/103484/cpython/issues/103484"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c63a78f6-fb59-1e5a-f0c8-2fe62b291934 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A810:37C592:F5B143:1474EA5:69699294 |
| html-safe-nonce | d1f9a51b0743a2014680ccbaf32657394d3a827f21bc9e8a42cd38386317aa0f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODEwOjM3QzU5MjpGNUIxNDM6MTQ3NEVBNTo2OTY5OTI5NCIsInZpc2l0b3JfaWQiOiI0NDYwNTc3NzEwNTM0MTM2NDY4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9bebab86f4f83e6a54fea73199ebe0febd615d629db4be3206e519bbc325cd0c |
| hovercard-subject-tag | issue:1665121010 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/103484/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ef2855651690d1da6e52acb8228664102b551c0d4ae647762c106c48a681382d/python/cpython/issues/103484 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ef2855651690d1da6e52acb8228664102b551c0d4ae647762c106c48a681382d/python/cpython/issues/103484 |
| og:image:alt | Running make linkcheck in Doc folder outputs thousands of broken and redirected status. It would be nice to clean this up so we can link-check Python in CI/CD for each commit, but right now it is t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rffontenelle |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | af80af7cc9e3de9c336f18b208a600950a3c187c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width