Skip to content

Turn off TOC by default when wide theme is selected #312

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

Closed
pettiross opened this issue Dec 4, 2023 · 5 comments
Closed

Turn off TOC by default when wide theme is selected #312

pettiross opened this issue Dec 4, 2023 · 5 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@pettiross
Copy link
Contributor

Because our primary scenario is helping authors create dashboards, we should make the TOC (in the right margin) opt-in instead of opt-out. When someone wants to write a longer report-style document, they could turn on the TOC.

@pettiross pettiross added the enhancement New feature or request label Dec 4, 2023
@mbostock
Copy link
Member

mbostock commented Dec 4, 2023

The TOC is useful for longer-style reports (documents, more like polished notebooks), and we also intend to have a theme: dashboards #60 which probably won’t be the default. Maybe we should have a more refined heuristic for enabling the TOC, based on the chosen theme? And it’s already the case that the TOC is off unless there are h2 headings. Do we expect h2 headings (and sections) to be used in dashboards?

@mbostock mbostock added the question Further information is requested label Dec 4, 2023
@pettiross pettiross changed the title Turn off TOC by default Turn off TOC by default when dashboard theme is selected Dec 4, 2023
@pettiross
Copy link
Contributor Author

I like that idea, @mbostock, tying the TOC to the theme. That makes a bunch of sense to me, and I wasn't aware of #60. Thanks for pointing it out. Edited the title.

@Fil
Copy link
Contributor

Fil commented Dec 5, 2023

I'd be in favor of doing nothing, and keeping the two topics independent.

If you want a dashboard without a TOC, you have 3 possibilities:

  • don't use H2 (nor H1) in the contents, or
  • specify toc: false in front-matter, or
  • specify toc: false in the config for a site-wide setting.

This only has to be documented as part of "toc", and the knowledge is then transferable to any theme.

@cinxmo
Copy link
Contributor

cinxmo commented Dec 5, 2023

I agree with @Fil on keeping the 2 topics independent. It would become confusing having to look at the source code/ document which themes have TOC enabled vs doesn't. We can definitely default toc: false globally instead of enabling it now though.

This was referenced Dec 6, 2023
@mbostock mbostock changed the title Turn off TOC by default when dashboard theme is selected Turn off TOC by default when wide theme is selected Jan 12, 2024
@cinxmo cinxmo added this to the General availability milestone Jan 16, 2024
@Fil
Copy link
Contributor

Fil commented Jan 22, 2024

Closing as "not planned"; feel free to reopen if the consensus shifts.

@Fil Fil closed this as not planned Won't fix, can't repro, duplicate, stale Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants