- Marp: Markdown Presentation Ecosystem
- Introduction https://marketplace.visualstudio.com/items?itemName=marp-team.marp-vscode
import Marpit from '@marp-team/marpit' import fs from 'fs'
// 1. Create instance (with options if you want) const marpit = new Marpit()
// 2. Add theme CSS const theme = ` /* @theme example */
section { background-color: #369; color: #fff; font-size: 30px; padding: 40px; }
h1, h2 { text-align: center; margin: 0; }
h1 { color: #8cf; } ` marpit.themeSet.default = marpit.themeSet.add(theme)
// 3. Render markdown const markdown = `
Marpit is the skinny framework for creating slide deck from Markdown.
You can convert into PDF slide deck through Chrome.
` const { html, css } = marpit.render(markdown)
// 4. Use output in your HTML const htmlFile = `
<style>${css}</style> ${html} ` fs.writeFileSync('example.html', htmlFile.trim())