Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

switchers.js not compatible with Sphinx 6 / requires jQuery #159

Closed
@hugovk

Description

@hugovk
  1. Openhttps://docs.python.org/3.12/ and check the language and version switchers are shown in the header:

image

  1. Check the footer: "Created using Sphinx 4.5.0."
  2. Openhttps://docs.python.org/3.13/ and see the switchers are not shown:

image

  1. Check the footer: Created using Sphinx 6.2.0."
  2. Check the browser console:
switchers.js:168 Uncaught ReferenceError: $ is not defined    at switchers.js:168:3    at switchers.js:182:3

This is because Sphinx 6 removed jQuery:

#7405: Removed the jQuery and underscore.js JavaScript frameworks.

These frameworks are no longer be automatically injected into themes from Sphinx 6.0. If you develop a theme or extension that uses thejQuery,$, or$u global objects, you need to update your JavaScript to modern standards, or use the mitigation below.

https://www.sphinx-doc.org/en/master/changes.html#release-6-0-0-released-dec-29-2022 has a couple of options on how to re-add jQuery, but it would be better rewritehttps://github.com/python/docsbuild-scripts/blob/main/templates/switchers.js to use vanilla JavaScript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp