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

highlight nav item in onPageNav ToC when scrolling (add scrollspy) #1024

Closed
bildungsroman opened this issue Oct 8, 2018 · 9 comments
Closed
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@bildungsroman
Copy link
Contributor

bildungsroman commented Oct 8, 2018

🚀 Feature

Highlight the current section in the onPageNav ToC that the reader has scrolled to, either by a background color or bold or adding a customizable CSS class.

Basically, the way scrollspy works in Bootstrap.

Have you read the Contributing Guidelines on issues?

Yup.

Motivation

If a page has a long ToC (i.e. most of our tutorial pages have 9-10 steps), it would make it a lot easier for the reader to know where they are if the current step they have scrolled to is somehow highlighted in the ToC.

Pitch

This could be a universal feature in Docusaurus 2.0. I think it would make Docusaurus sites look even more professional.

@bildungsroman bildungsroman changed the title highlight nav item in onPageNav ToC when scrolling highlight nav item in onPageNav ToC when scrolling (add scrollspy) Oct 8, 2018
@endiliey
Copy link
Contributor

@bildungsroman
Copy link
Contributor Author

I know you can use Bootstrap and implement it that way, but for various reasons we didn't want to have to import Bootstrap just for one feature.

This solution ended up working for me - it could be incorporated into Docusaurus 2.0 quite simply IMO: https://github.com/Khan/KaTeX/pull/1557/files

@endiliey
Copy link
Contributor

My bad. I am putting the comment above so that the expected behavior can be known

@endiliey endiliey added the feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. label Oct 13, 2018
@tanhauhau
Copy link
Contributor

@endiliey can i work on this?

@yangshun yangshun added the status: claimed Issue has been claimed by a contributor who plans to work on it. label Oct 14, 2018
@yangshun
Copy link
Contributor

@tanhauhau it's yours!

I've added an "issue: claimed" label so that others will know not to start work on the issue. If you change your mind about the issue, no worries! Just let me know so that I can remove the label and free it up for someone else to claim.

I'll check in with you periodically so that we can keep the task updated with the progress.

@bildungsroman
Copy link
Contributor Author

@tanhauhau Thank you! This is how we ended up implementing it, if you need an example: https://docs.stackery.io/docs/using-stackery/dashboard/

@JoelMarcey
Copy link
Contributor

@bildungsroman - Hi. Unrelated to this issue, but I am curious if you are willing to put stackery.io on our user showcase page? https://docusaurus.io/en/users

@bildungsroman
Copy link
Contributor Author

bildungsroman commented Oct 15, 2018

I'd love to! Is it ok that we're not fully open-source, though?

@JoelMarcey
Copy link
Contributor

Absolutely. Please do.

@endiliey endiliey removed the status: claimed Issue has been claimed by a contributor who plans to work on it. label May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

No branches or pull requests

5 participants