Skip to content
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

Option not to include headings in the toctree #312

Closed
akien-mga opened this issue Jul 20, 2016 · 1 comment
Closed

Option not to include headings in the toctree #312

akien-mga opened this issue Jul 20, 2016 · 1 comment

Comments

@akien-mga
Copy link
Contributor

akien-mga commented Jul 20, 2016

This is a follow-up to #277 which was just fixed by adding the navigation_depth option. I've noticed that though this option is quite useful to have, it doesn't fully address my use case when using collapse_navigation = False (i.e. tree-like structure).

What I'd like to have as an option is to be able to limit the table of contents sidebar to sections and pages, without showing the various levels of headings/subsections for pages.

Basically I'd like the toctree to only display, where + shows an expandable item, and o shows a non-expandable item.

+ Section 1
   + Subsection 1.1
      o Page 1.1.1
      o Page 1.1.2
    o Page 1.2

instead of:

+ Section 1
   + Subsection 1.1
      + Page 1.1.1
         o Heading2 1.1.1.1
         + Heading2 1.1.1.2
            o Heading3 1.1.1.1.1
         o Heading2 1.1.1.3
      o Page 1.1.2
    + Page 1.2
       o Heading 1.2.1

Some examples to be more explicit:

Using collapse_navigation = True works this around thanks to the properly defined :maxdepth:, but we really want to use this tree-like navigation. What we'd need for our use case is an option that ignores page headings (h2 and later) when generating the toctree, but only takes into account the page and section titles (h1).

The navigation_depth parameter does not fully address our use case, as we need variable depths depending on the section (e.g. our "Learning step by step" section needs a depth of 2, while our "Engine" section with its subsections needs a depth of 3).

Hope this makes sense, and thanks for your work on this theme :)

@reduz
Copy link

reduz commented Jul 20, 2016

To put a little more context, a single page such as this:

image

shows a ton of sections and subsections at the toc:

image

Making the toc huge and very confusing to browse, specially in documentations as large and complex as ours. Simply not showing the headings at all in the toc would be fantastic.

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

No branches or pull requests

3 participants