You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Jupyter Book HTML渲染侧边栏目录无法展开/折叠问题求助

解决Jupyter Book 1.0侧边栏菜单无法展开/折叠的问题

核心问题定位

你的_toc.yml配置存在语法错误:parts下的标题键应为**caption(单数)**,而非captions(复数)。Jupyter Book的配置解析器无法识别复数形式的键,导致章节层级结构未被正确解析,侧边栏的展开/折叠功能因此失效。

修正后的_toc.yml配置

format: jb-book
root: intro
parts:
- caption: Mathematical Concepts  # 将captions改为caption
  chapters:
  - file: index_m
    sections:
    - file: Probability
    - file: linear_algebra
  - file: index_ul
    sections:
    - file: libraries

额外验证步骤

  • 确认index_m对应文件(如index_m.md)存在于项目目录,且路径与配置一致
  • 重新执行构建命令:jupyter-book build .,确保新配置生效
  • 清理旧构建产物(删除_build目录后重新构建),避免缓存干扰

内容的提问来源于stack exchange,提问作者Alexandre Benoit

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 08:49:49