framework icon indicating copy to clipboard operation
framework copied to clipboard

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

Open mbostock opened this issue 1 year ago • 2 comments
trafficstars

As an alternative:

# Heading 1

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

## Heading 2

Or:

# Heading 1

<div><h2>Heading 2</h2></div>

mbostock avatar Jul 22 '24 20:07 mbostock

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.

Fil avatar Jul 23 '24 07:07 Fil

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

mbostock avatar Jul 23 '24 11:07 mbostock