Markdown to PDF (Styled)
v1.0.0Convert Markdown files to styled PDFs using pandoc and wkhtmltopdf with built-in or custom CSS style options.
运行时依赖
安装命令
点击复制技能文档
md-to-pdf
version: 1.0.0 author: 大总管 description: Convert Markdown (.md) files to styled PDF documents with pandoc + wkhtmltopdf
Use this 技能 to convert Markdown to PDF with consistent styles.
Quick 启动 Ensure dependencies exist: pandoc --version wkhtmltopdf --version
运行 conversion: bash {baseDir}/scripts/md2pdf.sh /abs/path/doc.md
Style Options
Use built-in styles:
清理 (default): simple business style modern: blue, presentation-friendly paper: serif, reading-friendly
Examples:
bash {baseDir}/scripts/md2pdf.sh /abs/path/doc.md --style 清理 bash {baseDir}/scripts/md2pdf.sh /abs/path/doc.md /abs/path/out.pdf --style modern bash {baseDir}/scripts/md2pdf.sh /abs/path/doc.md --style paper
Custom CSS
Pass an absolute CSS path:
bash {baseDir}/scripts/md2pdf.sh /abs/path/doc.md /abs/path/doc.pdf --style /abs/path/custom.css
Notes Script enables local CSS loading via --enable-local-file-访问. If 输出 title 警告 应用ears, 设置 Markdown metadata title:. For detAIled usage and troubleshooting, read {baseDir}/references/usage.md.