【问题标题】:Sphinx Documentation with different separated subjects具有不同主题的 Sphinx 文档
【发布时间】:2019-01-27 17:53:11
【问题描述】:

我正在尝试在索引中构建一种仪表板,每个主题一个磁贴。每个主题稍后将在source 中拥有自己的文件夹,其中包含自己的 md 文件。

我希望每个主题都与其他主题断开连接。所以previous 按钮不应该转到另一个主题。

结构应该是这样的: 首先是所有主题的概览,然后是一个子页面,每个主题有一个目录树,然后每个文档都有自己的普通视图。

有人知道我会怎么做吗?

目前我是这样构建索引的,但这不会分离文件:

.. toctree::
   :maxdepth: 1
   :name: mastertoc
   :caption: Example Files:
   :glob:

   introduction
   examples

.. toctree::
   :maxdepth: 1
   :name: Subject1
   :caption: Subject1:
   :glob:

   Subject1/*

.. toctree::
   :maxdepth: 1
   :name: Subject2
   :caption: Subject2:
   :glob:

   Subject2/*

【问题讨论】:

    标签: directory python-sphinx glob read-the-docs toctree


    【解决方案1】:

    如果我理解您的要求,您也希望为每个主题创建一个索引页。我们在几个地方为 Pyramid 这样做,如下所示:

    docs/index.rst

    .. toctree::
       :maxdepth: 1
       :glob:
    
       api/index
       api/*
    

    docs/api/index.rst

    .. toctree::
       :maxdepth: 1
       :glob:
    
       *
    

    它在行动:

    https://docs.pylonsproject.org/projects/pyramid/en/latest/#api-documentation

    第一个链接转到:

    https://docs.pylonsproject.org/projects/pyramid/en/latest/api/index.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-06
      • 1970-01-01
      • 2022-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多