markpaper
v0.1.1
Published
Beautiful Markdown to PDF converter with automatic page breaks, Mermaid support, and Japanese font handling
Maintainers
Readme
MarkPaper
Beautiful Markdown to PDF converter with automatic page breaks, Mermaid diagrams, and Japanese font support
Concept
A tool that converts your everyday Markdown into beautiful PDFs that are familiar and appealing to paper-culture people with just one command.
Features
- Automatic Page Breaks: Smart page breaks based on headings, ensuring text never breaks in the middle of a sentence
- Beautiful Fonts: Free font specification support including Japanese and multibyte characters
- Mermaid Support: Automatic conversion of Mermaid diagrams into beautiful graphics
- Easy-to-use CLI: One-command PDF generation with configuration file support
Installation
Global Installation (Recommended)
npm install -g markpaperLocal Installation
npm install markpaperUsing npx (without installation)
npx markpaper input.mdUsage
Basic Usage
markpaper input.md
# → Generates input.pdfWith Options
markpaper input.md -o output.pdf --font "Noto Sans CJK JP"Using Configuration File
# Create markpaper.config.js or .markpaper.json
markpaper input.md --config markpaper.config.jsConfiguration
Configuration File Example (markpaper.config.js)
module.exports = {
output: 'output.pdf',
font: {
main: 'Noto Sans CJK JP',
mono: 'Source Code Pro'
},
pageBreak: {
beforeH1: true,
beforeH2: false
},
mermaid: {
theme: 'default',
width: 800
}
}Technical Specifications
- PDF Generation Engine: Vivliostyle
- Implementation Language: TypeScript
- Mermaid Rendering: Puppeteer + mermaid.js
- Font Support: System fonts + embedded font support
Development
git clone https://github.com/your-username/markpaper.git
cd markpaper
npm install
npm run devLicense
MIT
Contributing
PRs and Issues are welcome.
