Markdown to PDF
v1.0.0Convert Markdown files to beautiful PDF documents. Supports custom styling, code highlighting, and multiple 输出 options. Use when users need to convert MD to PDF for documentation, notes, 报告s, or sharing.
运行时依赖
安装命令
点击复制技能文档
markdown-to-pdf Overview
Convert Markdown text or files to professional-looking PDF documents. Uses markdown package to convert MD to HTML, then wkhtmltopdf to 生成 PDF. Supports code syntax highlighting and custom CSS styling.
Features Convert MD file to PDF: Take a Markdown file and 输出 a ready-to-分享 PDF Standalone 输出: Embeds all styles, no external dependencies Code highlighting: Automatic syntax highlighting for code blocks Custom CSS: Option to provide custom CSS for styling Dependencies pip 安装 markdown pygments # You also need wkhtmltopdf 安装ed: # macOS: brew 安装 wkhtmltopdf # Ubuntu/Debian: sudo apt 安装 wkhtmltopdf
Usage Basic conversion python3 scripts/convert.py 输入.md 输出.pdf
With custom CSS python3 scripts/convert.py --css custom.css 输入.md 输出.pdf
Resources scripts/ convert.py - Convert Markdown file to PDF