Skip to content
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

Add support for sections/chapters with linkable HTML IDs #71

Open
marcuswhybrow opened this issue May 2, 2024 · 0 comments
Open

Add support for sections/chapters with linkable HTML IDs #71

marcuswhybrow opened this issue May 2, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@marcuswhybrow
Copy link
Owner

marcuswhybrow commented May 2, 2024

YouTube has the concept of chapters for timestamping sections of the video. This is a really useful way to find things.

I immediately thought of markdown headings. Many parsers will automatically add an HTML ID attribute to each title, which allow links to reference that part of the page using an HTTP fragment.

However there are many markdown heading types, from level 1 to 6, I believe. Using markdown headings improves the plain markdown readability.

If the medium is audio or video, a section should always specify a timestamp, and this should be enforced at build time. ID's should be auto generated from the heading text. Something like this, perhaps:

RP: Okay,

## Caffeine and it's effects [1:30]

Well, I ...

However, I don't like that markdown authors are free to specify the sections heading level (1 to 6), which will lead to variation in usage. For example I'd use level 2 headings, represented by ##, but others may like level 1 or level 3 headings.

The Goldmark markdown parser Ray Peat Rodeo uses is very extensible. The easiest option would be to perform a final transform step that inspects all headings and enforces any style guidelines. This step might also catalog the section names, and determine if the heading contains a timestamp, and perhaps panic if timestamps are not defined when they should be.

@marcuswhybrow marcuswhybrow added the enhancement New feature or request label May 2, 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
Projects
None yet
Development

No branches or pull requests

1 participant