Skip to content

Python utility to convert markdown and html to image based on playwright

License

Notifications You must be signed in to change notification settings

PYUDNG/markdown2image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Python utility to convert markdown and html to image based on playwright

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published