Skip to content

request new feature for combining or extending toc-trees #4546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
eflanigan00 opened this issue Feb 4, 2018 · 6 comments
Open

request new feature for combining or extending toc-trees #4546

eflanigan00 opened this issue Feb 4, 2018 · 6 comments

Comments

@eflanigan00
Copy link

eflanigan00 commented Feb 4, 2018

I often want to do something like the following:

.. toctree::
   :maxdepth: 2

   folder1/file1
   folder1/file2

.. toctree::
   :maxdepth: 1

   folder1/file3

.. toctree::
   :maxdepth: 2

   folder1/file4
   folder1/file5

But I want to have all the contents appear on the top page without the space in between the toctrees.

I'm aware that I can place `:tocdepth: 1' in file3. The problem with that is that the table of contents displayed in the sidebar on the file3 subpage is way too short. I want that sidebar to contain the full set of information.

Could you add some sort of syntax to allow this:

.. toctree::
   :maxdepth: 2

   folder1/file1
   folder1/file2

.. toctree::
   :maxdepth: 1
   :extendtree: True

   folder1/file3

.. toctree::
   :maxdepth: 2
   :extendtree: True

   folder1/file4
   folder1/file5
@tk0miya tk0miya added type:proposal a feature suggestion internals:toctree labels Feb 4, 2018
@tk0miya
Copy link
Member

tk0miya commented Feb 4, 2018

+0; it might be useful.

Could you add some sort of syntax to allow this:

I think such option is not needed. To concatenate automatically is better to me.

@eflanigan00
Copy link
Author

eflanigan00 commented Feb 4, 2018

I think such option is not needed. To concatenate automatically is better to me.

Yes that would be great!

I would also like to concatenate lists with the toctree.

For example:

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

.. toctree::
   :maxdepth: 1

    folder/acronyms

In that case the html would look like this:

  • Index
  • Module Index
  • Search Page
  • Acronyms

Currently I get the following:

  • Index
  • Module Index
  • Search Page

white space

  • Acronyms

@tk0miya
Copy link
Member

tk0miya commented Feb 5, 2018

No, toctree is not a list, so the 2nd case is not good to me.
For example, LaTeX output does not use a list for toctree. It is used to generate ToC (page).

@eflanigan00
Copy link
Author

I see what you are saying now. And yes I agree the 2nd case doesn't make sense.

Do you know if there is a way to place :ref:genindex in a toctree?

@tk0miya
Copy link
Member

tk0miya commented Feb 6, 2018

That is requested, but not adopted yet.

@eflanigan00
Copy link
Author

Ok thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants