Create a Marp presentation site that can be built and published on [GitHub Pages] using this minimal template. The site features:
- Marp integration with CSS variable-based theming
- A GitHub Pages / Actions workflow for build and publish (See a preview)
- A DevContainer/CodeSpace configuration with Marp and Markdown preview extensions
- Support for PDF and PowerPoint export via Marp CLI v4
Feel free to customize the sites created with this template as you like!
- Click "[use this template]" to create a new site.
- Update the content of
slides/Slides.mdwith your own presentation.
This template includes four custom themes in the slides/themes folder:
- custom - A minimal base theme
- custom-default - Based on the built-in default theme (recommended)
- custom-gaia - Based on the built-in gaia theme
- custom-uncover - Based on the built-in uncover theme
All themes support CSS variable customization (Marp v4+ best practice):
:root {
--color-background: #ffffff;
--color-foreground: #333333;
--color-highlight: #0366d6;
--color-dimmed: #6a737d;
}| Class | Description |
|---|---|
lead |
Centered title slide layout |
invert |
Dark theme for emphasis slides |
columns |
Two-column grid layout |
columns3 |
Three-column grid layout |
small |
Smaller text for dense content |
Use with <!-- _class: classname --> directive, or combine: <!-- _class: lead invert -->
Add the theme reference in the frontmatter of your slide deck:
---
marp: true
theme: custom-default
paginate: true
math: mathjax
---For additional themes, add them to the devcontainer and follow the Marp custom theme documentation.
| Directive | Description |
|---|---|
paginate: true |
Enable page numbers (frontmatter) |
math: mathjax |
Enable math equations (frontmatter) |
<!-- _paginate: skip --> |
Skip pagination on current slide |
<!-- _class: lead --> |
Centered title slide |
<!-- _class: invert --> |
Dark theme slide |
 |
Full background image |
 |
Split background (left) |
 |
Split background (right) |
 |
Background with opacity |
# <!--fit--> Text |
Auto-fit text to slide width |
Enable with math: mathjax in frontmatter:
Inline: $E = mc^2$
Block:
$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$Include this script tag once per slide deck to enable Mermaid diagrams:
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true });
</script>Then use Mermaid syntax in a div:
<div class="mermaid">
flowchart LR
A[Start] --> B[End]
</div>- In your GitHub repo, navigate to
Settings>Pages>Build and deployment. - Select
Source:GitHub Actions. - If any Actions failed, go to the
Actionstab and click onRe-run jobs.
- Install Visual Studio Code.
- Install the Marp for VS Code extension.
- Open
slides/Slides.mdin VS Code.
Install Marp CLI for PDF/PPTX export:
npm install -g @marp-team/marp-cli
# Export to PDF
marp --theme-set slides/themes --pdf slides/Slides.md
# Export to PPTX
marp --theme-set slides/themes --pptx slides/Slides.mdNote: Marp CLI v4 requires Node.js 18+ and supports both Chrome and Firefox for rendering.
This repository is licensed under the [MIT License]. Reuse or extend the code as you wish, but include the original license. The deployment GitHub Actions workflow is based on GitHub's starter workflows.