重组文本TOC子组

时间:2019-02-11 12:13:20

标签: python-sphinx restructuredtext read-the-docs

我正在尝试获取一个TOC,其中的子组指向不同的rst文件。这是我的index.rst:

.. bonobo-trans documentation master file, created by
   sphinx-quickstart on Fri Feb  8 18:09:07 2019.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

.. toctree::
   :maxdepth: 2

Transformations
---------------

- :doc:`source/source`
- :doc:`source/target`
- :doc:`source/lookup`
- :doc:`source/sequencer`
- :doc:`source/sorter`
- :doc:`source/aggregator`

Source
``````
Target
``````
Lookup
``````

Requirements
------------
- bonobo 0.6.3
- pandas
- sqlalchemy

Installation
------------

Install bonobo-trans by running:

    pip install bonobo-trans

Contribute
----------

- Issue Tracker: github.com/$project/$project/issues
- Source Code: github.com/$project/$project

Support
-------

If you are having issues, please let me know.

License
-------

The project is licensed under the Apache license.

我添加了三个子标题来说明我的外观,但是我只想要“转换”部分下的链接列表。基本上,这应该是这样的:

example

这可能吗?

1 个答案:

答案 0 :(得分:0)

使用:hidden:选项对toctree使用此选项应该使您更接近。但是,您不会在同一页面上获得可折叠的部分或标题的引用。

Transformations
---------------

.. toctree::
   :maxdepth: 1
   :includehidden:

   sequencer
   sorter
   aggregator

.. toctree::
   :hidden:

   source
   target
   lookup

Requirements
------------
- bonobo 0.6.3
- pandas
- sqlalchemy

Installation
------------
...

还请注意,文件仅在目录中由文件名引用,从而无需使用:doc:。同样,假设所有文档参考都包含在source目录中,只要在conf.py中进行了配置即可。