Skip to main content

A CLI tool to convert Markdown to html, PDF or Image using GitHub's API

Project description

md2static

A lightweight command-line tool that converts Markdown files into static PDFs, Images (PNG/JPEG), or HTML using the official GitHub Markdown API for pixel-perfect styling.

It leverages GitHub's API to parse the Markdown into HTML, wraps it in the official GitHub 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

md2static-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

md2static-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file md2static-0.1.0.tar.gz.

File metadata

  • Download URL: md2static-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for md2static-0.1.0.tar.gz
Algorithm Hash digest
SHA256 25ae80a97195ca383c2e8a0c77c7965be1d9d3c8cfb46c55ccc87c2379932a1a
MD5 efa3768406a91ef8320c3d61af0824c9
BLAKE2b-256 f6fec0565b23cba8a4d8c73d067a02ff5a9b8b1fa881253971e40e1c6ce51608

See more details on using hashes here.

File details

Details for the file md2static-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: md2static-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for md2static-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 138dcb47fd43265646343c5ddcde1a18c1bb73c87910d4f7332cdf1c99775fc8
MD5 193fee9435fe02ea71a8f59306f69931
BLAKE2b-256 a7fcac560e22be323b54864fc74b20400e643c1ff0ac07e175c661791de0b9bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page