Interesting idea. This should be clearly optional because there are doctrees that rely precisely on the feature of having the logical structure independent from file system structure. Luc
On 01.12.20 22:07, Denis Bitouzé wrote: > > 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 > <mailto: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 > <https://groups.google.com/d/msgid/sphinx-users/3e00313f-3985-48b6-9c09-592daa0922b6n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- 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/545fe5fc-8379-c0b5-2311-a21f08af46d7%40gmail.com.