【发布时间】:2018-07-22 08:06:16
【问题描述】:
deindex.rst上没有问题,如下图:
但是,当我转到另一个页面时,在我的例子中是annotation-module.rst,边栏会选择并显示index 和annotation-module,如下所示:
但是,我只想激活 注释模块 页面并显示其子部分。
我的conf.py 仅通过查找READTHEDOCS 环境变量来使用html_theme,如下所示:
if not on_rtd: # only import and set the theme if we're building docs locally
try:
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
except Exception:
pass
我的index.rst:
Welcome to exceptive's documentation!
=====================================
.. toctree::
:maxdepth: 2
:caption: Contents:
index
annotation-module
Here I have some introductory text.
而annotation-module.rst 甚至不包括任何toctree,我只有它下面的部分。
那么,我如何只激活侧边栏上的当前文档部分?
Here是Steve Piercy要求的文档的源目录。
环境
- Python 3.5
- 狮身人面像 1.7.6
- sphinx-rtd-theme 0.4.0
【问题讨论】:
-
请发布一个MCVE,最好是一个repo,但至少是你的文档目录树和
conf.py、index.rst和annotation-module.rst的完整内容。 -
按要求添加了相关分支的目录。
标签: python python-sphinx sidebar read-the-docs toctree