mkdocs-md-to-pdf
Convert Markdown files to styled PDFs using MkDocs Material theme and Playwright.
Features
- Material Design styling via MkDocs Material theme
- Syntax highlighting for code blocks
- Mermaid diagram support
- PlantUML diagram support (requires Java)
- Admonitions and callouts
- Automatic handling of linked images and files
Installation
# Using uv
uv add mkdocs-md-to-pdf
# Using pip
pip install mkdocs-md-to-pdf
After installation, install the Chromium browser for Playwright:
playwright install chromium
PlantUML Setup
macOS
- Download PlantUML JAR from GitHub releases
- Place JAR:
mv plantuml-mit-1.2025.8.jar ~/.local/bin/plantuml.jar - Make executable:
chmod +x ~/.local/bin/plantuml.jar - Add to shell profile (.bashrc/.zshrc):
export PATH="$PATH:~/.local/bin"
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
Ubuntu/Debian
sudo apt install default-jdk plantuml
Usage
Command Line
# Output to stdout (pipe to file)
md-to-pdf document.md > output.pdf
# Output to specific file
md-to-pdf document.md -o output.pdf
Python API
from mkdocs_md_to_pdf import convert
# Get PDF as bytes
pdf_bytes = convert("document.md")
# Write directly to file
convert("document.md", output_file="output.pdf")
Supported Markdown Features
- Standard Markdown syntax
- Fenced code blocks with syntax highlighting
- Tables
- Admonitions (
!!! note,!!! warning, etc.) - Callouts (
> [!NOTE],> [!WARNING]) - Mermaid diagrams
- PlantUML diagrams
- Linked images (relative paths)
License
MIT
Metadata
Release files for mkdocs-md-to-pdf 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mkdocs_md_to_pdf-0.1.3.tar.gz | 4.2 kB | Without provenance | Details for mkdocs_md_to_pdf-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mkdocs_md_to_pdf-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for mkdocs_md_to_pdf-0.1.3-py3-none-any.whl |
Total release size: 10.1 kB
Release files / mkdocs_md_to_pdf-0.1.3.tar.gz
| Download URL | mkdocs_md_to_pdf-0.1.3.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e88dc7989f1f9f3583bd4b8058296cea33cf92b92090d684e536c958a9652b0
|
|
BLAKE2b-256 checksum How to use checksums |
e4eb2f8d0b64e4f5a4998d7cfc3ac1f146840997f4ecd5b5bd6f361bbaa8ddd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / mkdocs_md_to_pdf-0.1.3-py3-none-any.whl
| Download URL | mkdocs_md_to_pdf-0.1.3-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52907372ed1fa1ac08e3e0193b237a5ce71a7d34786323b86ba34f2dca67f854
|
|
BLAKE2b-256 checksum How to use checksums |
3d9d2ebb8ecec5778ccb85731674d02e1c3da3a12f25bfe5de529e966d8f5b45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for mkdocs-md-to-pdf 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.