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 · 7 comments

Comments

Projects
None yet
8 participants
@ericholscher
Member

ericholscher commented Jan 2, 2014

Copying from rtfd/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

This comment has been minimized.

Show comment
Hide comment
@pdion891

pdion891 May 22, 2014

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

pdion891 commented May 22, 2014

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

@winhamwr

This comment has been minimized.

Show comment
Hide comment
@winhamwr

winhamwr 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

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

This comment has been minimized.

Show comment
Hide comment
@mightyiam

mightyiam commented Sep 15, 2014

+1

@beddari

This comment has been minimized.

Show comment
Hide comment
@beddari

beddari Oct 2, 2014

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

beddari commented Oct 2, 2014

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

@martinpengellyphillips

This comment has been minimized.

Show comment
Hide comment
@martinpengellyphillips

martinpengellyphillips commented Dec 1, 2014

+1

@tgamblin

This comment has been minimized.

Show comment
Hide comment
@tgamblin

tgamblin commented Feb 23, 2015

+1

@safl

This comment has been minimized.

Show comment
Hide comment
@safl

safl commented Apr 15, 2015

+1

agjohnson added a commit to agjohnson/sphinx_rtd_theme that referenced this issue May 4, 2015

Add 3 + 4th levels to nav and more intuitive scrolling
Adds l3 + l4 nav menus, with more intuitive scrolling to make wandering the
additional nav menu items much easier. Resolves #25. Resolves #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

@ericholscher ericholscher closed this in #193 May 4, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment