The Missing Pipeline for
微信公众号 Publishing
Write in Markdown. Publish with one command. Your article arrives in the draft box — styled, images uploaded, cover generated, ready to send.
Serving the 23 million+ WeChat Official Accounts that reach 1.3 billion monthly active users — the world's largest content ecosystem with no modern publishing tools.
The World's Largest Content Platform Has No Modern Tools
WeChat is not just a messaging app — it's a content distribution ecosystem bigger than WordPress, Medium, and Substack combined.
Underserved Market
WordPress has 60,000+ plugins. Substack raised $85M. Medium has rich APIs. WeChat's publishing ecosystem? Still stuck with a basic web editor from 2014. Every serious publisher is looking for a better workflow.
Wedge Strategy
Start with the power users — developers, technical writers, content teams — who already think in Markdown. Expand to visual editors, team workflows, and enterprise content ops. The CLI is the wedge; the platform is the play.
WeChat's editor is a formatting nightmare
You write great content in Markdown. Then you spend 30 minutes fighting WeChat's editor to make it look decent — copy-pasting, re-uploading images, fixing broken formatting.
- 😤 Formatting destroyed on paste — code blocks, tables, nested lists all break
- 🖼️ Images re-uploaded manually — one by one, every single time
- 🎨 Every article looks the same — no way to apply professional typography
- ⏱️ 30+ minutes wasted per article on formatting instead of writing
With publish-md-to-wechat:
Everything you need, nothing you don't
From Markdown parsing to WeChat draft creation — handled end-to-end.
AST-Powered Rendering
mistune 3.x parses complex Markdown — nested lists, tables, code blocks, footnotes — into pixel-perfect HTML.
11 Visual Styles
3 timeless classics + 7 extended presets + unlimited custom styles. Professional typography, battle-tested on WeChat.
Style Replication
See a WeChat article you love? Paste its URL. We extract the visual DNA and save it as your custom preset.
Smart Image Upload
Local files, external URLs, Obsidian ![[WikiLinks]] — all auto-uploaded to WeChat CDN with caching.
Auto Cover Generation
Pillow-powered branded PNG covers from your title + style accent colors. No design tools needed.
YAML Frontmatter
Auto-extracts title, author, description. Works with Obsidian, Jekyll, Hugo, and any frontmatter-based workflow.
Dry Run Preview
Generate styled HTML locally without any API calls. Review your article before publishing.
Flexible Credentials
Project .env, global config, or shell vars. Multi-level priority, never hardcoded, always secure.
Video URL Detection
YouTube & Bilibili links rendered as clean text links, not broken image placeholders.
The Classic Trio
Three timeless styles covering 90% of content needs. Each rooted in a century-old design tradition.
Swiss
White canvas, red accents, grid-driven precision. Born from Müller-Brockmann's grid system, refined through Apple's design language.
Editorial
Warm cream paper, serif typography, generous spacing. A century of print journalism distilled — The New Yorker, in WeChat.
Ink · 水墨
Warm white ground, deep crimson accent, maximal line-height. Chinese calligraphy meeting modern digital publishing.
+7 extended styles for specific scenarios:
See a style you love? Clone it.
Analyze any WeChat article, extract its visual DNA, and save it as your own reusable preset.
Paste a URL
Point to any WeChat article with a style you admire.
styles.py --url https://mp.weixin.qq.com/s/xxx
Auto-Extract
Colors, fonts, spacing, borders — all extracted and saved as JSON.
→ custom-kimi.json saved
Publish with it
Use your custom style just like any built-in preset.
--style custom-kimi
A Modular Pipeline
Every stage is independent, testable, and extensible.
Markdown → AST
mistune 3.x parses your Markdown into a structured Abstract Syntax Tree. Handles nested lists, tables, code blocks, frontmatter, and Obsidian WikiLinks.
Style Engine
Applies one of 11+ visual styles as inline CSS — the only way to style WeChat articles. Custom styles from JSON presets or URL extraction.
Image Processor
Local files, external URLs, and WikiLinks — all resolved, uploaded to WeChat CDN, and replaced with permanent media URLs.
Cover Generator
Pillow-based branded PNG cover from your title + style accent colors. Automatic or custom override.
WeChat API Client
Upload media, create draft, handle token refresh. Auto-retry with exponential backoff. Error handling for all known WeChat API edge cases.
Up and running in 60 seconds
Python 3, one script, one .env file. That's it.
Install dependencies
git clone https://github.com/walk4rever/publish-md-to-wechat && cd publish-md-to-wechat && ./install.sh
Add your WeChat credentials
cp env.example .env # fill in WECHAT_APP_ID & WECHAT_APP_SECRET
Publish your first article
python3 scripts/wechat_publisher.py --md article.md --style swiss
Stop Fighting the Editor.
Start Publishing.
Join the publishers who write in Markdown and let the pipeline handle the rest. Free, open source, MIT licensed.