md2wechat
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
# 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.jpg
Workflow
- 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
python scripts/md_ai_render.py --md article.md --theme autumn-warm --out article.html
Draft Upload (One-Click Publish)
python scripts/wechat_publish.py --md article.md --html article.html --draft --cover cover.jpg
Use the first image as cover if the user does not provide one.
Fetch WeChat-Sanitized HTML
python scripts/wechat_publish.py --md article.md --html article.html --draft --cover cover.jpg --fetch-draft article.wechat.html
Images
- 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. .env) configured with:
WECHAT_APPIDWECHAT_SECRET
Optional:
IMAGE_API_KEY(AI images)IMAGE_API_BASE
The publish tool loads .env by default; override with --env.
It also accepts AppID/AppSecret in the env file.
Draft title defaults to the Markdown filename (without .md). Override with --title.
Examples
Example 1: Basic Conversion
Input (article.md):
# Hello World
This is a simple article.
- Item 1
- Item 2
Command:
python scripts/md_ai_render.py --md article.md --theme autumn-warm --out article.html
Output (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:
python scripts/wechat_publish.py --md article.md --html article.html --draft --cover cover.jpg
Output:
{"success": true, "image_count": 2, "draft_media_id": "xxx"}
References
references/themes.md(AI themes and prompts)references/html-guide.md(WeChat HTML rules)references/image-syntax.md(image syntax)references/wechat-api.md(draft upload behavior)
More from lingengyuan/my-skills
wechat-archiver
Archives WeChat Official Account articles to knowledge base with auto-generated structured notes. Use when users provide WeChat article URLs (mp.weixin.qq.com) or mention archiving/saving WeChat articles. Combines wechat2md scraper and note-creator for complete workflow.
21note-creator
Orchestrates creation of structured Obsidian notes with markdown, canvas diagrams, and table bases. Use when users ask to create notes, save knowledge, or document concepts in their Obsidian vault. Delegates to specialized format skills.
9sync_to_github
Automate git commit and push. Use when user says "sync to github", "commit and push", "push my changes", "save to git", "submit my work", or invokes /sync_to_github. Stages all changes, generates a commit message, commits, and pushes to remote.
7obsidian-markdown
Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes.
7json-canvas
Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian.
6obsidian-bases
Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.
6