python-sphinx - 狮身人面像雪花石膏主题目录未显示在所有页面中
问题描述
我试图让 TOC 出现在我的所有页面中。我的设置非常简单。在 index.rst 中,我有
Installation
============
Scripting
=========
.. toctree::
:maxdepth: 2
:caption: Contents:
class ASAT
""""""""""
.. toctree::
:maxdepth: 2
asat
more class ...
在其他页面中,我有:
class asat.SomeClass
"""""""""""""""""""""
.. autoclass:: modeule.SomeClass
:members:
.. automethod:: __init__
为了让 TOC 出现,我改为conf.py
反映:
html_sidebars = {
'**': [
'globaltoc.html',
'relations.html',
'searchbox.html'
]
}
但这样做时,index.rst
任何 TOC 中都不会出现任何嵌套内容。这是它的截图:
如何从雪花石膏中获取原始/正常 TOC 以显示在我的所有页面中?
解决方案
根据安装文档,您需要添加navigation.html
到设置中。
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html',
'searchbox.html',
'donate.html',
]
}
如果您使用的是 Alabaster 的变体,请查阅他们的文档。
编辑:
我刚刚注意到您的 reStructuredText 语法不正确。您需要缩进toctree
.
.. toctree::
:maxdepth: 2
:caption: Contents:
推荐阅读
- tsql - 如何使用声明语句更新表
- rabbitmq - 为什么 Android-Things 应用程序在新的 ConnectionFactory 上崩溃
- sql - 在 CTE 查询中,根据检索到的第一个表 ID 计算另一个表中的记录
- python - 从 PyCharm 安装 pandas - 如何应用正确的约定,然后有哪些步骤?
- python - 从 Cosmos DB 查询时延续令牌出现问题
- javascript - JS 事件冒泡防止复选框选中状态
- content-management-system - umbraco 如何找到它的索引?Umbraco 8.0
- r - 如何循环日期和时间
- java - 如何在字符串数组中提取和存储其中的文本
标签中没有 html 代码(即等)
- json - Scala:一个泛型的classOf