Convert Marp Markdown slides to PowerPoint (.pptx) with auto-sizing fonts.
Marp is great for writing slides in Markdown — but its built-in PPTX export produces files with an awkward internal structure that makes them practically unusable for further editing. Shapes are placed in ways that don't match how PowerPoint natively organizes content, text boxes behave unexpectedly, and the overall structure feels like an afterthought rather than a first-class output format.
marp2pptx takes a different approach: instead of converting Marp's HTML rendering to PPTX, it parses the Markdown directly and builds the PowerPoint from scratch using python-pptx. The result is a clean, editable PPTX with properly structured shapes, auto-sized fonts that maximize readability, and full CJK support.
- Auto-sizing: Finds the largest font size that fits without overflow
- CJK support: Full-width / half-width aware text measurement
- ASCII art: Renders code blocks marked with
arch-boxas pixel-perfect images using monospace fonts - Tables: HTML and Markdown table support with wrapping-aware height estimation
- Design config: Externalize colors, fonts, and font ranges to a YAML file
- Overlap detection: Self-check that warns about overlapping shapes
pip install git+https://github.com/ebibibi/marp2pptx.gitFor ASCII art rendering with CJK characters, install a monospace CJK font:
# Ubuntu/Debian
sudo apt install fonts-ipafont-gothic
# Fedora
sudo dnf install ipa-gothic-fontsThe tool auto-detects available fonts (IPAGothic, Noto Sans Mono CJK, MS Gothic, Osaka, DejaVu).
# Basic
marp2pptx slides.md
# Custom output path
marp2pptx slides.md -o presentation.pptx
# Skip overlap check
marp2pptx slides.md --no-checkOr as a Python module:
python -m marp2pptx slides.mdfrom marp2pptx import convert
output_path, slide_count = convert("slides.md")Create a YAML file to customize the design. The tool looks for config in this order:
<input>.yaml(e.g.,slides.yamlforslides.md)marp2pptx.yamlin the same directory- Built-in defaults
Example slides.yaml:
colors:
accent: "#FF6600"
text: "#333333"
fonts:
main: "Arial"
mono: "Courier New"
font_ranges:
default: [40, 14, 36] # [title_max, body_min, body_max]
small: [36, 12, 28]See default.yaml for all available options.
- Marp frontmatter (
---/marp: true) - Slide separators (
---) - Class directives (
<!-- _class: lead -->) - Background images (
) - Headings (h1–h3)
- Bullet lists (nested)
- Markdown and HTML tables
- Code blocks
- ASCII art blocks (
<div class="arch-box">) - Inline formatting: bold, italic,
code, links,<span class="tag-xxx">
MIT