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.9.2.tar.gz (10.9 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.9.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: markdown2image-0.0.9.2.tar.gz
  • Upload date:
  • Size: 10.9 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.9.2.tar.gz
Algorithm Hash digest
SHA256 e2aaf285f39820b9a7d4d174a8c8fce008b3a9a35622979391b1052e3f6d75c1
MD5 68b42584828c04b6ff5829d326a4a73e
BLAKE2b-256 e00c0d640693d6fe037c3d05b436cacfe05cbc35eef2fb286d6805341b9c7b71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for markdown2image-0.0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f18afcedb87e4f725b33d2da4a020d0dc07d7afefd943da77f1dfa34de28288f
MD5 34bce8d73011ddb0b75eca1a2b0ae56a
BLAKE2b-256 fa9992179e11b86bbbc183a8d93bf3348224d90e84587d217abcec211e48b47f

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