gpt4 book ai didi

python - 我可以在 Sphinx 的目录中添加水平条吗?

转载 作者:行者123 更新时间:2023-12-05 03:53:32 24 4
gpt4 key购买 nike

我正在使用 Sphinx 开发文档,并希望使用水平条分隔目录中的部分。

我经常在菜单中看到这个:

enter image description here

有没有办法在 sphinx 中做到这一点?

最佳答案

python 狮身人面像 .. toctree::除了您在指令主体中包含的文档以及一些指令选项外,指令不允许有太多变化。

我看到其他人在这种情况下所做的是将一个 toctree 分成几个,包括它们之间的 reStructuredText。

您可以使用 toctree 的替代方法。引用文档:

Note

For local tables of contents, use the standard reST contents directive.

最简单的方法是将菜单分成几个 toctree,包括它们之间的 HTML 水平标尺:

Sphinx_test
===========


.. toctree::
:maxdepth: 4

undo
redo

.. raw:: html

<hr>

.. toctree::
:maxdepth: 4

cut
copy

.. raw:: html

<hr>

.. toctree::
:maxdepth: 4

find
Speech

结果:

enter image description here

关于python - 我可以在 Sphinx 的目录中添加水平条吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61502938/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com