Skip to main content

Python utility to convert markdown and html to image

Project description

markdown2image.py

Hippocratic License HL3-FULL

Python utility to convert markdown and html to image using markdown and playwright.

Installing

pip install markdown2image
playwright install chromium

Usage

Just

from markdown2image import sync_api as md2img

md2img.html2image(html_code, save_path)
md2img.html2image(html_code, save_path, width=1080)
md2img.markdown2image(markdown_code, save_path)
md2img.markdown2image(markdown_code, save_path, width=1080)

Or in a running event loop,

from markdown2image import async_api as md2img

async def func():
    await md2img.html2image(html_code, save_path)
    await md2img.html2image(html_code, save_path, width=1080)
    await md2img.markdown2image(markdown_code, save_path)
    await md2img.markdown2image(markdown_code, save_path, width=1080)

See main.py for example code

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

markdown2image-0.0.6.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

markdown2image-0.0.6-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file markdown2image-0.0.6.tar.gz.

File metadata

  • Download URL: markdown2image-0.0.6.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for markdown2image-0.0.6.tar.gz
Algorithm Hash digest
SHA256 be3504c3b3f3e9eece587fc266e105a570b5f85882febf85181aea257c705062
MD5 aa9539991d1370f5ca5844e2c1c8ce08
BLAKE2b-256 9a3ef8787f26dcf4da77ca09b789e225b447f1c40889746cd539f9e924d724fc

See more details on using hashes here.

File details

Details for the file markdown2image-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: markdown2image-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for markdown2image-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 654d05a2c1d34c78c0cec583aeaa81782aa4ba4e055bfee242b9de5690dd5736
MD5 075ae62812ff8426a51dffc78175302a
BLAKE2b-256 94c5e759c4a1ea90f80523ec3a456a759dd23edbe1188273487c90e9bf63633d

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