Code to Image API
Generate beautiful code snippet images with syntax highlighting via html2png.dev.
How It Works
- Write HTML with syntax-highlighted code (use Shiki or similar)
- Style with Tailwind CSS or custom CSS
- Send to
/api/convertendpoint - Get a shareable image URL
Endpoint
POST https://html2png.dev/api/convert
Example
curl -X POST "https://html2png.dev/api/convert?width=800&deviceScaleFactor=2" \
-H "Content-Type: text/html" \
-d '<!DOCT
[Description truncada. Veja o README completo no GitHub.]