A .NET library for converting CommonMark markdown to Microsoft PowerPoint (.pptx) presentations with syntax highlighting. Supports headings as slide titles, paragraphs, code blocks with syntax highlighting, links, images, lists, tables, and more.
$ dotnet add package SpecWorks.MarkMyDeckA .NET library for converting CommonMark/GitHub Flavored Markdown to Microsoft PowerPoint (.pptx) presentations. The library targets .NET Standard 2.1 and .NET 10, and the CLI targets .NET 10.
✅ Slide Generation
# H1 and ## H2 headings create new slides### H3 through ###### H6 render as styled text on the current slide--- (thematic breaks) force a new slide✅ Block Elements
# H1 through ###### H6)>)---, ***, ___) as slide separators✅ Inline Elements
**text** or __text__)*text* or _text_)***text***)`code`)[text](url)))✅ Styling
dotnet add package SpecWorks.MarkMyDeck
using MarkMyDeck;
// Convert markdown string to .pptx file
string markdown = "# Hello World\n\nThis is **bold** text.\n\n---\n\n# Slide 2\n\n- Item 1\n- Item 2";
MarkdownConverter.ConvertToPptx(markdown, "output.pptx");
byte[] pptxBytes = MarkdownConverter.ConvertToPptxBytes(markdown);
using var inputStream = File.OpenRead("input.md");
using var outputStream = File.Create("output.pptx");
MarkdownConverter.ConvertToPptx(inputStream, outputStream);
await MarkdownConverter.ConvertToPptxAsync(markdown, "output.pptx");
using MarkMyDeck.Configuration;
var options = new ConversionOptions
{
Styles = new SlideStyleConfiguration
{
DefaultFontName = "Arial",
DefaultFontSize = 20,
TitleFontSize = 40,
TitleColor = "2E74B5",
CodeFontName = "Fira Code",
CodeFontSize = 16,
CodeBackgroundColor = "282C34"
},
DocumentTitle = "My Presentation",
Author = "John Doe"
};
MarkdownConverter.ConvertToPptx(markdown, "styled.pptx", options);
MarkMyDeck includes a CLI for converting markdown files from the command line.
dotnet tool install --global SpecWorks.MarkMyDeck.CLI
Or run directly from the project:
dotnet run --project src/MarkMyDeck.CLI/MarkMyDeck.CLI.csproj -- convert -i input.md
# Basic conversion
markmydeck convert -i README.md
# Specify output file
markmydeck convert -i input.md -o output.pptx
# Custom font and size
markmydeck convert -i document.md --font "Arial" --font-size 20
# With title metadata
markmydeck convert -i document.md --title "My Presentation"
# Verbose output
markmydeck convert -i document.md -v
# Force overwrite
markmydeck convert -i document.md --force
# View version
markmydeck version
| Option | Alias | Description |
|---|---|---|
--input | -i | Input markdown file path (required) |
--output | -o | Output file path (default: same name with .pptx) |
--verbose | -v | Enable verbose output |
--force | - | Overwrite output file if it exists |
--font | -f | Default font name |
--font-size | -s | Default font size (6-72 points) |
--title | -t | Presentation title metadata |
MarkMyDeck uses a three-stage conversion pipeline:
# H1 and ## H2 headings create new slides### H3 through ###### H6 are rendered as styled text within the current slide--- thematic breaks force a new slideMarkMyDeck/
├── src/
│ ├── MarkMyDeck/ # Core library (netstandard2.1;net10.0)
│ │ ├── MarkdownConverter.cs # Public API
│ │ ├── Converters/
│ │ │ ├── OpenXmlPresentationRenderer.cs # Main renderer
│ │ │ ├── BlockRenderers/ # Block element renderers
│ │ │ └── InlineRenderers/ # Inline element renderers
│ │ ├── SyntaxHighlighting/ # Syntax highlighting
│ │ ├── OpenXml/
│ │ │ ├── PresentationBuilder.cs # OpenXML presentation builder
│ │ │ └── SlideManager.cs # Slide content management
│ │ └── Configuration/ # Configuration classes
│ └── MarkMyDeck.CLI/ # Command-line tool (net10.0)
└── tests/
└── MarkMyDeck.Tests/ # Unit tests (net10.0)
git clone https://github.com/spec-works/MarkMyDeck.git
cd MarkMyDeck/dotnet
dotnet build
dotnet test
MIT License