编辑:this other post似乎相关
我正在使用fulltoc扩展在侧边栏中显示目录。
全局目录在全局 index.rst 文件中定义。toctree
它实际上基本上是由一系列s组成的:
.. toctree::
:caption: Getting Started
gettingStarted/overview
gettingStarted/section1
gettingStarted/section2
.. toctree::
:caption: Next Large section
group2/overview
group2/section1
group2/etc
包含每个部分的overview.rst
描述和随后部分的目录树。在文件夹中,gettingStarted
此文件如下所示:
Overview
========
This is a description of the section.
.. toctree::
section1
section2
问题是,在查看页面时gettingStarted/overview
,侧边栏会显示 sub-toc,这会产生多余的条目:
入门
- 概述
- 第 1 节
- 第2节
- 第 1 节
- 第2节
我宁愿在哪里
入门
- 概述
- 第 1 节
- 第2节
一种解决方法是降低:maxdepth:
,但是当从一个部分(例如gettingStarted/section1)读取时,侧边栏不会展开子部分。
我还找到了该rubric
指令,但无法弄清楚如何使其在toctree
.
如何防止子目录被索引到全局目录中?