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.35k stars 103 forks source link

A way to opt-out of h1 + h2 treating the h2 as a subtitle? #1528

Open mbostock opened 1 month ago

mbostock commented 1 month ago

As an alternative:

# Heading 1

<div><!-- heading 2 is not a subtitle --></div>

## Heading 2

Or:

# Heading 1

<div><h2>Heading 2</h2></div>
Fil commented 1 month ago

The OP was also about referencing H2 and H3. One way to do so would be to make the selector configurable—currently it's set here https://github.com/observablehq/framework/blob/9c1d5ca61c931083f78833ca28275c96a7dadb86/src/render.ts#L175

But opening this might make things too complicated. One issue with multiple levels in the TOC is that the hierarchy needs to be reflected visually.

mbostock commented 1 month ago

@Fil i think that should be a separate issue, if we want the TOC to be configurable.