中文版本 (Chinese Version)
🚀 WeChatPost - WeChat Publisher
One-click publish Markdown directly to WeChat Official Accounts from VSCode
✨ Features
- ✅ Full Markdown / GFM Support - Complete Markdown and GitHub Flavored Markdown support
- ✅ Mermaid Diagram Rendering - Automatic rendering and upload of Mermaid diagrams
- ✅ Code Highlighting - Beautiful syntax highlighting using highlight.js
- ✅ Content Style Customization - Theme presets (classic, magazine, minimal) with customizable colors and fonts
- ✅ Persistent Login State - Login session persists across VSCode restarts, no need to scan QR every time
- ✅ QR Code Login - Mobile QR code login (no developer资质/AppID required)
- ✅ One-Click Publish - Direct publish to official account draft box
- ✅ Image Upload - Automatic upload of all images to WeChat CDN
- ✅ Secure Storage - Authentication information stored safely in VSCode keychain
📦 Installation
From VSIX File
- Download
wechatpost-<version>.vsix file
- Open VSCode Extensions panel (Cmd+Shift+X / Ctrl+Shift+X)
- Click the top-right
... menu
- Select "Install from VSIX..."
- Select the
.vsix file and restart VSCode
🚀 Usage
All commands are prefixed with WeChatPost: in the command palette.
Method 1: Playwright Automated (Recommended)
- Open a
.md Markdown file
- Open Command Palette (
Cmd+Shift+P / Ctrl+Shift+P)
- Type
WeChatPost: Publish Current Markdown to WeChat and execute
- If not logged in: Chrome will open automatically, scan QR code to login, save credentials, and upload
- If already logged in: Directly create draft in browser (login state persists across restarts)
- Mermaid diagrams are automatically rendered to images and uploaded to WeChat CDN
Method 2: Manual Cookie Mode
- Input Cookie (Manual Login) - Manually enter cookie copied from browser
- WeChatPost: Publish Current Markdown to WeChat - Upload current Markdown to WeChat official account draft
Other Commands
- WeChatPost: Configure Publishing Options - Configure default author, original declaration, appreciation, collection, and content style
- WeChatPost: Preview WeChat Article Layout - Preview converted WeChat HTML format in sidebar
- WeChatPost: Sign Out of WeChat Session - Clear saved login credentials
- Open a
.md Markdown file
- Open Command Palette, type
WeChatPost: Preview WeChat Article Layout
- A preview window will open showing the WeChat official account format
⚙️ Configuration
Search for wechatPublisher in VSCode settings or use WeChatPost: Configure Publishing Options command:
| Setting |
Type |
Default |
Description |
wechatPublisher.defaultAuthor |
string |
"" |
Default author name used when creating a WeChat draft |
wechatPublisher.digestLength |
number |
120 |
Digest length extracted from markdown content |
wechatPublisher.declareOriginal |
boolean |
true |
Enable original declaration by default |
wechatPublisher.enableAppreciation |
boolean |
true |
Enable appreciation by default |
wechatPublisher.defaultCollection |
string |
"智能体" |
Default collection name used in WeChat |
wechatPublisher.publishDirectly |
boolean |
true |
Publish directly by default; disable to save as draft |
wechatPublisher.contentThemePreset |
string |
"classic" |
Content theme preset: classic, magazine, or minimal |
wechatPublisher.contentBodyFontSize |
number |
16 |
Body font size in pixels (12-22) |
wechatPublisher.contentLineHeight |
number |
1.85 |
Body line height (1.2-2.4) |
wechatPublisher.contentTextColor |
string |
"#1f2329" |
Body text color in HEX format |
wechatPublisher.contentHeadingColor |
string |
"#0f172a" |
Heading text color in HEX format |
wechatPublisher.contentLinkColor |
string |
"#0969da" |
Link and emphasis color in HEX format |
📝 Notes
- This plugin uses cookie authentication from WeChat Official Accounts web interface, no developer资质 required
- Mermaid diagrams are rendered as PNG images and uploaded to WeChat CDN
- All external images are automatically uploaded to WeChat CDN
- Authentication information is securely stored in VSCode secret storage, never stored in plain text
🛠️ Development
# Install dependencies
npm install
# Compile backend
npm run compile
# Compile frontend preview
npm run build:webview
# Full repackage
npm run vscode:prepublish
# Package VSIX
npx vsce package
📄 License
MIT
Made with ❤️ by cygnus
| |