DRY Slides with ---
Never repeat yourself, let Quarto do it
Quarto Extension
When a topic spans multiple slides, you end up writing the same heading over and over:
This violates the DRY principle and makes refactoring painful.
cascade extensionA filter that repeats the heading chain automatically when you use --- to create a new slide.
revealjs output.cascade extensionThis very slide was created with ---.
No heading was written in the source; it was repeated from the previous slide.
Content under a nested heading structure.
Both ## Nested headings work too and ### Still diving on the slide. Only parent headings above this ### level are repeated from the previous slide.
{.no-cascade}A heading marked {.no-cascade} stays here but is never repeated.
{.no-cascade}Only ## Opting out with {.no-cascade} is repeated. The ### A pinned subheading is not, because of the {.no-cascade} class.
This presentation sets depth: 2, so only the top two heading levels cascade.
This level-four heading is below the depth limit.
Both ## Limiting the depth and ### Level three heading are repeated. The #### Level four heading is dropped because it sits beyond depth: 2.
The heading attribute cascade-depth="1" overrides the document-level depth: 2 here.
Only ## Per-heading depth override is repeated; the ### Sub-heading kept off the chain is dropped because of the per-heading override.
A multi-part tip
First half of the tip.
A multi-part tip
Second half: the heading and the callout were repeated automatically.
A side note, first part.
Second part, still in the margin, on a new slide.
^%a+%- ID)Tip 1: A multi-part tip
First half of the tip.
Second half: the heading and the callout were repeated automatically.
Fewer lines, single source of truth for headings, and zero risk of typos.