toctree expands/collapses 中的菜单项在点击时不会更改页面内容?

Menu entry in toctree expands/collapses on click and doesn't change page content?

根据标题,是否可以有一个菜单条目,其中整个条目都像 +/- 一样用于展开和折叠并且不更改活动页面?

有点像当您已经在实际条目上并再次单击它时它只是 expands/collapses。

index.rst

Introduction
============
Some introductory text here

.. toctree::
   :hidden:

   self
   srg/index

srg/index.rst

srg
===
Normal menu entry that shows this as its page

.. toctree::
   :hidden:

   objects/index

srg/objects/index.rst

Objects
=======
I don't want this to be a page but only an expand/collapse entry.

.. toctree ::
   :hidden:

   list

srg/objects/list.rst

list
====

Page content again

这完全取决于 Sphinx theme you use. If one does not support the feature you want out of the box, then you must modify the theme's JavaScript onclick behavior to your desire. Try sphinx_rtd_theme or sphinxbootstrap4theme 获取一些东西或查看其文档以查看是否有完全符合您要求的设置。