From 926fb881a787a80c8a2a4d8bb9250166d21d7a76 Mon Sep 17 00:00:00 2001 From: George Stagg Date: Thu, 19 Sep 2024 14:38:47 +0100 Subject: [PATCH] Make reveal.js slides with live cells scrollable Closes #67. --- NEWS.md | 2 ++ _extensions/live/live.lua | 4 +-- _extensions/live/resources/live-runtime.css | 2 +- _extensions/live/resources/live-runtime.js | 8 +++--- _extensions/live/templates/pyodide-setup.ojs | 5 ++++ _extensions/live/templates/webr-setup.ojs | 5 ++++ docs/other/slides.qmd | 26 +++++++++++++------- live-runtime/src/css/reveal.css | 7 ++++++ live-runtime/src/evaluate-pyodide.ts | 14 ++++++++--- live-runtime/src/evaluate-webr.ts | 13 +++++++--- 10 files changed, 64 insertions(+), 22 deletions(-) diff --git a/NEWS.md b/NEWS.md index 0cb5673..2bfd35b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,8 @@ * Setup blocks may now be attached to multiple exercises by providing a list for the `exercise` cell option. +* Reveal.js slides containing live cells are now automatically made scrollable (#67). + ## Breaking changes * Previously the cell option `autorun` defaulted to `true` for "sandbox" type cells, but `false` for exercises. This has been found to be confusing, and so `autorun: false` is now always the default state. Autorun may still be enabled by setting the cell option directly, or set document-wide using the `cell-options` YAML header. diff --git a/_extensions/live/live.lua b/_extensions/live/live.lua index f15ae22..08c29c6 100644 --- a/_extensions/live/live.lua +++ b/_extensions/live/live.lua @@ -272,7 +272,7 @@ function PyodideCodeBlock(code) append_ojs_template(ojs_source, ojs_vars) return pandoc.Div({ - pandoc.Div({}, pandoc.Attr("pyodide-" .. block_id)), + pandoc.Div({}, pandoc.Attr("pyodide-" .. block_id, { 'exercise-cell' })), pandoc.RawBlock( "html", "