Convert markdown to Instagram story-sized PNG images (1080x1920px)
https://github.com/jokull/markdown-ig-story.git
Convert markdown to Instagram story-sized PNG images (1080x1920px) perfect for sharing on social media.
Includes both a web UI and a CLI tool.
pdftoppm)brew install bun pandoc weasyprint poppler
bun install
# or
npm install
Start the web server:
bun run dev
Then open http://localhost:3000 in your browser.
Features:
Build and use the command-line tool:
npm run build:cli
cat example.md | npm start -- --output ./output --prefix my-story
-o, --output <directory> - Output directory for PNG files (default: current directory)-p, --prefix <prefix> - Filename prefix for output images (default: "story")pdftoppmThe tool uses a default CSS stylesheet optimized for social media consumption. Font sizes, spacing, and colors are carefully chosen for readability on mobile devices.
markdown-ig-story/
โโโ src/ # Core library (CLI + shared code)
โ โโโ index.ts # CLI entry point
โ โโโ renderer.ts # Markdown โ Image converter
โ โโโ styles.css # Instagram story CSS styling
โโโ web/ # Web UI frontend (React)
โ โโโ App.tsx # Main React component
โ โโโ main.tsx # React entry point
โ โโโ styles.css # Tailwind CSS
โโโ public/ # Static assets
โ โโโ index.html # HTML template
โโโ server.ts # Bun fullstack server
โโโ bunfig.toml # Bun config (Tailwind plugin)
โโโ package.json # Dependencies and scripts
# Start web UI dev server
bun run dev
# Build CLI tool
npm run build:cli
# Type check
npm run typecheck
# Format code
npm run format
# Lint
npm run lint:fix
echo "# My Story
This is a paragraph with **bold** text.
## Subsection
- Item 1
- Item 2
- Item 3
> A quote
Some code: \`const x = 42\`
" | npm start -- --output ./stories --prefix my-blog
This would create my-blog-01.png, my-blog-02.png, etc. in the ./stories directory.