Converting Markdown to HTML, PDF & Slides (Marp/Pandoc)
One of Markdown's greatest superpowers is its format portability. Because Markdown represents semantic document structure in plain text, you can write once and convert into professional printable PDFs, eBook formats (ePub), technical documentation sites, or even animated slide decks!
1. Pandoc (The Universal Document Swiss Army Knife)
Pandoc is the undisputed industry standard command-line document converter. It can convert Markdown into virtually any existing format:
Common Pandoc Commands:
2. Marp (Markdown Presentation Ecosystem)
Creating slides in PowerPoint often wastes hours on manual alignment and font adjustments. Marp allows you to build stunning presentation slide decks entirely in Markdown!
How Marp Works:
Separate your slides using horizontal rules (---):
Exporting Marp Slides:
With the Marp for VS Code extension, you can export your slide deck to PDF, HTML, or PowerPoint PPTX with a single click!
Multiple Choice Questions
1. Which command-line tool is widely known as the 'Swiss Army Knife' of document conversion?
A. Pandoc B. FFmpeg C. ImageMagick D. Webpack Answer: A Explanation: Pandoc is the premier universal document converter capable of translating Markdown into HTML, PDF, Word, ePub, and more.
2. In Marp presentation syntax, what delimiter separates individual slide pages?
A. Horizontal rules (---) B. Double dollar signs ($$) C. Semicolons (;;;) D. At signs (@@@) Answer: A Explanation: Marp uses standard Markdown horizontal divider lines (---) to demarcate individual slide boundaries.
3. Which Marp YAML frontmatter setting enables automatic slide page numbering?
A. paginate: true B. numbers: on C. count: yes D. page: auto Answer: A Explanation: Setting 'paginate: true' in the Marp frontmatter instructs the slide compiler to render page numbers on each slide.
4. What output formats can Marp export slide decks into?
A. Only plain text B. HTML, PDF, and Microsoft PowerPoint (.pptx) C. MP3 audio files only D. Binary firmware files Answer: B Explanation: Marp exports Markdown presentations to interactive HTML, printable PDF slides, or editable PowerPoint PPTX presentations.
5. What flag tells Pandoc to generate a complete standalone HTML document with <head> and <body> tags?
A. -s (or --standalone) B. -r C. -f D. -x Answer: A Explanation: The -s (--standalone) flag instructs Pandoc to output a complete valid HTML document with metadata rather than a fragment.
Capstone Project: Complete Project Documentation Portal
Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
Related Lessons
| Previous Lesson | Next Lesson |
|---|---|
| Linting & Formatting with markdownlint & Prettier | Capstone Project: Complete Project Documentation Portal |
Practice Quiz
Test your understanding of this lesson with 5 questions. Each question has one correct answer.