为狮身人面像组织 .rst 文件?

Organise .rst files for sphinx?

我正在整理一些使用 Sphinx 的用户指南。但是,有许多 .rst 文件,当它们与 index.rst.

一起位于主文件夹中时,很难跟踪它们

我想像这样将它们整理到文件夹中。但是,make html 命令会导致警告说它找不到所有隐藏在文件夹中的 .rst 文件。

如何组织我的 .rst 文件?

index.rst
  Docs
     new_starter.rst
     subject_guides.rst
  New starter
     first_week.rst
     second_week.rst
  Subject guides
     stress.rst
     aerodynamics.rst
     data_science.rst

Sphinx 文档部分提到了这一点 TOC Tree

在您的 index.rst 中,使用 toctree 指令:

Project Awesome
===============

Welcome to the Project Awesome docs.

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

   docs/*
   new_starter/*
   subject_guides/*

以上使用 "globbing",但您可以使用名称而不是 globbing 明确地对文件进行排序。