Hi, Sphinx does not mind the depth of the document itself. It only minds how sections are "nested".
To make your subsections "nested", please append sub-toctree to foo0.rst and subfolder1/foo1.rst like following: ``` # foo0.rst This a title ============ .. toctree:: subfoloder1/foo1 ``` ``` # subfoloder1/foo1.rst This a title ============ .. toctree:: subfoloder2/foo2 ``` Then you'll see a ToC tree as expected. Thanks, Takeshi KOMIYA 2020年12月2日(水) 5:08 Denis Bitouzé <denis.bito...@gmail.com>: > > > Hi, > > Suppose I have: > > - a `foo0.rst` file at the root (`source`) of my `sphinx-doc` source folder, > - a `foo1.rst` file in a subfolder `subfolder1` of `source`, > - a `foo2.rst` file in a subfolder `subfolder2` of `subfolder1`, > > that is: > > ┌──── > │ $ tree source > │ source > │ ├── foo0.rst > │ └── subfolder1 > │ ├── foo1.rst > │ └── subfolder2 > │ └── foo2.rst > └──── > > all with the same content: > > ┌──── > │ This a title > │ ============ > └──── > > Now, if the `index.rst` contains: > > ┌──── > │ Welcome to Test's documentation! > │ ================================ > │ > │ .. toctree:: > │ :maxdepth: 3 > │ :caption: Contents: > │ > │ foo0 > │ subfolder1/foo1 > │ subfolder1/subfolder2/foo2 > └──── > > `make html` gives: > > ┌──── > │ Welcome to Test’s documentation! > │ > │ Contents: > │ > │ • This a title > │ • This a title > │ • This a title > └──── > > that is all the headings are sections. > > What I would like to get instead is the following: > > ┌──── > │ Welcome to Test’s documentation! > │ > │ Contents: > │ > │ • This a title > │ ◦ This a title > │ ▪ This a title > └──── > > that is the heading of: > > - `foo0.rst` being a section, > - `subfolder1/foo1.rst` being a subsection (and not a section), > - `subfolder1/subfolder2/foo2.rst` being a subsubsection (and not > a section). > > My question is therefore: is it possible to make the heading levels of > documents belonging to (sub(sub(...)))folders automatically depending on > the depth's levels of the folders they belong to? > > Thanks. > -- > Denis > > -- > You received this message because you are subscribed to the Google Groups > "sphinx-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sphinx-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sphinx-users/3e00313f-3985-48b6-9c09-592daa0922b6n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/CAFmkQAM1hqEO-gW%3DK5jTA3a%3DffiYkurmtjDivPPexe89-Pvh9g%40mail.gmail.com.