observablehq / framework

A static site generator for data apps, dashboards, reports, and more. Observable Framework combines JavaScript on the front-end for interactive graphics with any language on the back-end for data analysis.
https://observablehq.com/framework/
ISC License
2.38k stars 104 forks source link

Customize which headings are shown in the TOC #1529

Open mbostock opened 1 month ago

mbostock commented 1 month ago

Currently it’s hardcoded as

h1:not(:first-of-type)[id],
h2:first-child[id],
:not(h1) + h2[id]

Should we allow this to be customizable?

Fil commented 1 month ago

One issue here is that with multiple levels in the TOC (say, h2, h3), users will want the hierarchy be reflected visually. We could at a minimum provide some classes that reflect the hierarchical level?