marp-generator
v1.0.2
Published
A simple tool to generate HTML and PDF presentations from a directory of MARP markdown files (instead of generating them one at a time).
Maintainers
Readme
marp-generator
A simple tool to generate HTML and PDF presentations from a directory of MARP markdown files (instead of generating them one at a time).
Installation
npm install marp-generatorUsage
import marpGenerate from 'marp-generator';
await marpGenerate({
inputDirectory: './presentations',
outputDirectory: './output',
generatePDFs: true // optional, defaults to false
});Options
inputDirectory(required): Path to directory containing markdown filesoutputDirectory(required): Path to output directorygeneratePDFs(optional): Whether to generate PDF files (default: false)
Features
- Generates HTML presentations from MARP markdown files
- Optionally generates PDF files
- Automatically copies asset directories
- Skips files starting with underscore (useful for unpublished presentations)
Example
Given a directory structure like:
presentations/
├── 01_intro.md
├── 02_topics.md
└── assets/
└── images/The generator will:
- Convert each
.mdfile to HTML (and optionally PDF) - Copy the
assetsdirectory to the output directory - Skip any files starting with
_(e.g.,_template.md)
Requirements
- Node.js 14+ (for ES modules support)
- MARP markdown files with proper frontmatter
License
ISC
