A production-ready system for hosting multiple Marp (Markdown Presentation Ecosystem) slide decks with automated GitHub Pages deployment and an mdbook-powered landing page.
Once deployed, your presentations will be available at:
- Documentation Site:
https://<username>.github.io/<repo-name>/ - Individual Presentations:
https://<username>.github.io/<repo-name>/presentations/<deck-name>/
- π Markdown-based presentations - Write slides in simple Markdown
- π mdbook documentation site - Professional, searchable landing page
- π¨ Rich content support - Code highlighting, Mermaid diagrams, images, custom CSS
- π Automated deployment - Push to main, get live presentations automatically
- π Multiple decks - Host unlimited presentations in a single repository
- π Full-text search - Search across all presentations and documentation
- π― Auto-discovery - Build script automatically finds and builds all presentations
.
βββ .github/
β βββ workflows/
β βββ pages.yml # GitHub Actions deployment workflow
βββ book/
β βββ src/
β βββ SUMMARY.md # mdbook table of contents
β βββ README.md # Documentation homepage
β βββ presentations.md # Auto-generated list of presentations
βββ presentations/ # All presentations live here
β βββ demo/
β βββ slides.md # Slide content in Markdown
β βββ assets/ # Images and other media
β βββ .gitkeep
β βββ placeholder.svg
βββ scripts/
β βββ build.sh # Build orchestration script
βββ site/ # Generated output (gitignored)
βββ book.toml # mdbook configuration
βββ .gitignore
βββ .marprc.yml # Marp configuration
βββ README.md
-
Clone the repository:
git clone <your-repo-url> cd <repo-name>
-
Build all presentations and documentation:
./scripts/build.sh
-
Preview locally:
npx serve site # Or use mdbook's built-in server: # mdbook serve
Open http://localhost:3000 (or the port shown) in your browser.
-
Create directory structure:
mkdir -p presentations/my-talk/assets
-
Create your slides: Create
presentations/my-talk/slides.md:--- marp: true theme: default paginate: true --- # My Presentation Title Your first slide content here. --- ## Second Slide More content...
-
Add assets (optional): Place images in
presentations/my-talk/assets/and reference them:
-
Build and test:
./scripts/build.sh npx serve site
Your new presentation will automatically appear in the "Available Presentations" page!
-
Commit and push:
git add presentations/my-talk git commit -m "Add my-talk presentation" git push origin main
Your presentation will be automatically deployed to GitHub Pages!
Include diagrams using Mermaid.js (client-side rendering):
<!-- Load Mermaid.js once at the top of your slides -->
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true, theme: 'default' });
</script>
<!-- Then use diagrams anywhere -->
<div class="mermaid">
graph LR
A[Start] --> B[Process]
B --> C[End]
</div>Available themes: default, neutral, dark, forest, base
Marp supports syntax highlighting for many languages:
```python
def hello_world():
print("Hello, Marp!")
```Supported languages include: JavaScript, Python, Rust, Go, Java, C++, Ruby, and many more.
Add custom CSS within your slides:
<style>
h1 {
color: #667eea;
}
</style>Or use directives for slide-specific styling:
<!-- _class: lead -->
# This slide uses the "lead" classEdit files in book/src/ to customize the documentation:
SUMMARY.md- Table of contents and navigation structureREADME.md- Homepage contentpresentations.md- Auto-generated, but you can add content before/after the listbook.toml- mdbook configuration (themes, search, etc.)
The build script automatically updates the presentations list in presentations.md.
mdbook configuration:
[book]
title = "Presentations"
language = "en"
[output.html]
default-theme = "light"
preferred-dark-theme = "navy"
git-repository-url = "https://github.com/YOUR_USERNAME/YOUR_REPO"Update the git-repository-url with your repository URL.
Global Marp configuration:
html: true # Required for Mermaid diagrams
options:
markdown:
breaks: true # Convert line breaks to <br>The build script:
- Scans
presentations/for directories withslides.md - Builds each presentation with Marp CLI
- Generates
presentations.mdwith links to all decks - Builds the mdbook documentation site
- Copies presentations into the mdbook output
Customization: Modify the script to add PDF export, custom themes, or additional processing.
-
Enable GitHub Pages:
- Go to your repository on GitHub
- Navigate to Settings β Pages
- Under Source, select GitHub Actions
-
Update
book.toml:- Edit
book.tomland replaceYOUR_USERNAMEandYOUR_REPOwith your GitHub username and repository name
- Edit
-
Push to main:
git push origin main
-
Monitor deployment:
- Go to the Actions tab
- Watch the "Deploy Marp Presentations to GitHub Pages" workflow
- Once complete, your site will be live!
Trigger a deployment manually from the Actions tab:
- Go to Actions
- Select "Deploy Marp Presentations to GitHub Pages"
- Click Run workflow
Install mdbook:
cargo install mdbookEnsure your presentation directory contains a slides.md file:
ls presentations/my-talk/slides.md- Verify images are in the
assets/directory - Use relative paths:
 - Check file extensions match exactly (case-sensitive on Linux)
- Ensure
html: trueis set in.marprc.yml - Verify the Mermaid script tag is at the top of your slides
- Check browser console for JavaScript errors
The presentations are standalone HTML files generated by Marp. If you're seeing issues:
- Make sure you're accessing the presentation at
presentations/<deck>/index.html - Check that assets were copied correctly to
site/presentations/<deck>/assets/ - Verify the Marp CLI generated valid HTML (check file size > 0)
- Ensure GitHub Pages source is set to GitHub Actions (not a branch)
- Check that the workflow completed successfully in the Actions tab
- Verify mdbook is properly installed in CI (check workflow logs)
- Wait a few minutes - deployments can take time to propagate
- Clear your browser cache or try incognito mode
Contributions are welcome! To add features or fix bugs:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Test locally:
./scripts/build.sh && npx serve site - Commit:
git commit -m "Add my feature" - Push:
git push origin feature/my-feature - Open a Pull Request
This repository structure and build system are provided as-is. Feel free to use and modify for your own presentations.
| Task | Command |
|---|---|
| Build all presentations | ./scripts/build.sh |
| Preview locally | npx serve site or mdbook serve |
| Create new deck | mkdir -p presentations/<name>/assets && touch presentations/<name>/slides.md |
| Deploy to GitHub Pages | git push origin main |
| Manual deployment | GitHub Actions tab β Run workflow |
| Edit documentation | Edit files in book/src/ |
Built with β€οΈ using Marp, mdbook, and GitHub Actions