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

如何配置使index.html的toctree仅显示Dialogs page单个条目?

解决toctree仅显示父条目问题

问题根源在于dlg.md中的toctree没有添加:hidden:参数,导致Sphinx会将其内部的子条目向上暴露给上层(index.md)的toctree,即使你在index里设置了maxdepth:1,也会把所有子节点拉平显示在同一层级。

只需修改dlg.md的toctree配置,加上:hidden:选项:

```{toctree}
:maxdepth: 1
:hidden:
dlg/about/index
dlg/advanced/index
dlg/advanced_filter/index
... (more entries)
Dialogs page
添加`:hidden:`后,`dlg.html`仍会正常显示所有子条目,而`index.html`的toctree只会显示**Dialogs page**这一个父条目,不会展开任何子节点。同时保持`index.md`的toctree配置不变即可:

```md
```{toctree}
:maxdepth: 1
dlg
内容的提问来源于stack exchange,提问作者MakotoE
相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.18 10:19:56