diff --git a/NEWS.md b/NEWS.md index db48a7fa..dca183da 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # rpt (development version) +* Extended `slidebreak` shortcode to support all slide deck formats (RevealJS, PowerPoint, Beamer) using the Quarto `slides` format alias (#103) + * Switched from pkgdown to altdoc for documentation generation. Now using Quarto Website for documentation with native math equation support via MathJax. * Removed pkgdown-specific configurations and workflows. * Retained RevealJS multi-format support for Quarto vignettes and articles. diff --git a/altdoc/_extensions/slidebreak/README.md b/altdoc/_extensions/slidebreak/README.md index 24a1202f..70097e00 100644 --- a/altdoc/_extensions/slidebreak/README.md +++ b/altdoc/_extensions/slidebreak/README.md @@ -8,7 +8,7 @@ This extension is included in the repository. It will be automatically available ## When to Use -Use this extension when you need to create presentations (RevealJS or PowerPoint) from Quarto documents and want to insert slide breaks without titles. This is particularly useful for separating content into distinct slides during presentations. +Use this extension when you need to create presentations (RevealJS, PowerPoint, or Beamer) from Quarto documents and want to insert slide breaks without titles. This is particularly useful for separating content into distinct slides during presentations. **Note**: This extension only affects presentation formats. When rendering to HTML or DOCX for documentation, the shortcode has no effect. @@ -40,7 +40,7 @@ More content here. ## Behavior -- **RevealJS and PowerPoint formats**: Inserts a slide break (`---`), creating a new slide without a title +- **All slide deck formats (RevealJS, PowerPoint, Beamer)**: Inserts a slide break (`---`), creating a new slide without a title - **HTML and DOCX formats**: Does nothing (the shortcode is silently ignored) ## Example @@ -57,7 +57,7 @@ Welcome to the presentation! Here's the main content on a new slide. ``` -In RevealJS or PowerPoint, this will create: +In any slide format (RevealJS, PowerPoint, or Beamer), this will create: 1. A slide titled "Introduction" with content 2. A new blank/untitled slide (from the slidebreak) 3. A slide titled "Main Content" diff --git a/altdoc/_extensions/slidebreak/slidebreak.lua b/altdoc/_extensions/slidebreak/slidebreak.lua index fdde3957..0aa9ce96 100644 --- a/altdoc/_extensions/slidebreak/slidebreak.lua +++ b/altdoc/_extensions/slidebreak/slidebreak.lua @@ -1,18 +1,19 @@ -- slidebreak.lua --- A Quarto shortcode that inserts a slide break in revealjs and powerpoint formats --- but does nothing in docx and html formats +-- A Quarto shortcode that inserts a slide break in all slide deck formats +-- (revealjs, pptx, beamer) but does nothing in docx and html formats function slidebreak() -- Get the current output format + -- See: https://quarto.org/docs/extensions/lua-api.html#format-detection local format = quarto.doc.is_format - -- Insert slide break for revealjs and powerpoint/pptx formats - if format("revealjs") or format("pptx") or format("powerpoint") then - -- Use HorizontalRule which creates a slide separator in RevealJS + -- Insert slide break for all slide/presentation formats (revealjs, pptx, beamer) + if format("revealjs") or format("pptx") or format("beamer") then + -- Use HorizontalRule which creates a slide separator in presentation formats return pandoc.HorizontalRule() end - -- Return empty for html and docx formats (and any other format) + -- Return empty for html and docx formats (and any other non-presentation format) return pandoc.Null() end