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

Ability to show the TOC both in body and right simulataneously #3473

Closed
dragonstyle opened this issue Nov 27, 2022 Discussed in #3336 · 4 comments · Fixed by #5325
Closed

Ability to show the TOC both in body and right simulataneously #3473

dragonstyle opened this issue Nov 27, 2022 Discussed in #3336 · 4 comments · Fixed by #5325
Assignees
Labels
enhancement New feature or request websites Issues creating websites
Milestone

Comments

@dragonstyle
Copy link
Collaborator

Discussed in #3336

Originally posted by AlFontal November 15, 2022
As far as I know, it's possible to select a single location to show the Table of Contents, but while the dynamic TOC that always stays on the right is useful, sometimes I also want to show a full TOC just after the header in an article/blog post.

Is there any mechanism to have it behave like that right now?

@dragonstyle dragonstyle self-assigned this Nov 27, 2022
@dragonstyle dragonstyle added this to the v1.4 milestone Nov 27, 2022
@allenmanning allenmanning modified the milestones: v1.4, Future Mar 20, 2023
@dragonstyle dragonstyle added enhancement New feature or request good-first-issue Good for newcomers, fairly well defined labels Mar 20, 2023
@allenmanning
Copy link
Contributor

allenmanning commented Apr 20, 2023

One way we could think about approaching this could be to make the toc-location parameter optionally a list.

It can support

format:
  html:
    toc: true
    toc-location: body

as it does today.

It could then additionally support

format:
  html:
    toc: true
    toc-location:
      - left
      - body

Another approach which is a bit more quick-and-dirty, would be to add the additional two options left-body and right-body. This would keep it a single value and prevent the support of the likely unwanted right and left.

@allenmanning allenmanning added websites Issues creating websites and removed good-first-issue Good for newcomers, fairly well defined labels Apr 20, 2023
@dragonstyle
Copy link
Collaborator Author

This seems like a good way to accomplish this. I think that supporting both left and right simultaneously is going to be a little annoying to implement because our grid system has some special accommodations for toc: left and I'm not completely sure how that grid will work with elements in both the left and right margins (it might be ok, but not sure).

@allenmanning
Copy link
Contributor

allenmanning commented Apr 20, 2023

It doesn’t seem that there is a need currently for both right and left just body and one of the sides.
Another approach could be right-body left-body that captures both locations as a single value.

It isn't super clean, although we wouldn’t be implementing features that folks likely wouldn't want.

@dragonstyle
Copy link
Collaborator Author

dragonstyle commented Apr 20, 2023

That would definitely be a way to simplify things without creating weird scenarios like

toc-location:
  - left
  - right

I actually really like it (left-body / right-body) - it feels like it keeps things simple.

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