A Quarto filter extension that hoists .fragment attributes from empty marker spans to their parent <li> elements in RevealJS presentations.
This makes list markers (bullets and numbers) appear and disappear together with the fragment content.
Also compatible with pandoc-ext/list-table for adding fragments to table cells and rows.
quarto add mcanouil/quarto-revealjs-fragmention@0.1.0This will install the extension under the _extensions subdirectory.
If you are using version control, you will want to check in this directory.
Add the filter to your document's front matter:
filters:
- fragmentionThen place an empty .fragment span at the start of any list item:
- []{.fragment fragment-index="1"} First item.
- []{.fragment fragment-index="2"} Nested item.
- []{.fragment fragment-index="3"} Another nested item.
- A normal item without a fragment.The filter removes the empty span and applies its classes and attributes to the <li> element.
RevealJS then controls the entire list item's visibility, including the bullet marker.
All RevealJS fragment classes are supported:
- []{.fragment .fade-in fragment-index="1"} Fade in.
- []{.fragment .highlight-red fragment-index="2"} Highlight red.
- []{.fragment .grow fragment-index="3"} Grow.Works with ordered lists too:
1. []{.fragment fragment-index="1"} First step.
2. []{.fragment fragment-index="2"} Second step.
3. []{.fragment fragment-index="3"} Third step.When used with pandoc-ext/list-table, ensure list-table runs first:
filters:
- list-table
- fragmentionThe list-table extension already consumes empty spans at the start of cells/rows and transfers their attributes.
Fragmention then renames fragment-index to data-fragment-index on table elements so RevealJS can recognise them.
:::{.list-table}
- - []{.fragment fragment-index="1"} Name
- []{.fragment fragment-index="1"} Value
- - []{.fragment fragment-index="2"} Another
- []{.fragment fragment-index="2"} Data
:::Here is the source code for a minimal example: example.qmd.
Rendered output:
- HTML.
