Metadata-Version: 2.4
Name: md2image
Version: 0.1.3
Summary: Render Markdown/Image to PIL Images with flexible layout composition
Author: Xiang Li
Project-URL: Homepage, https://github.com/lix8886/md2img
Project-URL: Repository, https://github.com/lix8886/md2img
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: pillow>=9.0

# md2img

Render Markdown or Image to PIL Images with flexible layout composition.

## Features

- Render Markdown to PNG: headings, bold/italic, code blocks, lists, tables, blockquotes, links
- Compose multiple images horizontally or vertically with optional Markdown panels and description bars
- Three built-in themes: `default`, `dark`, `warm`
- Pure Python (PIL), no heavy dependencies

## Install

```bash
pip install md2image
```

Requires Python 3.8+ and Pillow >= 9.0.

## Quick Start

```python
from md2image import render_md, compose_h, compose_v

# Pure Markdown rendering
img = render_md("# Hello\n\n**Bold** and *italic* text.", width=800, theme="dark")
img.save("output.png")

# Compose images horizontally with a Markdown header
from PIL import Image
imgs = [Image.new("RGB", (300, 200), c) for c in ["#4F46E5", "#059669", "#DC2626"]]
result = compose_h(imgs, top_md="# Experiment Results\nThree runs compared.", target_height=220)
result.save("comparison.png")
```

## API

```python
from md2image import render_md, compose_h, compose_v

# Render markdown string to image
render_md(markdown, width=800, theme="default", padding=40)

# Horizontal composition
compose_h(images, target_height=240, top_md=..., bottom_md=..., top_desc=..., bottom_desc=..., theme="default")

# Vertical composition
compose_v(images, target_width=440, left_md=..., right_md=..., md_panel_width=280, theme="default")
```

Themes: `default` | `dark` | `warm`

## License

MIT
