diff --git a/news/changelog-1.6.md b/news/changelog-1.6.md index 441f0e42802..625ef070205 100644 --- a/news/changelog-1.6.md +++ b/news/changelog-1.6.md @@ -31,6 +31,7 @@ All changes included in 1.6: ## `revealjs` Format - Update to Reveal JS 5.1.0. + - Support for a [Jump To Slide](https://revealjs.com/jump-to-slide/) menu to quickly navigate between slides. Set `jump-to-slide: false` to opt out. - Prevent empty SASS built css file to be included in header. - Remove wrong `sourceMappingUrl` entry in SASS built css. - ([#7715](https://github.com/quarto-dev/quarto-cli/issues/7715)): Revealjs don't support anymore special Pandoc syntax making BulletList in Blockquotes become incremental list. This was confusing and unexpected behavior. Supported syntax for incremental list is documented at . diff --git a/src/format/reveal/constants.ts b/src/format/reveal/constants.ts index 7b8ee359a9e..84833a06fce 100644 --- a/src/format/reveal/constants.ts +++ b/src/format/reveal/constants.ts @@ -23,3 +23,4 @@ export const kAutoAnimateDuration = "autoAnimateDuration"; export const kAutoAnimateUnmatched = "autoAnimateUnmatched"; export const kAutoStretch = "auto-stretch"; export const kCodeBlockHeight = "code-block-height"; +export const kJumpToSlide = "jumpToSlide"; diff --git a/src/format/reveal/format-reveal.ts b/src/format/reveal/format-reveal.ts index b9201805983..8cca8875ee8 100644 --- a/src/format/reveal/format-reveal.ts +++ b/src/format/reveal/format-reveal.ts @@ -56,6 +56,7 @@ import { kCenterTitleSlide, kControlsAuto, kHashType, + kJumpToSlide, kPdfMaxPagesPerSlide, kPdfSeparateFragments, kPreviewLinksAuto, @@ -142,6 +143,9 @@ export function revealjsFormat() { format.metadata[kAutoAnimateUnmatched] !== undefined ? format.metadata[kAutoAnimateUnmatched] : true, + [kJumpToSlide]: format.metadata[kJumpToSlide] !== undefined + ? !!format.metadata[kJumpToSlide] + : true, }; if (format.metadata[kPdfMaxPagesPerSlide]) { diff --git a/src/format/reveal/metadata.ts b/src/format/reveal/metadata.ts index 28d066fcfcc..9db6dbacd47 100644 --- a/src/format/reveal/metadata.ts +++ b/src/format/reveal/metadata.ts @@ -6,6 +6,14 @@ import { Metadata } from "../../config/types.ts"; import { camelToKebab, kebabToCamel } from "../../core/config.ts"; +import { + kAutoAnimateDuration, + kAutoAnimateEasing, + kAutoAnimateUnmatched, + kJumpToSlide, + kPdfMaxPagesPerSlide, + kPdfSeparateFragments, +} from "./constants.ts"; export function optionsToKebab(options: string[]) { return options.reduce( @@ -80,9 +88,9 @@ const kRevealOptions = [ "preloadIframes", "autoAnimate", "autoAnimateMatcher", - "autoAnimateEasing", - "autoAnimateDuration", - "autoAnimateUnmatched", + kAutoAnimateEasing, + kAutoAnimateDuration, + kAutoAnimateUnmatched, "autoAnimateStyles", "autoSlide", "autoSlideStoppable", @@ -108,9 +116,10 @@ const kRevealOptions = [ "minScale", "maxScale", "mathjax", - "pdfMaxPagesPerSlide", - "pdfSeparateFragments", + kPdfMaxPagesPerSlide, + kPdfSeparateFragments, "pdfPageHeightOffset", + kJumpToSlide, ]; const kRevealKebabOptions = optionsToKebab(kRevealOptions); diff --git a/tests/docs/smoke-all/revealjs/jump-to-slide.qmd b/tests/docs/smoke-all/revealjs/jump-to-slide.qmd new file mode 100644 index 00000000000..aafd23fb27e --- /dev/null +++ b/tests/docs/smoke-all/revealjs/jump-to-slide.qmd @@ -0,0 +1,17 @@ +--- +title: "Jump to slide" +format: + revealjs: + jump-to-slide: false +_quarto: + test: + revealjs: + ensureFileRegexMatches: + - ["jumpToSlide.*false,"] + - ["jumpToSlide.*true,"] +--- + +## test + +`jump-to-slide` is converted to revealjs option and inserted as `jumpToSlide`. +