feedback icon indicating copy to clipboard operation
feedback copied to clipboard

Auto-Create a "Table of Content"

Open Daynex opened this issue 3 years ago • 7 comments

Is your feature request related to a problem? Please describe. Longer Notebooks often have many different sections. Getting an overview and navigating around such notebooks can often be time consuming and unpleasant.

Describe the solution you'd like GitHub recently launched "Table of Contents", which are automatically generated based on the markdown of README files. It would be fantastic to have this feature in the Observable notebooks to get a better first overview as well as to allow to move along the content fast. Maybe the table of content tab could even stick around as one scrolls, kind of like in Google Suite.

Describe alternatives you've considered Maybe internal linking would be possible. So basically that everyone can build their own table of content?

Additional context

ezgif-6-cb47ee83abe3

EDITED

  • 02/04/2021 - Added a GIF for clarification.

Daynex avatar Apr 01 '21 14:04 Daynex

Current workaround: Use @mbostock/toc or a similar in-notebook table of contents generator.

jrus avatar Apr 01 '21 18:04 jrus

@Daynex A table of contents is usually displayed inline, at the top of a document. However, you appear to be asking for a navigation element outside of the notebook body. Can you please add a screenshot of the feature to the description, so that this request can be understood without reviewing the tweet?

mootari avatar Apr 01 '21 18:04 mootari

Maybe as another “tab” in the new navigation on next.observablehq.com? that way it could be easily accessible without taking up space.

j-f1 avatar Apr 01 '21 20:04 j-f1

@Daynex A table of contents is usually displayed inline, at the top of a document. However, you appear to be asking for a navigation element outside of the notebook body. Can you please add a screenshot of the feature to the description, so that this request can be understood without reviewing the tweet?

Than you for the point, @mootari. I added a GIF to the description. Does it clarify?

Daynex avatar Apr 02 '21 05:04 Daynex

I'd also love to see this feature!

The existing minimap could be augmented to support basic filtering by cell type, then the user could set it to display Markdown titles only. It could also nest titles automatically, similar to the GIF above.

izzues avatar Sep 10 '21 10:09 izzues

Is it possible to have a Table of Contents (ToC) on the left of the page?

I have seen the tool to make toc in the page. import {toc} from "@nebrius/indented-toc"

But what if I want a toc docked on the left of the page which would not move with mouse?

Thanks. Scarlett

scarlettlee avatar Aug 02 '22 06:08 scarlettlee

I wonder if this could be expanded into a custom docking zone. It could be used for TOC or other UI functions.

hellonearthis avatar Aug 02 '22 10:08 hellonearthis