aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsliddinbek Azizovich <[email protected]>2025-11-30 17:45:36 +0500
committerGitHub <[email protected]>2025-11-30 13:45:36 +0100
commit094061d946f12961b9af0b400befbb798f980be7 (patch)
treeddb7f89ca31c93fb7a9546c5fce3f1779ad573c4
parent1dcb984453a61cb37d091df7a0fba404207327d3 (diff)
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
-rw-r--r--data/templates/default.revealjs13
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs6
2 files changed, 18 insertions, 1 deletions
diff --git a/data/templates/default.revealjs b/data/templates/default.revealjs
index 78edbae77..5278dd145 100644
--- a/data/templates/default.revealjs
+++ b/data/templates/default.revealjs
@@ -232,6 +232,19 @@ $endif$
// devices. It is advisable to set this to a lower number than
// viewDistance in order to save resources.
mobileViewDistance: $mobileViewDistance$,
+$if(view)$
+
+ // Enable scroll view
+ view: '$view/nowrap$',
+ // see https://revealjs.com/scroll-view/#scrollbar
+ scrollProgress: $scrollProgress$,
+ // see https://revealjs.com/scroll-view/#url-activation
+ scrollActivationWidth: '$scrollActivationWidth$',
+ // see https://revealjs.com/scroll-view/#scroll-snapping
+ scrollSnap: '$scrollSnap$',
+ // Experimental. see https://revealjs.com/scroll-view/#scroll-snapping
+ scrollLayout: '$scrollLayout$',
+$endif$
$if(parallaxBackgroundImage)$
// Parallax background image
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 95aa1ac24..cdfe89879 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -432,7 +432,11 @@ pandocToHtml opts (Pandoc meta blocks) = do
defField "transitionSpeed" ("default" :: Doc Text) .
defField "backgroundTransition" ("fade" :: Doc Text) .
defField "viewDistance" ("3" :: Doc Text) .
- defField "mobileViewDistance" ("2" :: Doc Text)
+ defField "mobileViewDistance" ("2" :: Doc Text) .
+ defField "scrollProgress" True .
+ defField "scrollActivationWidth" ("0" :: Doc Text) .
+ defField "scrollSnap" ("mandatory" :: Doc Text) .
+ defField "scrollLayout" ("full" :: Doc Text)
else id) .
defField "document-css" (isNothing mCss && slideVariant == NoSlides) .
defField "quotes" (stQuotes st) .