Skip to content

Commit 094061d

Browse files
authored
Add reveal.js scroll view option to HTML writer (#11305)
* Add revealjs `scroll` view option to HTML writer * Add `scrollSnap` option into default.revealjs Closes #10052
1 parent 1dcb984 commit 094061d

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

data/templates/default.revealjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,19 @@ $endif$
232232
// devices. It is advisable to set this to a lower number than
233233
// viewDistance in order to save resources.
234234
mobileViewDistance: $mobileViewDistance$,
235+
$if(view)$
236+
237+
// Enable scroll view
238+
view: '$view/nowrap$',
239+
// see https://revealjs.com/scroll-view/#scrollbar
240+
scrollProgress: $scrollProgress$,
241+
// see https://revealjs.com/scroll-view/#url-activation
242+
scrollActivationWidth: '$scrollActivationWidth$',
243+
// see https://revealjs.com/scroll-view/#scroll-snapping
244+
scrollSnap: '$scrollSnap$',
245+
// Experimental. see https://revealjs.com/scroll-view/#scroll-snapping
246+
scrollLayout: '$scrollLayout$',
247+
$endif$
235248
$if(parallaxBackgroundImage)$
236249

237250
// Parallax background image

src/Text/Pandoc/Writers/HTML.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,11 @@ pandocToHtml opts (Pandoc meta blocks) = do
432432
defField "transitionSpeed" ("default" :: Doc Text) .
433433
defField "backgroundTransition" ("fade" :: Doc Text) .
434434
defField "viewDistance" ("3" :: Doc Text) .
435-
defField "mobileViewDistance" ("2" :: Doc Text)
435+
defField "mobileViewDistance" ("2" :: Doc Text) .
436+
defField "scrollProgress" True .
437+
defField "scrollActivationWidth" ("0" :: Doc Text) .
438+
defField "scrollSnap" ("mandatory" :: Doc Text) .
439+
defField "scrollLayout" ("full" :: Doc Text)
436440
else id) .
437441
defField "document-css" (isNothing mCss && slideVariant == NoSlides) .
438442
defField "quotes" (stQuotes st) .

0 commit comments

Comments
 (0)