This tool converts Markdown files to HTML or PDF with enhanced features including code highlighting, styled tables, and an automatically generated table of contents.
- Convert multiple Markdown files to HTML or PDF
- Generate a single combined output file or individual files for each input
- Syntax highlighting for code blocks
- Professionally styled tables and headers
- Automatic table of contents with clickable links
- Support for different paper sizes when generating PDFs
- Clone or download the repository
- Install the required dependencies:
npm install markdown-it puppeteer commander highlight.js slugifynode index.cjs [options]| Option | Description | Default |
|---|---|---|
-d, --directory <path> |
Directory containing Markdown files | ./markdowns |
-f, --format <type> |
Output format: html or pdf |
html |
-s, --single |
Generate a single output file instead of separate files | false |
-o, --output <path> |
Output directory | output |
-p, --paper <size> |
Paper size for PDF: A4, Letter, or Legal |
A4 |
node index.cjs -d ./docs -f htmlnode index.cjs -d ./docs -f html -snode index.cjs -d ./docs -f pdf -p Letternode index.cjs -d ./docs -f pdf -s -p Legal -o ./documentationThe generated files will be placed in the specified output directory (default: ./output). When using the -s (single) option, the combined output will be named:
- HTML:
combined.html - PDF:
combined.pdf
Without the -s option, each input file will have a corresponding output file with the same name but a different extension (.html or .pdf).
git clone https://github.com/google/material-design-lite.git