Skip to content

Use canonical rfc-editor.org URL for the :rfc: role - #14662

Draft
sidsri14 wants to merge 3 commits into
sphinx-doc:masterfrom
sidsri14:rfc-canonical-url
Draft

Use canonical rfc-editor.org URL for the :rfc: role#14662
sidsri14 wants to merge 3 commits into
sphinx-doc:masterfrom
sidsri14:rfc-canonical-url

Conversation

@sidsri14

Copy link
Copy Markdown

Purpose

Change the default rfc_base_url so the :rfc: role links to the
canonical RFC Editor location
(https://www.rfc-editor.org/rfc/rfcNNNN.html) instead of
https://datatracker.ietf.org/doc/html/rfcNNNN.html.

RFCs are officially published at rfc-editor.org, and datatracker has started
emitting a canonical link to rfc-editor.org for its RFC HTML pages
(see ietf-tools/datatracker#11481), confirming the rfc-editor.org URLs as
canonical.

  • Changed the rfc_base_url default in sphinx/environment/__init__.py
  • Updated the affected URL assertions in tests/test_markup/test_markup.py
    and tests/test_builders/test_build_html_5_output.py
  • Added a CHANGES.rst entry and an AUTHORS.rst entry

Note: this only changes the default; users can still override
rfc_base_url explicitly.

References

Closes #14659

AI disclosure

This change was prepared with the assistance of Claude Code (Anthropic).
All changes were reviewed and verified locally before submission.

Change the default rfc_base_url to https://www.rfc-editor.org/rfc/ so
that RFC references link to the canonical location where RFCs are
officially published, instead of datatracker.ietf.org.
@holloway

holloway commented Aug 31, 2026

Copy link
Copy Markdown

fwiw the canonical RFC location is https://www.rfc-editor.org/info/rfcN/. Note the 'info' prefix, that this doesn't have a .html suffix, and it's got a trailing slash.

Routes like https://www.rfc-editor.org/rfc/rfc2324.html have an HTTP header canonical url of https://www.rfc-editor.org/info/rfc2324/ etc.

Point rfc_base_url at https://www.rfc-editor.org/info/ and build
rfcN/ links (no .html suffix, trailing slash) instead of relying on
docutils' rfc%d.html format, matching the canonical rfc-editor.org
location noted in review.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sidsri14

Copy link
Copy Markdown
Author

Done — thanks for the pointer, @holloway. I've switched to the canonical https://www.rfc-editor.org/info/rfcN/ format:

  • rfc_base_url now defaults to https://www.rfc-editor.org/info/
  • the role builds rfcN/ links (no .html, trailing slash) instead of relying on docutils' rfc%d.html format, e.g. :rfc:2324 → `https://www.rfc-editor.org/info/rfc2324/` and `:rfc:`2324#section-1https://www.rfc-editor.org/info/rfc2324/#section-1.

Tests updated and passing.

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.

Use canonical URL for RFCs

2 participants