mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Sean Lyon <sean@seanlyon.dev>
Cc: Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sean Lyon <sean@seanlyon.dev>
Subject: Re: [PATCH] docs: conf.py: register sphinx_rtd_theme as an extension
Date: Wed, 25 Nov 2026 08:29:20 -0700	[thread overview]
Message-ID: <87y0ahx73j.fsf@trenco.lwn.net> (raw)
In-Reply-To: <20261119195117.32709-1-sean@seanlyon.dev>

Sean Lyon <sean@seanlyon.dev> writes:

> The sphinx_rtd_theme sidebar has collapsible sections. The theme uses
> jQuery to add the toctree-expand buttons that control them.
>
> Sphinx 6 stopped bundling jQuery. Since sphinx_rtd_theme 1.2.0, the
> theme's setup() enables the sphinxcontrib-jquery extension to load it,
> but setup() does not run when the theme is loaded through
> html_theme_path. Without jQuery, the buttons are never added, so sidebar
> sections cannot be collapsed.
>
> Register sphinx_rtd_theme as an extension so its setup() runs. The
> setup() also registers the theme, so html_theme_path is no longer
> needed, and sphinx_rtd_theme 3.0 warns that it is deprecated.
>
> Signed-off-by: Sean Lyon <sean@seanlyon.dev>
> ---
> Note for testers: with Sphinx >= 8.1, some pages (e.g. core-api/) expand
> more than one sidebar section. This also happens without this patch. It
> comes from documents included in multiple toctrees. Sphinx warns about
> these documents, but the warnings are only shown with make V=1 htmldocs.
> I'm looking into this separately and plan to send an RFC.
>
> Tested with sphinx_rtd_theme 3.1.0 and sphinx_rtd_dark_mode 1.3.0 on
> Sphinx 9.2.0, and on min_requirements.txt with sphinx_rtd_theme 1.3.0.
> No new build warnings, and the get_html_theme_path deprecation warning
> is gone.

Just to be clear, which versions of Sphinx have you tested this with?

Thanks,

jon

      reply	other threads:[~2026-11-25 15:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 19:51 Sean Lyon
2026-11-25 15:29 ` Jonathan Corbet [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y0ahx73j.fsf@trenco.lwn.net \
    --to=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=sean@seanlyon.dev \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®