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
相关产品推荐
相关产品推荐

