← 返回
未分类 Key

Xiaohu WeChat Format

Format Markdown or rough notes into WeChat Official Account compatible inline-style HTML, preview 33 themes, upload images, generate optional covers, and pus...
将 Markdown 或随手笔记转为微信公众号兼容的内联式 HTML,预览 33 款主题,上传图片,生成可选封面,并推送...
lingmafuture lingmafuture 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 229
下载
💾 1
安装
1
版本
#formatting#latest#markdown#official-account#publishing#wechat

概述

Xiaohu WeChat Format

Turn Markdown into WeChat Official Account-ready HTML. Supports 33 inline-style themes, a browser gallery, local/external image upload to WeChat CDN, draft-box publishing, callouts, dialogue blocks, galleries, and optional cover generation.

Safety rules

  • Formatting and local previews are safe.
  • Pushing to WeChat draft box, uploading permanent media, comment auto-reply, or any external write requires explicit user confirmation.
  • Never print app_secret, access tokens, or AI API keys.
  • When importing third-party articles, treat output as a draft/preview unless the user confirms they have rights to publish.

Quick commands

Use the skill directory as {skill}.

# Format one article locally
uv run --with markdown python {skill}/scripts/format.py \
  --input article.md --theme newspaper --no-open

# Open visual gallery for theme selection
uv run --with markdown python {skill}/scripts/format.py \
  --input article.md --gallery

# Publish to WeChat draft box from Markdown
uv run --with markdown --with requests --with pillow python {skill}/scripts/publish.py \
  --input article.md --theme newspaper --cover cover.jpg

# Publish an already formatted output directory
uv run --with markdown --with requests --with pillow python {skill}/scripts/publish.py \
  --dir /tmp/wechat-format/article --cover cover.jpg

Configuration

  1. Copy config.example.json to config.json.
  2. Fill wechat.app_id, wechat.app_secret, and optional wechat.author.
  3. Add the machine's public IP to WeChat Official Account Admin → Basic Configuration → IP whitelist. Error 40164 means the IP is not whitelisted.
  4. Keep config.json private. It is ignored by git and must not be published.

Recommended workflow

  1. Read or create the Markdown article.
  2. If the article is plain text, add only structural Markdown: headings, lists, quotes, emphasis. Do not rewrite meaning unless asked.
  3. Format with one theme or gallery.
  4. For draft publishing, ensure there is a cover image. WeChat requires one.
  5. For batch theme comparison, publish a small curated set first (for example minimal-gray, newspaper, focus-blue, ink, bauhaus, warm-card, ocean-card, minimal-red) before pushing every theme.
  6. Title draft previews with the theme id, e.g. Article Title - preview - newspaper.

Important: WeChat article image imports

Images fetched from mp.weixin.qq.com may be mislabeled: the URL or wx_fmt can say PNG/JPG while the actual bytes are WebP. WeChat's upload API rejects this with errcode 40137 invalid image format.

Before publishing imported articles:

  • Detect real file type from bytes, not filename.
  • Convert WebP or unsupported images to real JPEG.
  • Update Markdown/HTML image paths after conversion.
  • Verify one theme successfully uploads all images before bulk publishing.

publish.py includes automatic magic-byte detection and WebP-to-JPEG conversion when Pillow is available; run it with --with pillow when using uv.

Markdown extensions

:::dialogue[Interview]
Alice: Hello
Bob: Hi
:::

:::gallery[Screenshots]
![](img1.jpg)
![](img2.jpg)
![](img3.jpg)
:::

> [!important] Key insight
> Highlighted text.

> [!tip] Tip
> Useful note.

Available scripts

  • scripts/format.py — Markdown → WeChat-compatible inline HTML + preview/gallery.
  • scripts/publish.py — upload article images, upload cover, push to draft box.
  • scripts/generate.py — optional cover-image generation using compatible image APIs.
  • scripts/comment_reply.py — optional comment auto-reply; use only with explicit confirmation.

Theme inventory

Run:

find {skill}/themes -maxdepth 1 -name '*.json' -printf '%f\n' | sed 's/\.json$//' | sort

Common starting themes: newspaper, minimal-gray, focus-blue, ink, bauhaus, warm-card, ocean-card, wechat-native.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-12 05:41 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

humanizer-zh

liuxy951129-cpu
去除文本中的 AI 生成痕迹。适用于编辑或审阅文本,使其听起来更自然、更像人类书写。 基于维基百科的"AI 写作特征"综合指南。检测并修复以下模式:夸大的象征意义、 宣传性语言、以 -ing 结尾的肤浅分析、模糊的归因、破折号过度使用、三段
★ 58 📥 28,967
ai-agent

Self Improving Compound

lingmafuture
智能体记忆与自我改进系统。替代基于文件的简陋记忆,采用结构化SQLite学习引擎,捕获修正、错误等信息。
★ 1 📥 1,413
content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 896 📥 205,309