【发布时间】:2022-01-18 01:17:00
【问题描述】:
我使用sphinx 和sphinx_rtd_theme 为我的包创建了一个以rtd 为主题的文档。 index.rst如下:
Welcome!
.. toctree::
:maxdepth: 1
:glob:
src
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
而src文件大致遵循这个思路:
================
Template Project
================
.. automodule:: src
:members:
:undoc-members:
:show-inheritance:
.. toctree::
:maxdepth: 4
features
io
model
utilities
conf.py中的html_theme_options也如下:
html_theme_options = {
"analytics_anonymize_ip": False,
"logo_only": False,
"display_version": True,
"prev_next_buttons_location": "bottom",
"style_external_links": False,
"vcs_pageview_mode": "",
# Toc options
"collapse_navigation": True,
"sticky_navigation": True,
"navigation_depth": 4,
"includehidden": True,
"titles_only": False,
"globaltoc_collapse": True,
"globaltoc_maxdepth": None,
}
我现在遇到的问题是,下拉菜单无法正常工作。它们不会出现在侧边栏中,除非我单击一个附近应该有下拉按钮的项目。
点击侧边栏链接后,我将转到下一个文件,这是一个打开的下拉菜单。
我想做的是,我希望从第一项开始就有下拉选项。这是笨拙且不直观的。
【问题讨论】:
标签: documentation python-sphinx documentation-generation read-the-docs