当前位置: 首页 > news >正文

sphinx 升级到6.x后的Jquery问题

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

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

<script src="_static/jquery.js"></script>

而升级到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 %}<script src="{{ pathto('_static/jquery.js', resource=True) }}"></script><script src="{{ pathto('_static/underscore.js', resource=True) }}"></script>{{ super() }}
{%- endblock %}

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

http://www.lryc.cn/news/2770.html

相关文章:

  • NSSCTF Round#8 Basic
  • 多传感器融合定位十二-基于图优化的建图方法其一
  • RockChip MPP编码
  • 【学习笔记】NOIP暴零赛2
  • linux基本功系列之hostname实战
  • Easy-Es框架实践测试整理 基于ElasticSearch的ORM框架
  • 【数据结构】双向链表的模拟实现(无头)
  • vue自定义指令---处理加载图片失败时出现的碎图,onerror事件
  • 加盟管理系统挑选法则,看完不怕被坑!
  • alertmanager笔记
  • Android Jetpack组件之WorkManager后台任务管理的介绍与使用(二)
  • 【MySQL】第十七部分 约束
  • java ssm集装箱码头TOS系统调度模块的设计与实现
  • MS14-064(OLE远程代码执行漏洞复现)
  • 【C++深陷】之shared_ptr
  • SpringMVC中遇到的错误
  • 姿态估计端到端新方案 | DirectMHP:用于全范围角度2D多人头部姿势估计
  • jvm学习的核心(五)---垃圾回收算法和常见垃圾回收器
  • 亿级高并发电商项目-- 实战篇 --万达商城项目 二(Zookeeper、Docker、Dubbo-Admin等搭建工作
  • 【C#基础】 C# 数据类型总结
  • 格子玻尔兹曼法介绍
  • 活动星投票在时间的河流上造园分组怎么设置如何进行分组报名
  • c#小笔记本-基础
  • DamiCMS SQL注入分析
  • 图傅里叶变换的推导和理解
  • Java八股文(Java面试题)
  • java ssm idea高校图书借阅管理系统设计2z87z
  • 电脑重装系统注册表恢复方法
  • 信道建模(大尺度、小尺度、莱斯衰落、瑞利衰落、莱斯信道、瑞利信道)
  • 2022年12月电子学会Python等级考试试卷(四级)答案解析