Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update build for new readthedocs addons #1207

Merged
merged 4 commits into from
Sep 5, 2024

Conversation

shiftinv
Copy link
Member

@shiftinv shiftinv commented Jul 18, 2024

Summary

See https://about.readthedocs.com/blog/2024/07/addons-by-default/.

There are technically two separate things going on, although the blog post really only highlights the first one:
tl;dr: many words, few changes.


1. readthedocs addons

(Re-)Implements the bottom-right flyout menu, plus a couple other things. See the repo and blog post.

  • Aims to be a replacement of the readthedocs-sphinx-ext extension that RTD injects into all projects1 at build-time; the extension is being deprecated
  • This is implemented at request-time (by inserting the addons script tag in a worker), not at build-time

There aren't many changes for us here in practice; compared to the build-time extension, mainly a couple minor visual updates of the flyout menu and version warning banners.
This now also leaves sphinx' search feature alone and doesn't patch it to use RTD's API, so manually setting docsearch_disabled on our end isn't required anymore.

Timeline

Can be enabled/disabled via a toggle in the dashboard, will be enabled for everyone in October.


2. conf.py changes

Previously, RTD would append a bunch of stuff to docs/conf.py at build time, which was rather annoying sometimes.

  • This inserted said extension, set html_baseurl, and inserted a bunch of values into the html_context for templates

Not many changes here either; we already set html_baseurl, and the only context value used in templates was READTHEDOCS, which I've added again.

Timeline

Not entirely clear atp. This can't be toggled via the dashboard, and will just happen at some point.
From a couple comments I've read, this is slated to be applied to new projects in ~two weeks, and will be enabled for everyone in October as well, but is still technically independent of the addons rollout.

update: diff of old/new context here


Issues

  1. readthedocs addons
  2. conf.py changes
    • It's not clear how readthedocs plans to support htmlzip without build-time context injection. Simulating the new behavior results in broken htmlzip builds (since their builder calls something implemented by the extension, which isn't being added anymore with this), but ultimately that's up to them to fix.

Checklist

  • If code changes were made, then they have been tested
    • I have updated the documentation to reflect the changes
    • I have formatted the code properly by running pdm lint
    • I have type-checked the code by running pdm pyright
  • This PR fixes an issue
  • This PR adds something new (e.g. new method or parameters)
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

Footnotes

  1. except those using a custom build.commands config

@shiftinv shiftinv added t: documentation Improvements or additions to documentation/examples s: in progress Issue/PR is being worked on skip news needs backport: 2.9 labels Jul 18, 2024
@shiftinv shiftinv added this to the disnake v2.10 milestone Jul 18, 2024
@shiftinv shiftinv marked this pull request as draft July 18, 2024 19:07
@shiftinv shiftinv marked this pull request as ready for review September 5, 2024 12:50
@shiftinv shiftinv force-pushed the docs/readthedocs-context-deprecation branch from 1f3cdb4 to 3d55dd3 Compare September 5, 2024 12:56
@shiftinv shiftinv merged commit 4a5475c into master Sep 5, 2024
28 checks passed
@shiftinv shiftinv deleted the docs/readthedocs-context-deprecation branch September 5, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: in progress Issue/PR is being worked on skip news t: documentation Improvements or additions to documentation/examples
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant