# Markdown2IMG Plugin
## Headless Browser Required for Non-GUI Systems
## Headless Browser Required for Non-GUI Systems
## Headless Browser Required for Non-GUI Systems
## Important things need to be repeated three times



## 🌟 Platform Compatibility
| Platform | Support Status | Installation Method | Notes |
|----------|----------------|---------------------|-------|
| 🐧 **Linux** | ✅ Ready to use | Auto install | Built-in wkhtmltopdf, no extra config needed |
| 🐳 **Docker** | ✅ Ready to use | Auto install | Full support for built-in binaries |
| ☁️ **Cloud Platforms** | ✅ Ready to use | Auto install | Verified on Heroku, AWS, etc. |
| 🪟 **Windows** | ⚙️ Config required | Manual install | Requires system wkhtmltopdf installation |
| 🍎 **macOS** | ⚙️ Config required | Manual install | Requires system wkhtmltopdf installation |
## 📖 Plugin Introduction
Markdown2IMG is a plugin designed for LangBot that can render Markdown text into beautiful images in real-time. It supports complete Markdown syntax, LaTeX mathematical formulas, code syntax highlighting, and more.
### ✨ Core Features
- **🚀 Smart Engine**: Automatically selects the best HTML-to-image engine
- **🐧 Linux Ready to Use**: Built-in wkhtmltopdf, no system installation needed
- **🔄 Cross-platform Fallback**: Windows/macOS automatically fallback to system dependencies
- **📐 Complete Markdown Support**: Standard syntax + extended features
- **🔬 LaTeX Math Formulas**: Supports inline and block-level math formula rendering
- **🎨 Code Syntax Highlighting**: Colorful highlighting for multiple programming languages
- **📊 Tables and Lists**: Perfect support for various table and list formats
- **⚙️ Highly Configurable**: Rich configuration options for personalized needs
- **🚀 Performance Optimization**: Smart caching and async processing
## 🔧 Installation Guide
### 🐧 Linux Users (Recommended)
```bash
# 1. Automatic! The plugin will use the built-in wkhtmltopdf
# ✅ All dependencies installed automatically
# ✅ No system-level software installation needed
# ✅ Ready to use immediately
# Headless browser required for non-GUI systems
```
### 🪟 Windows Users
**Manual installation of wkhtmltopdf required:**
```bash
# 1. Install wkhtmltopdf (required)
# Visit https://wkhtmltopdf.org/downloads.html
# Download Windows version and install to default path
# Plugin will work after installation completes
```
### 🍎 macOS Users
**Install wkhtmltopdf via Homebrew:**
```bash
# 1. Install wkhtmltopdf (required)
brew install --cask wkhtmltopdf
# 2. Restart the plugin to use it
```
### 🐳 Docker Deployment
**Full support for containerized deployment:**
```dockerfile
FROM python:3.10-slim
# Install LangBot and plugin
# Plugin will automatically use built-in wkhtmltopdf
# No additional system dependencies needed
```
## 🚀 Quick Start
### Basic Usage
```
!md # Hello World
This is **bold** text, this is *italic* text.
## Code Example
\```python
def hello():
print("Hello, World!")
\```
## Math Formulas
Inline formula: $E = mc^2$
Block formula:
$$
\\int_{-\\infty}^{\\infty} e^{-x^2} dx = \\sqrt{\\pi}
$$
```
### Configuration View
```
!md-config
```
## ⚙️ Configuration Options
| Config Item | Type | Default Value | Description |
|-------------|------|---------------|-------------|
## 🎯 Usage Tips
### 1. Math Formula Rendering
```
!md
# Math Formula Example
Inline formula: $f(x) = ax^2 + bx + c$
Block formula:
$$
\\begin{align}
\\nabla \\times \\vec{E} &= -\\frac{\\partial \\vec{B}}{\\partial t} \\\\
\\nabla \\times \\vec{B} &= \\mu_0\\vec{J} + \\mu_0\\epsilon_0\\frac{\\partial \\vec{E}}{\\partial t}
\\end{align}
$$
```
### 2. Code Highlighting
```
!md
\```python
import numpy as np
import matplotlib.pyplot as plt
# Generate data
x = np.linspace(0, 2*np.pi, 100)
y = np.sin(x)
# Plot
plt.plot(x, y)
plt.title('Sine Function')
plt.show()
\```
```
### 3. Table Creation
```
!md
| Item | Quantity | Price |
|------|----------|-------|
| Apple | 5 pieces | ¥10 |
| Banana | 3 pieces | ¥6 |
| Orange | 2 pieces | ¥8 |
```
## 🔍 Troubleshooting
### Common Issues
**Q: Plugin prompts "No available HTML-to-image engine"**
A: Please check dependency installation
**Q: Plugin prompts "No available HTML-to-image engine"**
A: Please check dependency installation: `pip install python-pdf pdf2image`
**Q: Generated images are blurry**
A: Adjust the `side` parameter, recommended value 800-1000
**Q: Built-in wkhtmltopdf is incompatible with my system**
A: Plugin will automatically fallback to system wkhtmltopdf, please install system version according to installation guide
### Technical Architecture
```
User Input
↓
Markdown Parser
↓
HTML Template Rendering
↓
Engine Selection
↓
Image Generation
↓
Base64 Encoding Output
```
## 📝 Changelog
### 3.0.0 (Current Version)
- 🔧 **Improvement**: Optimized for markdown images
- ✨ **New**: More controllable operations
### 2.1.0
- 🔧 **Improvement**: Optimized for markdown images
- 🔧 **Improvement**: Optimized for blocking messages
### 2.0.0
- ✨ **New**: More controllable operations
### 1.0.0
- 🎉 First official version
- ✨ **New**: Built-in wkhtmltopdf binary
- ✨ **New**: Multi-engine support
- 🔧 **Improvement**: Project refactoring
### v0.2.0
- ✨ **New**: Built-in wkhtmltopdf binary, ready to use
- ✨ **New**: Multi-engine support (pydf + imgkit)
- ✨ **New**: Smart engine fallback mechanism
- 🔧 **Improvement**: More friendly error messages and installation guide
- 🔧 **Improvement**: Optimized dependency check logic
### v0.1.0
- ✨ Complete Markdown syntax support
- ✨ LaTeX math formula rendering
- ✨ Code syntax highlighting
- ✨ Table and footnote support
- ⚙️ Rich configuration options
## 🤝 Contributing
Welcome to submit Issues and Pull Requests!
## 📄 License
MIT License
Markdowm2ing by Typer_Body
Convert markdown messages in ai content to images
Loading...