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

Show 3rd level headers #76

Closed
ericholscher opened this issue Jan 2, 2014 · 8 comments · Fixed by #193
Closed

Show 3rd level headers #76

ericholscher opened this issue Jan 2, 2014 · 8 comments · Fixed by #193

Comments

@ericholscher
Copy link
Member

Copying from readthedocs/readthedocs.org#604

The new theme is lovely, but the way it handles the sidebar navigation breaks things.

http://python-notes.curiousefficiency.org/en/latest/python3/questions_and_answers.html is a good example of the problem.

With the default Sphinx approach, navigation within that page is easy: the level 2 heading and the level 3 subheadings are shown at the top of the side nav bar, with the previous and next topics presented below that.

With the new default RTFD theme, the side bar always shows the nav for the entire site, bringing in all the other irrelevant L1 headings, but doesn't display any of the L3 headings within the document itself. That means I can only navigate within the doc by popping back up to the overview page for that section to get access to the third level of the TOC.

@pdion891
Copy link

Hi, Can we show 3 level of section into the left sidebar with this patch ?

@winhamwr
Copy link

winhamwr commented Sep 3, 2014

Hello,

My ideal solution to this would be either Dynamic ToC Levels or a new navigation element.

Dynamic ToC Levels

For the current page, the TOC always includes all H1's, all ancestors of the current section, siblings of the current section and the current section's direct children. Taking inspiration from the bootstrap docs, we would detect the scroll position and if you're in an H2, the ToC expands to display the H3's.

A challenge might be visually displaying deep nesting without using a ton of horizontal space. We might be able to just decrease the left margin size and still communicate nesting effectively. If we can't, maybe automatic numbering could help or maybe breadcrumb-style indicators (>, >>, >>>, >>>>) would convey nesting without using as much space.

H3 example

If you're in an H3, you can see:

  • All H1's
  • Your parent H2
  • Your parent H2's siblings
  • Your H3
  • Your H3's siblings
  • Your child H4s

H4 example

If you're in an H4, you can see:

  • All H1's
  • Your grandparent H2
  • Your grandparent H2's siblings
  • Your H3 parent
  • Your H3 parent's siblings
  • Your H4
  • Your H4's siblings
  • Your H5 children

New navigation element

Add a new UI element for the current page's ToC, which will display all nesting levels. This could go on the right side in the desktop view and maybe it slides from the right in the mobile view. I don't love this solution, though.

Thoughts?

-Wes

@mightyiam
Copy link

+1

@beddari
Copy link

beddari commented Oct 2, 2014

A solution to this would increase usability for my use cases ...

@martinpengellyphillips
Copy link

+1

2 similar comments
@tgamblin
Copy link

+1

@safl
Copy link

safl commented Apr 15, 2015

+1

agjohnson added a commit to agjohnson/sphinx_rtd_theme that referenced this issue May 4, 2015
Adds l3 + l4 nav menus, with more intuitive scrolling to make wandering the
additional nav menu items much easier. Resolves readthedocs#25. Resolves readthedocs#76.

* Reuses some styles for l3 + l4 navs items
* Nav interaction was changed to be more intuitive:
  * Nav is always sticky, doesn't scroll past end of content
  * Nav scrolls up immediately on window scroll events
  * Nav scrolls independently
  * Adds TOC expand plus links to the left of nav elements with children, these
    are added and update dynamically
  * Links in nav don't automatically scroll nav
  * Scrolling content will start scrolling nav again
  * Adds URL fragment handling to link and show current anchor links
@AlessandroGianfelici
Copy link

+1

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

Successfully merging a pull request may close this issue.

9 participants