reveal.js icon indicating copy to clipboard operation
reveal.js copied to clipboard

Add automated ids for vertical slides

Open cjdb opened this issue 1 year ago • 0 comments

Problem

I like to name my vertical slides the same thing as the first slide, but with an index. This makes it easier for me to find specific slides without needing to come up with novel names when they're not particularly helpful.

I'm currently doing a lot of manual naming, like id="intro-0", id="intro-1", etc., which can be error-prone if I add a slide between two existing slides or move content around.

Proposed solution

It'd be nice if I could inform reveal.js to take use the id field of a top-level slide to automate naming its nested slides. I haven't been able to find anything that fills this niche in the documentation.

Example

<section id="intro"
         data-markdown="content/introduction.md"
         data-separator="^\n\n\n"
         data-separator-vertical="^\n\n"
         data-separator-notes="^Note:">
</section>
## Page 1


## Page 2


## Page 3
Page URL before change URL after change
Page 1 http://localhost:8000/#/1 http://localhost:8000/#/intro/1
Page 2 http://localhost:8000/#/1/1 http://localhost:8000/#/intro/2
Page 3 http://localhost:8000/#/1/2 http://localhost:8000/#/intro/3

cjdb avatar Feb 03 '24 21:02 cjdb