Convert Markdown text or files to professional-looking PDF documents. Uses markdown package to convert MD to HTML, then wkhtmltopdf to generate PDF. Supports code syntax highlighting and custom CSS styling.
pip install markdown pygments
# You also need wkhtmltopdf installed:
# macOS: brew install wkhtmltopdf
# Ubuntu/Debian: sudo apt install wkhtmltopdf
python3 scripts/convert.py input.md output.pdf
python3 scripts/convert.py --css custom.css input.md output.pdf
convert.py - Convert Markdown file to PDF共 1 个版本