0f09b30164
Introduce a Node.js CLI tool that converts Markdown files to styled
PDFs using `marked` for parsing and `puppeteer` for rendering.
- Add `md-to-pdf.js` as the main conversion script with:
- CLI argument handling for input/output file paths
- Automatic output directory creation alongside the input file
- Pre-processing to strip thematic breaks (`---`) before headings
- Embedded CSS for clean, print-ready styling (headings, tables,
code blocks, blockquotes, page breaks, etc.)
- PDF generation via Puppeteer with A4 format and custom margins
- Add `.gitignore` to exclude `node_modules/` and `output/` directories
- Add `package-lock.json` with resolved dependencies (marked, puppeteer)
22 lines
436 B
JSON
22 lines
436 B
JSON
{
|
|
"name": "markdown-to-pdf",
|
|
"version": "1.0.0",
|
|
"description": "",
|
|
"main": "index.js",
|
|
"scripts": {
|
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "ssh://gitea@192.168.1.62/hykocx/markdown-to-pdf.git"
|
|
},
|
|
"keywords": [],
|
|
"author": "",
|
|
"license": "ISC",
|
|
"type": "commonjs",
|
|
"dependencies": {
|
|
"marked": "^18.0.0",
|
|
"puppeteer": "^24.40.0"
|
|
}
|
|
}
|