Quarto Extension
This extension enables fragment-based navigation through code annotations in Reveal.js presentations.
Install the extension using:
Add to your document YAML:
Use arrow keys to step through each annotation.
Annotations work with any language.
Every highlight clone matches an annotation on the same lines, so they share a navigation step.
Without a leading |, the first highlight step is the initial state. Unmatched annotations appear at the end; matched pairs still sync.
An annotation whose lines are a subset of a highlight’s lines syncs with that step. Here, <2> marks only line 3 yet syncs with the highlight spanning lines 2-3.
Text fragments appear first, then code annotations follow.
This paragraph fades in as the first fragment.
This paragraph fades in as the second fragment.
This paragraph fades in after all annotations.
Use code-annotation-fragment-indices to interleave annotations with other fragments.
We need a data manipulation library before writing any pipeline code.
With the data piped in, we can start applying transformations.
The result keeps only cars that achieve more than 20 miles per gallon.
Line highlighting without annotations steps through highlights as normal fragments.
All highlight clones match annotations on the same lines, so they sync.
Use code-line-fragment-indices to control which fragment index each highlight step receives.
A two-panel layout is set up to compare plots side by side.
The first panel draws a basic scatter plot of speed vs distance.
The second panel repeats the plot in red for comparison.
Combines code-line-fragment-indices with annotations.
Define the input as a numeric sequence.
Square each value to build a parabola.
This script generates a simple parabola. Step through each highlighted line below.
Slides with plain fragments (no code annotations or line highlights) should print as a single page.
First point appears.
Second point appears.
Third point appears.
Disable fragment navigation while keeping tooltips:
Feel free to ask any questions about the Reveal.js Code Annotation Fragments extension.