markdown-to-slides

Turn Markdown into interactive slide decks β€” Mermaid diagrams, 6 themes, speaker notes, PDF export, live-reload server, CLI + Docker

GitHubTypeScriptDockerfileJavaScript
πŸ‘ 53 vuesSync GitHub: 10/9/2026
clideveloper-toolsmarkdownmermaidpdf-exportpresentationslidestypescript

md2slides

Universal Markdown to Slides Converter β€” Transform any Markdown file into beautiful interactive presentations with Mermaid diagrams, PDF export, and custom themes.

CI License: MIT Node.js Version TypeScript

Features

  • Markdown-based authoring β€” Write slides in Markdown, separated by ---
  • 6 built-in themes β€” Default, Light, Solarized, Midnight, Minimal, Corporate
  • Mermaid diagrams β€” Render flowcharts, sequence diagrams, and more inline
  • PDF export β€” Export presentations to PDF with a single command
  • Live preview server β€” Hot-reload dev server with WebSocket sync
  • Speaker notes β€” Add notes with <!-- notes: ... --> comments
  • Two-column layouts β€” Split content with ||| separator
  • Code highlighting β€” Syntax highlighting for 190+ languages
  • Frontmatter config β€” Configure title, author, theme, transitions, and more
  • CLI tool β€” Full-featured CLI with init, convert, serve, and themes commands
  • Docker support β€” Run in a container with zero local dependencies

Quick Start

Installation

npm install -g md2slides

Create a presentation

md2slides init my-talk

Preview with live reload

md2slides serve my-talk.md

Export to HTML

md2slides convert my-talk.md -o presentation.html

Export to PDF

md2slides convert my-talk.md -f pdf -o presentation.pdf

Markdown Syntax

Basic slide

# Slide Title

Content goes here

Multiple slides

Separate slides with ---:

# First Slide

Content

---

# Second Slide

More content

Frontmatter configuration

---
title: My Presentation
author: Jane Doe
theme: midnight
transition: fade
width: 1920
height: 1080
---

# Welcome

Speaker notes

# Important Slide

Key content

<!-- notes: Don't forget to mention the Q3 numbers -->

Two-column layout

## Comparison

Left column content

|||

Right column content

Mermaid diagrams

## Architecture

```mermaid
graph TD
    A[Client] --> B[API Gateway]
    B --> C[Service 1]
    B --> D[Service 2]
    C --> E[(Database)]
    D --> E
```

Slide-level configuration

<!-- slide: transition: fade bg: #1a1a2e -->
# Custom Styled Slide

Themes

ThemeDescription
defaultClean dark theme with white text
lightBright theme with dark text on white
solarizedSolarized color scheme β€” warm and readable
midnightDeep midnight blue with soft accents
minimalMinimalist β€” clean and distraction-free
corporateProfessional serif typography

List available themes:

md2slides themes

CLI Reference

md2slides <command> [options]

Commands:
  convert <input>  Convert a Markdown file to a presentation
  serve <input>    Start a dev server with live preview
  themes           List available themes
  init [name]      Create a new presentation from a template

Options:
  -o, --output <path>      Output file path
  -t, --theme <name>       Theme name
  -f, --format <format>    Output format: html or pdf
  --title <title>          Presentation title
  --author <author>        Author name
  --transition <name>      Slide transition effect
  --width <pixels>         Slide width (default: 1280)
  --height <pixels>        Slide height (default: 720)
  -p, --port <port>        Dev server port (default: 3000)
  --no-watch               Disable file watching

Docker

# Build
docker-compose build

# Run dev server
docker-compose up

# Convert to PDF
docker-compose run --rm md2slides convert /presentations/slides.md -f pdf -o /presentations/output.pdf

Development

# Install dependencies
npm install

# Run tests
npm test

# Watch tests
npm run test:watch

# Lint
npm run lint

# Format
npm run format

# Build
npm run build

Project Structure

md2slides/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ cli.ts          # CLI entry point (commander)
β”‚   β”œβ”€β”€ parser.ts       # Markdown β†’ Slide objects
β”‚   β”œβ”€β”€ converter.ts    # Slide objects β†’ Reveal.js HTML
β”‚   β”œβ”€β”€ themes.ts       # Theme definitions
β”‚   β”œβ”€β”€ exporter.ts     # PDF/HTML export (puppeteer)
β”‚   β”œβ”€β”€ server.ts       # Dev server with WebSocket hot reload
β”‚   β”œβ”€β”€ types.ts        # TypeScript interfaces
β”‚   └── web/            # Web assets for dev server
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ parser.test.ts
β”‚   β”œβ”€β”€ converter.test.ts
β”‚   └── fixtures/
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ .github/workflows/
β”‚   └── ci.yml
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── vite.config.ts

License

MIT