Prototype single files for web and slides - #7
Conversation
|
Summary: I adapted the Lua filter and tried it on the draft module on "browser() and reprex()", and it seems to work fine. My main concern is that it makes I'm curious to see how this will work in practice in the long run, but it's true there's a risk of drift between the written content and the slides, so it is nice to have everything in a single file. I thought theming and options would be an issue but it's easy to have format-specific options in the YAML. What I'd do:
Workflow complexityThe workflow seems pretty complicated to me. In particular, I don't understand the purpose of the R script: is this here only to convert qmd files that weren't made with this workflow and therefore need the It just seems to me that steps 2-7 in the workflow you detailed could be replaced by:
This would also require a single Either way, this increases the complexity for people who are not familiar with Quarto, which I think is unavoidable but we should ensure that we have screenshots / screen captures to clearly show how this is supposed to be used. ReadabilityI usually include custom text in slides (bullet points most of the time). I (locally) adapted the Lua filter to have a Example of revamped `index.qmd` in module on browser() and reprex()Small papercut to fix in the current implementation IMO: contiguous becomes It would be nice to have this instead: OtherNot an actionable comment, but I just wanted to point out that Quarto v2 will be welcome here to give good error messages for syntax errors, e.g. when some fenced divs are not closed (currently it warns only). Re:
We could have this: and have a script that copies the Lua script from |
|
Just some clarifying responses:
Just once per module (perhaps this is made confusing by the existence of the original file, which is only here for demonstration purposes). Once it's run on someone's original file, the script should ideally never be used again and the user should just edit the new (or now edited) file.
Ah, yes, based on Lewis's prompting, I designed the script for people who made ONLY the long-form content first. If you make both in parallel, doing it as you describe is likely easier.
See above
Agreed. My thought is that we could have a module that walks people through this process (or just a document). |
This introduces some infrastructure to make a single longform module quarto file render well for both a webpage (
html) and for slides (revealjs). At the moment it uses no external extensions.There are two components:
web_and_slides.R: this script can be used to convert a standard longform quarto file to one that supports webpage/slides rendering::: {.narration}, which is treated as notes for revealjs and as normal prose for htmlweb_and_slides.luafilter to the yaml front matter if it isn't there (see # 2 below)execute: output-location: fragmentandexecute: echo: trueto the yaml front matter; this ensures that code chunk output is included in the slides and is added as fragments (separate slides) by defaultrevealjs.smaller = trueto the yaml front matter: this ensures that figures shrink to fit on slides#header with text after it)web_and_slides.lua: contains various filters and processing steps that alter the way the quarto file is rendered to slides.narration(notes for slides, prose for webpage)##) are promoted so each becomes its own slidefragmentfunctionality)So the general workflow would look something like this:
web_and_slides.R.narrationwherever text should be shown on slides verbatimRendered webpage:
https://palaeoverse.org/modules/pr-preview/pr-7/training/modules/ggplot/index.html
Rendered slides:
https://palaeoverse.org/modules/pr-preview/pr-7/training/modules/ggplot/index-slides.html
TODO:
.narrationusageNote that the script and .lua filter were generated iteratively over the course of a substantial conversation with Claude. The original module file was made entirely by me, and I've reviewed all of the code along the way.