Skip to main content

md2static

A lightweight command-line tool that converts Markdown files into static PDFs, Images (PNG/JPEG), or HTML with GitHub styling.

It parses the Markdown locally with cmark-gfm (the parser GitHub uses, via cmarkgfm), wraps it in github-markdown-css, and uses a headless browser (Playwright) to capture the styled output.

It is very much inspired by grip.

Install

Install with pip, pipx or uv, e.g

pip install md2static

Note that if you want to output to something different than HTML, then you would also need to install Playwright browser binaries (you only need to do this once), i.e

playwright install chromium

Example usage

HTML

md2static doc.md output.html

PDF

md2static input.md output.pdf

PNG

md2static README.md screenshot.png

License

MIT. Bundles github-markdown-css (MIT, © Sindre Sorhus), see src/md2static/static/LICENSE-github-markdown-css.

Metadata

Release files for md2static 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for md2static 0.4.0
File Size Uploaded Provenance Actions
md2static-0.4.0.tar.gz 12.0 kB With provenance Details for md2static-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for md2static 0.4.0
File Interpreter ABI Platform Actions
md2static-0.4.0-py3-none-any.whl Python 3 none any Details for md2static-0.4.0-py3-none-any.whl

Total release size: 24.1 kB

Release files / md2static-0.4.0.tar.gz

Download URL md2static-0.4.0.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2bf0c8c1882be3abed655f08356c16e30b51dcbb6cc9dcc65730d14ebf3b9d7f
BLAKE2b-256 checksum
How to use checksums
1de858d18cb7708bef661a7e4703704b27dce110e8a7cc937b43b6cdabcf069a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

Release files / md2static-0.4.0-py3-none-any.whl

Download URL md2static-0.4.0-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7441e440357e5ef3263bcce4fd34163ea50cd8785b6c6221dc796fead585cf55
BLAKE2b-256 checksum
How to use checksums
58f5ce38de1417a97f3eb4da421148bcb97c4ea3416a23dc796e63b26e2c7ae4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

Security for md2static 0.4.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for md2static-0.4.0.tar.gz

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 Nov 29, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page