Create slide decks from plain Markdown. Export to HTML, PDF, PPTX, or images via CLI.
bash
# Verify installed
marp --version
# Convert to HTML (default)
marp slides.md -o slides.html
# Convert to PDF (requires Chrome/Edge installed)
marp slides.md --pdf -o slides.pdf
# Convert to PowerPoint
marp slides.md --pptx -o slides.pptx
# Convert to PNG (one image per slide)
marp slides.md --images png
# Watch mode (auto-rebuild on save)
marp -w slides.md
# Serve with live preview
marp -s ./slides-dir
Slides are separated by --- horizontal rulers. Front-matter sets global directives.
markdown
---
marp: true
theme: default
paginate: true
---
# Title Slide
Subtitle text here
---
## Second Slide
- Bullet points
- Work normally
- Standard **markdown**
---
## Third Slide
Code blocks, tables, images — all standard markdown.
Key rule: marp: true in front-matter is required for Marp CLI to process the file.
DirectiveValuesPurposetheme``default, gaia, uncoverBuilt-in themespaginate``true/ falsePage numberssize``16:9 (default), 4:3Slide aspect ratiostyleCSS stringCustom styles for whole deckheadingDivider``1- 6 or arrayAuto-split slides at headings
markdown
<!-- backgroundColor: #1a1a2e -->
<!-- color: white -->
<!-- class: lead -->
<!-- _class: invert --> ← underscore prefix = this slide only (spot directive)
<!-- header: Flash Product Spec -->
<!-- footer: Confidential -->
DirectivePurposebackgroundColorSlide background colorbackgroundImageBackground image URLcolorText colorclassCSS class (persists to following slides)_classCSS class (this slide only)headerHeader textfooterFooter textpaginate``true/ false/ hold/ skip
GitHub markdown style, content vertically centered. Clean for technical docs.
Classic Marp look. Supports lead class (centered) and gaia class (alternate colors).
markdown
<!-- _class: lead --> ← centered title layout
<!-- _class: gaia --> ← alternate color scheme
<!-- _class: lead invert --> ← dark centered
Always centered, minimal. Good for talks.
markdown
<!-- class: invert --> ← dark mode variant
<!-- size: 4:3 --> ← traditional aspect ratio (default is 16:9)
Marp extends standard markdown image syntax with keywords in alt text.
markdown
 <!-- width 200px -->
 <!-- height 150px -->
 <!-- both -->
 <!-- CSS filter -->
 <!-- grayscale filter -->
markdown
 <!-- full slide background -->
 <!-- fit inside slide -->
 <!-- cover entire slide -->
 <!-- alias for contain -->
 <!-- 50% size -->
 <!-- split: image right, content left -->
 <!-- split: image left 40%, content right -->
markdown



<!-- Shows side-by-side -->
markdown

## Architecture
- Component A talks to B
- B stores in database
- C reads from cache
<!-- Image takes 60% right, text takes 40% left -->
markdown
---
marp: true
theme: default
style: |
section {
font-family: 'Inter', sans-serif;
}
section.brand {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
h1 { color: #2d3748; }
img[alt~="center"] {
display: block;
margin: 0 auto;
}
---
markdown
<!-- _class: brand -->
# Branded Slide
This slide uses the custom `brand` class defined in the style block.
bash
# Create theme CSS file, then use with --theme flag
marp slides.md --theme ./custom-theme.css --pdf
Marp doesn't natively render Mermaid. Two approaches:
bash
# Install mermaid CLI
npm install -g @mermaid-js/mermaid-cli
# Render .mmd files to SVG
mmdc -i diagram.mmd -o diagram.svg
# Reference in slides
# 
markdown
---
marp: true
---
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true });
</script>
<div class="mermaid">
graph LR
A[User] --> B[Flash App]
B --> C[API]
C --> D[Database]
</div>
Note: HTML embed only works in HTML output, not PDF/PPTX. Use pre-rendered SVGs for PDF export.
Add notes below --- comment blocks — visible in presenter view, hidden in slides.
markdown
## Slide Title
Content here
<!-- This is a presenter note. Won't appear on slide. -->
<!-- Use marp -s to serve and press P for presenter view. -->
bash
# Basic conversion
marp input.md # → input.html
marp input.md -o output.pdf # → PDF
marp input.md --pptx # → PPTX
marp input.md --images png # → PNG per slide
# Options
marp --pdf --allow-local-files slides.md # Allow local image paths in PDF
marp --html slides.md # Enable HTML tags in markdown
marp --theme ./theme.css slides.md # Custom theme
marp --title "My Deck" slides.md # Set HTML title
# Batch conversion
marp ./slides-dir/ # Convert all .md in directory
# Server + watch
marp -s ./slides-dir # HTTP server with live reload
marp -w slides.md # Watch and rebuild on change
# Configuration file (marp.config.mjs)
# Place in project root — auto-detected by CLI
javascript
export default {
allowLocalFiles: true,
html: true,
themeSet: './themes',
output: './output',
};
markdown
---
marp: true
theme: default
paginate: true
header: "Flash — Product Spec"
footer: "Confidential"
style: |
section { font-size: 24px; }
section.cover { text-align: center; }
section.cover h1 { font-size: 48px; }
---
<!-- _class: cover -->
# Feature: Cashu Flashcards
**Version:** 1.0 · **Date:** 2026-03-19 · **Author:** Product Team
---
## Overview
Brief description of what this feature does and why.
---
## User Flow

1. User opens Flashcard tab
2. Selects amount
3. Confirms creation
4. Receives Cashu token
---
## Architecture

---
## Requirements
| ID | Requirement | Priority |
|----|-------------|----------|
| R1 | Create flashcard from USD wallet | P0 |
| R2 | Redeem flashcard to any Flash user | P0 |
| R3 | Expire after 30 days | P1 |
---
## Open Questions
- [ ] Max flashcard value?
- [ ] Offline redemption support?
MistakeFixForgot marp: trueAdd to front-matter — CLI ignores file without itPDF export failsNeeds Chrome/Chromium/Edge installed. Use --allow-local-files for local imagesMermaid not renderingPre-render to SVG with mmdc, embed as imageBackground image not showingUse  — the bg keyword is requiredStyles not applyingCheck CSS selector — slides are <section> elementsDirectives not workingMust be in HTML comment <!-- key: value --> or front-matterSplit background wrong side = image right;  = image left