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.2.0.tar.gz (4.3 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.2.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: md2static-0.2.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for md2static-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9963a2a589ffb00fe3dbec75175d402c0839ef023022f08217a34a998ddf29e6
MD5 fd5243289ddea5a5302f924295a0e76a
BLAKE2b-256 229624cc2b44d21fd8afef8794e80a10b78b4a128a0ffbb3bc726cf1150bdc06

See more details on using hashes here.

Provenance

The following attestation bundles were made for md2static-0.2.0.tar.gz:

Publisher: pypi.yml on finsberg/md2static

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: md2static-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for md2static-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98b90783f0b85108f55d9e6ce7f84139a51be4a4bfd84344d9ec5f429f6fe780
MD5 2a4a4cf748a7509e48e90ee53f60fcf0
BLAKE2b-256 5dc52f492e61f3c7bc16dbdd783176223321a68a522474bdcd16034d9ea07a89

See more details on using hashes here.

Provenance

The following attestation bundles were made for md2static-0.2.0-py3-none-any.whl:

Publisher: pypi.yml on finsberg/md2static

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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