如何将目录(TOC)从index.rst链接到README.rst?
我的 docs/ 文件夹中有一些 sphinx 文档。在那里我有一些手写的和从代码(Python)动态生成的文档的典型结构。我希望为打开存储库的人提供一个非常简单的 README.rst 。在那个 README.rst 中,我希望显示 Sphinx 文档的整个目录。它看起来像这样:
About section etc.
==================
blah blah blah
For more check out the documentation
.. here the automatically imported TOC tree
我该怎么做?
I have some sphinx documentation inside my docs/
folder. There I have a typical structure of some handwritten and dynamically generated documentation from code (Python). I would like to have a very simple README.rst
for people opening the repo. In that README.rst
I would like to have the whole TOC displayed of the Sphinx documentation. It would look something like that:
About section etc.
==================
blah blah blah
For more check out the documentation
.. here the automatically imported TOC tree
How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 Sphinx 中的目录,您应该使用
toctree
:如果您生成所有文档,那么最好使用“globbing”自动包含所有内容:
有关更多详细信息,请查看 关于 toc 的文档
这是一个cython 文档 中的示例
这是一个index.rst 文件

For a table of contents in Sphinx you should use
toctree
:And if you generate all docs, then it's nice to use "globbing" to include everything automatically:
For more details look into the docs about toc
here's an example in cython docs
and here's an index.rst file
