Markprint
Markprint is a beautiful, configurable, extensible Markdown-to-PDF renderer for Python.
It is built for developers who want polished PDFs from Markdown without giving up control over themes, profiles, syntax highlighting, document metadata, batch rendering, logging, or advanced rendering backends.
Markdown source
-> frontmatter and config
-> parsed document model
-> HTML body
-> themed printable HTML
-> PDF artifact
Why Markprint?
Markdown-to-PDF tooling often falls into two extremes. Some tools are easy but plain. Others are powerful but heavy, requiring Pandoc, LaTeX, browser automation, or lots of project-specific glue. Markprint aims for a better middle path:
- simple by default,
- beautiful out of the box,
- deeply configurable when needed,
- extensible through clean rendering stages,
- useful as both a CLI and Python library.
Installation
pip install markprint
With optional extras:
pip install "markprint[logging]"
pip install "markprint[browser]"
pip install "markprint[pandoc]"
pip install "markprint[pdf]"
For local development:
pdm install -G dev -G test -G docs
Quickstart
Render a Markdown file to PDF:
markprint README.md README.pdf
Render raw Markdown:
markprint render-string "# Hello Markprint" --output hello.pdf
Render from stdin:
echo "# Hello from stdin" | markprint - hello.pdf
Compile multiple Markdown files into one PDF:
markprint compile docs/intro.md docs/usage.md docs/api.md --output manual.pdf
Python API
from pathlib import Path
from markprint import RenderOptions, render_pdf
render_pdf(
source=Path("README.md"),
output=Path("README.pdf"),
options=RenderOptions(theme="github", profile="docs", toc=True),
)
Raw Markdown:
from markprint import render_pdf
render_pdf(
markdown="# Hello
This is **raw Markdown**.",
output="hello.pdf",
)
Documentation
- Documentation: https://markprint.readthedocs.io/
- PyPI: https://pypi.org/project/markprint/
- Repository: https://github.com/pr1m8/markprint
Core features
- Markdown file, raw string, stdin, batch, and multi-file input
- YAML frontmatter and project config support
- Themeable Jinja HTML templates
- Pygments syntax highlighting
- WeasyPrint backend by default
- Optional Playwright and Pandoc backends
- Optional ultilog logging integration
- PDF helper extension points
- Plugin-oriented architecture
Development
pdm install -G dev -G test -G docs
pdm run ruff check .
pdm run ruff format --check .
pdm run pytest --cov=markprint --cov-report=term-missing
pdm run mkdocs build --strict
License
MIT.
Metadata
Release files for markprint 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| markprint-0.1.6.tar.gz | 32.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| markprint-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 84.5 kB
Release files / markprint-0.1.6.tar.gz
| Download URL | markprint-0.1.6.tar.gz |
|---|---|
| Size | 32.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f6369c990eec9092b908c040dc00bb0aa3cec0865279b485cd52f7394a164df
|
|
BLAKE2b-256 checksum How to use checksums |
1b0a8c944993824837ac29cbef22c9b23d0a00f618b1fdbf87ac369872f6781f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 1, 2026.
Transparency logRelease files / markprint-0.1.6-py3-none-any.whl
| Download URL | markprint-0.1.6-py3-none-any.whl |
|---|---|
| Size | 51.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9042a0aaac052522cf70847c97b47d3027f5c0eaf060fd19e2a3dd6919ddd468
|
|
BLAKE2b-256 checksum How to use checksums |
c1d35671ff3953fd0e0f51be48c11481ff559fe2208b72b8d07f5b02a5b48551
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 1, 2026.
Transparency log