sphinx 升级到6.x后的Jquery问题
创始人
2024-05-25 12:54:17
0

sphinx 升级到6.0 后,以前对于jquery的默认引用方式发生了改变

以前在编译后的html中jquery是如下引用的:

而升级到6.0后,对于jquery 是一个googleapi的远程jquery调用,这会导致sphinx 半天才能打开。

解决这个问题的方案是:

升级所有的包,包括sphinxcontrib-jquery,然后进行争取的配置。

在sphinx 的changelog中对于这点有明确的说明:

#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 yourJavaScript to modern standards, or use the mitigation below.
The first option is to use the sphinxcontrib.jquery extension, which has been developed by the Sphinx team and contributors. To use this, addsphinxcontrib.jquery to the extensions list in conf.py, or callapp.setup_extension("sphinxcontrib.jquery") if you develop a Sphinx themeor extension.
The second option is to manually ensure that the frameworks are present.To re-add jQuery and underscore.js, you will need to copy jquery.js andunderscore.js from the Sphinx repository to your static directory,and add the following to your layout.html:
{%- block scripts %}{{ super() }}
{%- endblock %}

原文地址:https://www.sphinx-doc.org/en/master/changes.html

相关内容

热门资讯

监控摄像头接入GB28181平... 流程简介将监控摄像头的视频在网站和APP中直播,要解决的几个问题是:1&...
Windows10添加群晖磁盘... 在使用群晖NAS时,我们需要通过本地映射的方式把NAS映射成本地的一块磁盘使用。 通过...
protocol buffer... 目录 目录 什么是protocol buffer 1.protobuf 1.1安装  1.2使用...
在Word、WPS中插入AxM... 引言 我最近需要写一些文章,在排版时发现AxMath插入的公式竟然会导致行间距异常&#...
修复 爱普生 EPSON L4... L4151 L4153 L4156 L4158 L4163 L4165 L4166 L4168 L4...
【PdgCntEditor】解... 一、问题背景 大部分的图书对应的PDF,目录中的页码并非PDF中直接索引的页码...
Fluent中创建监测点 1 概述某些仿真问题,需要创建监测点,用于获取空间定点的数据࿰...
educoder数据结构与算法...                                                   ...
MySQL下载和安装(Wind... 前言:刚换了一台电脑,里面所有东西都需要重新配置,习惯了所...
MFC文件操作  MFC提供了一个文件操作的基类CFile,这个类提供了一个没有缓存的二进制格式的磁盘...