Quarto¶
🔍🛠️ Overview¶
Quarto is an open-source scientific and technical publishing system built on Pandoc. It enables the creation of documents, presentations, websites, and reports from plain text files written in markdown and code.
💡 Key Features¶
- Supports multiple output formats: HTML, PDF, Word, reveal.js slides, and more
- Integrates with R, Python, Julia, and Observable JavaScript for reproducible research
- Powerful extension system for custom themes and layouts
- Simple authoring with markdown enhanced by code execution and rich media
- Easy to publish and share documents and presentations
🚀 My Use Case¶
I use Quarto to generate Reveal.js slides more easily for presentations, leveraging its smooth integration of markdown and code.
⚙️ Setup & Configuration¶
Install Quarto locally by following instructions on the official website.
Basic command to render a presentation:
quarto render presentation.qmd --to revealjs
📚 Resources¶
🧠 Notes & Tips¶
- Quarto slides support interactive elements and live code execution, making your presentations engaging.
- Good for combining narrative with data science workflows.
- Can be integrated into CI/CD pipelines for automated presentation updates.
🚀 GitLab CI/CD Demo for Quarto Slides Deployment¶
This GitLab CI/CD pipeline automates the building and deployment of Quarto presentations using Reveal.js on GitLab Pages.
The .gitlab-ci.yml file¶
image: pgalmiche0/defense-presentation-quarto:v1
stages:
- build
- deploy
# Define the build job
build:
stage: build
script:
- cd quarto # Change directory to the 'quarto' folder inside the project
- quarto render index.qmd --to revealjs
artifacts:
paths:
- quarto/_output # Store the '_output' folder for deployment
only:
- main
# Define the deploy job for GitLab Pages
pages:
stage: deploy
script:
- mv quarto/_output public # Move the build output to the 'public' directory for GitLab Pages
artifacts:
paths:
- public
only:
- main
Pipeline Breakdown¶
-
Docker Image:
Uses the pre-built Docker imagepgalmiche0/defense-presentation-quarto:v1
which has Quarto and required dependencies installed. -
Stages:
The pipeline consists of two main stages: - build — Compiles the Quarto presentation into HTML slides.
- deploy — Publishes the generated slides to GitLab Pages.
Jobs Explained¶
- Build Job:
- Changes directory to the
quarto
folder where the source.qmd
files live. - Runs
quarto render index.qmd --to revealjs
to generate the Reveal.js slides. - Saves the
_output
folder as an artifact to be passed to the next stage. -
Runs only on the
main
branch. -
Pages Job:
- Moves the generated
_output
folder topublic
, which is the required folder for GitLab Pages deployment. - Publishes the
public
folder as an artifact. - Runs only on the
main
branch.
Benefits¶
- Automated Workflow: No manual build or deployment steps needed — everything is handled on every push to
main
. - Consistent Environment: Using a Docker image ensures that builds happen in a clean, reproducible environment.
- Instant Updates: Your presentation is always up-to-date and available online via GitLab Pages.
This setup makes it easy to maintain and share your Quarto Reveal.js slides with minimal hassle.