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

refactoring sidebar highlighting and allowing collapsed subsections #412

Merged
merged 4 commits into from
Nov 12, 2019

Conversation

choldgraf
Copy link
Member

@choldgraf choldgraf commented Oct 18, 2019

This moves the logic for sidebar highlighting outside of the HTML template, and into a bit of javascript. The main goal is to make it more maintainable and understandable, and also to make it possible for sub-sections to be collapsed if wished

@drbeane do you wanna give this branch a shot and see if that gets your sub-section collapsing properly?

closes #407

@choldgraf choldgraf added the enhancement New feature or request label Nov 4, 2019
@drbeane
Copy link

drbeane commented Nov 11, 2019

Sorry for the slow reply on this. I finally got a chance to test it out today, and it seems to be working splendidly. Thank you very much @choldgraf!!

@choldgraf
Copy link
Member Author

Sounds good - the failing test is for the CircleCI build because Ruby is having a hard time installing one of the dependencies. I'm not sure why that is, but all the other tests are passing, so I'm gonna merge this one

@choldgraf choldgraf merged commit 714bc30 into executablebooks:master Nov 12, 2019
@choldgraf choldgraf deleted the collapse_sidebar branch November 12, 2019 04:06
@Jace-Yang
Copy link

Is it a way to turn collapsable sidebar off for some file?
I am working on a python JB. For some chapter, like regex cheatsheet, showing everything in the sidebar TOC allows reader quickly navigating into the sub-chapter. But I couldn't find the parameter to set this after searching a while...😭

@choldgraf
Copy link
Member Author

What is it you wish to do exactly? You want to make the button to close the sidebar be invisible on some pages? Why do you not want readers to be able to close the sidebar?

@Jace-Yang
Copy link

Jace-Yang commented Jul 31, 2022

What is it you wish to do exactly? You want to make the button to close the sidebar be invisible on some pages? Why do you not want readers to be able to close the sidebar?

It doesn't necessary has to be a button for reader. I wish the writer can set whether a page will collapse the sub-sections within a non-active section in the sidebar (not the entire sidebar).

  • For some pages, my readers would prefer to only see the sections until they click on a specific section
  • For some pages, in fact most parts of my book, readers would prefer to see the entire sidebar TOC no matter what specific section they are in.

BTW, I opened a new issue for this: #1792

@Jace-Yang
Copy link

What is it you wish to do exactly? You want to make the button to close the sidebar be invisible on some pages? Why do you not want readers to be able to close the sidebar?

It doesn't necessary has to be a button for reader. I wish the writer can set whether a page will collapse the sub-sections within a non-active section in the sidebar (not the entire sidebar).

  • For some pages, my readers would prefer to only see the sections until they click on a specific section
  • For some pages, in fact most parts of my book, readers would prefer to see the entire sidebar TOC no matter what specific section they are in.

BTW, I opened a new issue for this: #1792

Any updates? Much appreciate it.

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

Successfully merging this pull request may close these issues.

Folding Subsections in Table of Contents
3 participants