Skip to content

Extract slidebreak shortcode into standalone Quarto extension with live demo - #1

Merged
d-morrison merged 10 commits into
mainfrom
copilot/extract-slidebreak-shortcode
May 5, 2026
Merged

d-morrison merged 10 commits into
mainfrom
copilot/extract-slidebreak-shortcode

Conversation

Copilot AI commented May 5, 2026 •

Copy link
Copy Markdown
Contributor

Extracts the slidebreak shortcode from UCD-SERG/rpt into an independent, installable Quarto extension, following the structure of d-morrison/equation-anchors.

Extension structure

  • _extensions/slidebreak/_extension.yml — metadata: name, author, version, quarto-required, shortcode declaration
  • _extensions/slidebreak/slidebreak.lua — shortcode implementation: emits HorizontalRule (slide separator) for revealjs/pptx/beamer; no-op for all other formats

Supporting files

  • example.qmd — dual-format demo: renders to HTML (index.html, default view) and RevealJS (example-slides.html); includes a "View as slides" button linking between the two
  • _quarto.yml — Quarto project config; sets output-dir: _site
  • README.md — installation/usage docs
  • .gitignore — excludes Quarto build artifacts

GitHub Actions workflows

Adapted from d-morrison/equation-anchors (R setup and complex Python diff/highlighting scripts were omitted — slidebreak has no R or Python dependencies):

  • .github/workflows/publish.yml — triggers on push to main and workflow_dispatch; sets up Quarto, renders example.qmd, and deploys to GitHub Pages via JamesIves/github-pages-deploy-action
  • .github/workflows/preview.yml — triggers on PR open/reopen/synchronize/close; renders and deploys a live PR preview to the gh-pages branch using rossjrw/pr-preview-action, with a sticky PR comment linking to the preview URL
  • .github/workflows/copilot-setup-steps.yml — preinstalls Quarto for Copilot agent sessions

Note: To enable the live demo, ensure GitHub Pages is configured to deploy from the gh-pages branch in the repository settings.

Usage

Install into any Quarto project:

quarto add d-morrison/slidebreak

Then use in a presentation document:

---
filters:
  - d-morrison/slidebreak
---

## Slide One

Content here.

{{< slidebreak >}}

## Slide Two

More content.

The shortcode has no effect in non-presentation formats (HTML, DOCX).

Original prompt

follow instructions in https://quarto.org/docs/extensions/shortcodes.html to extract the slidebreak shortcode from https://github.com/UCD-SERG/rpt into an independent quarto extension; see https://github.com/d-morrison/equation-anchors as an example

Agent-Logs-Url: https://github.com/d-morrison/slidebreak/sessions/2873edd9-08ef-4309-b444-e91184749190

Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Copilot AI changed the title [WIP] Extract slidebreak shortcode into independent Quarto extension Extract slidebreak shortcode into standalone Quarto extension May 5, 2026
Copilot AI requested a review from d-morrison May 5, 2026 02:02
@d-morrison

Copy link
Copy Markdown
Collaborator

@copilot adapt github actions workflows from https://github.com/d-morrison/equation-anchors and configure the repo to deploy example.qmd as a live demo

@d-morrison
d-morrison removed their request for review May 5, 2026 02:08
@d-morrison
d-morrison marked this pull request as ready for review May 5, 2026 02:08
Copilot AI and others added 2 commits May 5, 2026 02:10

Copilot AI commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot adapt github actions workflows from https://github.com/d-morrison/equation-anchors and configure the repo to deploy example.qmd as a live demo

Done in commit 2ea4d38. Three workflows have been added, adapted from d-morrison/equation-anchors:

  • publish.yml — triggers on push to main (and workflow_dispatch); sets up Quarto, renders example.qmd, and deploys to GitHub Pages via JamesIves/github-pages-deploy-action
  • preview.yml — triggers on PR open/reopen/synchronize/close; renders and deploys a live PR preview to the gh-pages branch using rossjrw/pr-preview-action, with a sticky PR comment linking to the preview URL
  • copilot-setup-steps.yml — preinstalls Quarto for Copilot agent sessions

R setup and the complex Python diff/highlighting scripts from equation-anchors were omitted since slidebreak has no R or Python dependencies. One bug from the upstream template was also fixed: the env.deployment_status condition on the sticky comment steps was dropped (that variable was never set, which caused both comment steps to always be skipped).

To enable the live demo, ensure GitHub Pages is configured to deploy from the gh-pages branch in the repository settings.

Copilot AI changed the title Extract slidebreak shortcode into standalone Quarto extension Extract slidebreak shortcode into standalone Quarto extension with live demo May 5, 2026
Copilot AI requested a review from d-morrison May 5, 2026 02:12
@d-morrison

Copy link
Copy Markdown
Collaborator

@d-morrison
d-morrison removed their request for review May 5, 2026 02:36
…e step to publish workflow

Agent-Logs-Url: https://github.com/d-morrison/slidebreak/sessions/d9c76d59-16b2-4f8c-9e1b-0e53e4d31f74

Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>

Copilot AI commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix https://github.com/d-morrison/slidebreak/actions/runs/25354174267/job/74339890730?pr=1

Fixed in commit 20de4e2.

The root cause: quarto render . on a directory with no _quarto.yml exits 0 but creates no files (no-op), so the resolve step never found any output.

Fix: added _quarto.yml with project: output-dir: _site, making this a proper Quarto project. Now quarto render . renders example.qmd into _site/, which both the publish and preview workflows pick up on the first _site/ directory check.

Also added an "Ensure index page exists" step to publish.yml (matching what preview.yml already had) so the GitHub Pages root URL resolves directly to the rendered presentation.

Copilot AI requested a review from d-morrison May 5, 2026 02:41
@d-morrison

Copy link
Copy Markdown
Collaborator

@copilot set up the example page so html and revealjs both render, and html is default view

Copilot AI commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot set up the example page so html and revealjs both render, and html is default view

Done in commit 06346bc.

example.qmd now renders both formats:

  • HTML → index.html (default view at the site root)
  • RevealJS → example-slides.html

A "View as slides" button on the HTML page links to the presentation. The HTML output is explicitly named index.html so it's always the landing page, avoiding any ambiguity with filesystem sort order.

@d-morrison
d-morrison merged commit a55d335 into main May 5, 2026
2 checks passed
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-05-05 03:13 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants