使用 sphinx-bootstrap-theme 为 globaltoc 声明最大深度的正确方法是什么?

What's the right way to declare maximumdepth for the globaltoc using sphinx-bootstrap-theme?

我正在尝试 运行 sphinx-bootstrap-Ryan Romer 的主题,一切正常,但 globaltoc maximumdepth;我无法用一个不同的值来解决这个问题。

来自 conf.py

'globaltoc_depth': "3",

'globaltoc_includehidden': "true",

来自 theme.config

globaltoc_includehidden = true

navbar_fixed_top = false

不要在整数两边加上引号。这样做会将它们转换为字符串。见 theme-options for readme for sphinx-bootstrap-theme.

conf.py 中的正确值应该是:

"globaltoc_depth": 3,
"globaltoc_includehidden": "true",

奇怪的是,配置中的布尔值并不相同。如果你没有得到你想要的,请尝试更改为:

"globaltoc_includehidden": True,