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

Add in-page right sidebar #1380

Open
rrrrrrockpang opened this issue Oct 24, 2023 · 3 comments
Open

Add in-page right sidebar #1380

rrrrrrockpang opened this issue Oct 24, 2023 · 3 comments
Labels
enhancement status: ready to implement Issues that can be actively worked on, and need an implementation!

Comments

@rrrrrrockpang
Copy link

rrrrrrockpang commented Oct 24, 2023

Hello, thank you so much for the framework. I'd like to see whether I can put the in-page toc as a sidebar. For example, I can generate the toc below:

## Table of contents
{: .no_toc .text-delta }

1. TOC
{:toc}
Screen Shot 2023-10-24 at 4 26 02 PM

However, I would love to put this toc on the right as people can easily navigate within my page. Something like the sidebar toc here: https://docs.github.com/en/get-started/quickstart/hello-world

@mattxwang
Copy link
Member

mattxwang commented Nov 2, 2023

Thanks for submitting an issue @rrrrrrockpang! I agree that this could be a very useful feature; #625 is a related issue (which targets a superset of this feature - also autogenerating it, etc.) that has some interest. Like I commented there, I'd be happy to review a PR that implements this, as long as it's opt-in and doesn't break backwards compatibility.

@mattxwang mattxwang added the status: ready to implement Issues that can be actively worked on, and need an implementation! label Nov 2, 2023
@bittlingmayer
Copy link

I would welcome this.

One problem with the GitHub implementation linked by @rrrrrrockpang is that it doesn't highlight as you scroll.

Here are some examples:

@jonfroehlich
Copy link

FWIW, I did implement this myself a few years ago but used the external js lib tocbot. It would definitely be great to have this implemented natively.

Here's an example of the tocbot integration:

image

You can check it out here: https://makeabilitylab.github.io/physcomp/arduino/led-on.html.

Note that:

  • The right sidebar doesn't pop-up until you scroll down the page
  • The sections do highlight and auto-expand
  • I never polished it to work well responsively (at all browser sizes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement status: ready to implement Issues that can be actively worked on, and need an implementation!
Projects
None yet
Development

No branches or pull requests

4 participants