Apa*_*ear 2 python python-sphinx
我的index.rst中有一个toctree看起来像这样:
.. toctree::
:maxdepth: 2
cat
dog
moose
Run Code Online (Sandbox Code Playgroud)
我希望使用'api documentation' 来嵌套我的toctree的内容,类似于这里的内容:
所以最终做出类似的事情:
.. toctree::
:maxdepth: 2
:dropdown Animals
cat
dog
moose
Run Code Online (Sandbox Code Playgroud)
但我似乎无法在文档中找到任何可以做到这一点的内容.
P.G*_*.G. 11
侧边栏中toctree的这种行为是Read the Docs主题的一个特性(https://github.com/snide/sphinx_rtd_theme)
安装它 pip install sphinx-rtd-theme
该主题具有collapse_navigation控制是否在导航到文档的其他部分时自动折叠树的选项.
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
"collapse_navigation" : False
}
Run Code Online (Sandbox Code Playgroud)
indexr.rst:
#################
Title
#################
Animals
=======
.. toctree::
:maxdepth: 2
animals/index
Flowers
=======
.. toctree::
:maxdepth: 2
flowers/index
Run Code Online (Sandbox Code Playgroud)
动物/ index.rst:
####################
Animals
####################
.. toctree::
:maxdepth: 2
cat
dog
moose
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3525 次 |
| 最近记录: |