隐藏toctree中的特定文件

时间:2013-11-29 10:15:49

标签: python-sphinx restructuredtext

我在我的localhost上使用readthedocs.org实例从我的github repo构建html文档,我希望能够做到以下几点。

目前我有一个使用toctree的glob功能读取的文件列表,如下所示:

.. toctree::
    :maxdepth: 2
    :glob:

     *

但我需要避免在我的toc中列出某些文件,例如:

Test_Manuals.rst
Test_Process.rst
Test_Users.rst
Testing.rst       <--- Only this file should appear in the toctree, all others are listed inside this one 
Testing_on_test_dot_spy.rst

我尝试在:glob:部分下面添加一个:hidden:但它只隐藏了所有内容。

我已经查看了尽可能多的文档,但是在这两个选项一起使用的时候我找不到任何例子。

知道怎么做到这一点?谢谢。

1 个答案:

答案 0 :(得分:1)

我对狮身人面像来说相对较新,所以也许这是可怕的狮身人面像礼仪,但我发现这给了所需的行为而没有任何警告:

.. toctree::
  :glob:

  dir_to_glob/*

.. toctree::
  :hidden:

  dir_to_glob/file_to_hide

投入第二个toctree似乎会覆盖如何处理file_to_hide而不会弄乱glob中的任何内容。通过这种方式,您只需要维护一个&#34;来排除&#34;列表(对我来说很小,听起来也像你的情况一样。)

相关问题