md2wechat
Original:🇺🇸 English
Translated
2 scripts
Converts Markdown to WeChat Official Account HTML using AI-themed layouts and optionally one-click publishes to the draft box. Use when formatting Markdown for WeChat or uploading drafts with WECHAT_APPID/WECHAT_SECRET set in an env file.
1installs
Sourcelingengyuan/my-skills
Added on
NPX Install
npx skill4agent add lingengyuan/my-skills md2wechatTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →MD to WeChat Skill (AI Only)
Convert Markdown to WeChat Official Account HTML with inline CSS (AI mode) and optionally upload to the draft box.
Quick Commands
bash
# Render AI-style HTML (theme) from Markdown
python scripts/md_ai_render.py --md article.md --theme autumn-warm --out article.html
# Then publish
python scripts/wechat_publish.py --md article.md --html article.html --draft --cover cover.jpgWorkflow
- Read the Markdown file and note title, images, and structure.
- Pick AI theme (see ).
references/themes.md - Render themed HTML and save it to file.
- If user wants one-click publish, upload images and create draft with the tool.
Render HTML
bash
python scripts/md_ai_render.py --md article.md --theme autumn-warm --out article.htmlDraft Upload (One-Click Publish)
bash
python scripts/wechat_publish.py --md article.md --html article.html --draft --cover cover.jpgUse the first image as cover if the user does not provide one.
Fetch WeChat-Sanitized HTML
bash
python scripts/wechat_publish.py --md article.md --html article.html --draft --cover cover.jpg --fetch-draft article.wechat.htmlImages
- Local/remote images are uploaded to WeChat by the tool during publish.
- For AI-generated images, insert in Markdown or ask in natural language.
 - For details, read .
references/image-syntax.md
Standalone Image
AI image generation is handled by Claude; no separate tool call.
Configuration (Env File)
Assume the user has an env file (e.g. ) configured with:
.envWECHAT_APPIDWECHAT_SECRET
Optional:
- (AI images)
IMAGE_API_KEY IMAGE_API_BASE
The publish tool loads by default; override with .
It also accepts / in the env file.
Draft title defaults to the Markdown filename (without ). Override with .
.env--envAppIDAppSecret.md--titleExamples
Example 1: Basic Conversion
Input (article.md):
markdown
# Hello World
This is a simple article.
- Item 1
- Item 2Command:
bash
python scripts/md_ai_render.py --md article.md --theme autumn-warm --out article.htmlOutput (article.html): WeChat-compatible HTML with inline CSS and autumn-warm theme styling.
Example 2: Publish to Draft
Input: article.md + article.html + cover.jpg
Command:
bash
python scripts/wechat_publish.py --md article.md --html article.html --draft --cover cover.jpgOutput:
json
{"success": true, "image_count": 2, "draft_media_id": "xxx"}References
- (AI themes and prompts)
references/themes.md - (WeChat HTML rules)
references/html-guide.md - (image syntax)
references/image-syntax.md - (draft upload behavior)
references/wechat-api.md