【问题标题】:Menu entry in toctree expands/collapses on click and doesn't change page content?toctree 中的菜单条目在单击时展开/折叠并且不更改页面内容?
【发布时间】:2019-08-08 12:08:56
【问题描述】:

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

有点像当您已经在实际条目上并再次单击它时,它只会展开/折叠。

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

【问题讨论】:

    标签: python python-sphinx read-the-docs expandable toctree


    【解决方案1】:

    这完全取决于您使用的Sphinx theme。如果不支持您想要的开箱即用功能,那么您必须根据您的需要修改主题的 JavaScript onclick 行为。尝试sphinx_rtd_themesphinxbootstrap4theme 来接近或查看其文档,看看是否有一个设置完全符合您的要求。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-11-27
      • 2013-11-25
      • 2019-03-23
      • 2018-10-30
      • 1970-01-01
      • 2013-08-09
      • 2019-04-22
      • 2019-09-18
      相关资源
      最近更新 更多