问题描述
我正在尝试在索引中构建一种仪表板,每个主题一个磁贴.每个主题以后都会在 source
中拥有自己的文件夹,并带有自己的md文件.
I'm trying to build kind of a dashboard in the index with one tile per subject. Each subject will later have its own folder in source
with it's own md files.
我希望每个主题都与其他主题断开连接.因此,上一个
按钮不应转到其他主题.
I want each subject to be disconnected to the others. So the previous
button should no go to another subject.
结构应如下所示:首先是所有主题的概述,然后是一个子页面,每个主题都有一个toctree,然后每个文档都有其自己的普通视图.
The structure should be something like this:First there is an overview with all subjects, then there is a subpage with one toctree per subject and then each document has its own normal view.
有人知道我会怎么做吗?
Does anyone have an idea how I would go about it?
当前,我以这种方式建立索引,但这不会分隔文件:
Currently I build the index like that, but this doesn't separate the files:
.. 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/*
推荐答案
如果我理解您的要求,那么您也希望每个主题都有一个索引页.我们在几个地方为金字塔做这些,就像这样:
If I understand your request, you want to have an index page for each subject, too. We do that for Pyramid in a couple of places, like so:
.. toctree::
:maxdepth: 1
:glob:
api/index
api/*
docs/api/index.rst
.. toctree::
:maxdepth: 1
:glob:
*
这里正在起作用:
https://docs.pylonsproject.org/projects/pyramid/zh-CN/latest/#api-documentation
第一个链接转到:
https://docs.pylonsproject.org/projects/pyramid/zh-CN/latest/api/index.html
这篇关于Sphinx文档包含不同的主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!