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.8.3.tar.gz (10.2 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.8.3-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: markdown2image-0.0.8.3.tar.gz
  • Upload date:
  • Size: 10.2 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.8.3.tar.gz
Algorithm Hash digest
SHA256 d3febf2a6d3808f8fca9cbbf79ef5676c267f239bed5adf6e77ea343b70a17e6
MD5 bf1fb2dc8a6eb7b5549e66baa35f0799
BLAKE2b-256 9cd799db4caf8837479ee5732a695a7d617f66e0559afedae8728fb2e7fe2d0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for markdown2image-0.0.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b556c7508b2e51f965629366fda237666607d4364fd30286f781897b3aa7ce4a
MD5 9d0bcc5e247afe729bc545934baa78fe
BLAKE2b-256 009d037ef03891bb0d4a619e58c58c2a804d6972a74f8688a8d12b86e0151b0b

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