Introduction¶
The WeChat Official Account backend imposes many restrictions on rich text: it doesn’t support reliance on page-level <style>, classes, or scripts, and styles are easily lost during copy-pasting. If you usually write articles in Markdown and then manually adjust font sizes, lists, and quotes in the backend, you often have to preview repeatedly.
Below is an introduction to the SkillHub community skill “WeChat Official Account Article Typesetting” (Coordinates @user_5dda6a29/wechat-typeset-pro). It defines a workflow on the Agent side and uses Python scripts to render Markdown into WeChat-compatible HTML with inline styles, supporting multi-theme previews and optional Draft Box pushing.
What is this¶
One-sentence positioning: A Professional Typesetting Skill for WeChat Official Accounts — converting Markdown into exquisite HTML that the WeChat editor can accept.
- Publisher & Hosting: Community publisher
user_5dda6a29, Sourcecommunity, Categorycontent-creation, Current version 1.0.0. - Distribution Address: SkillHub Skill Page, API Coordinate Page https://api.skillhub.cn/user_5dda6a29/wechat-typeset-pro.
- Community Data (Page Stats): Rating 100000, Downloads 5409, Installations 361; Tags include
requires_api_key=true(related to optional WeChat Open Platform credentials, see below).
The skill itself uses the universal SKILL.md format and comes with scripts/format.py, scripts/publish.py, and theme JSONs under themes/.
Core Features¶
The following capabilities are derived from the skill description and script responsibilities, and can be selected as needed.
Typesetting Engine (format.py)¶
- Converts Markdown into pure inline style HTML, adapting to WeChat editor restrictions.
- 30 Themes (e.g.,
terracotta,bytedance,newspaper,github,wechat-native, etc.), with the default theme set asnewspaperinconfig.json. - Theme Gallery: Renders multiple themes using real articles, allowing you to switch and copy them in a browser to the Official Account backend.
- Built-in Enhancements: CJK spacing, bold punctuation fixes, list simulation via sections, external link to footnote conversion, code highlighting, dark mode attributes, various callouts, image captions, dialogue bubbles, image galleries, timelines, steps, comparison cards, table zebra stripes, etc.
- Extended Container Syntax:
:::dialogue,:::gallery,:::timeline,:::steps,:::compare,:::quote, as well as blocks like> [!tip]/> [!important].
Pushing (publish.py, Optional)¶
- Pushes typesetting results or specified Markdown to the Official Account Draft Box.
- Requires configuration of
WECHAT_APP_IDandWECHAT_APP_SECRET(read preferentially from environment variables; documentation mentions loading from~/.openclaw/.env).
Agent-Side Workflow¶
The skill stipulates that when a user mentions intents like “typeset,” “WeChat typeset,” or “Official Account typeset,” the Agent should:
- Confirm the article path and content;
- Perform structured preprocessing if necessary (only adding Markdown markers, not changing wording);
- Apply containers and callouts based on content type, and recommend themes;
- Call
format.pyto open the gallery or specify a theme; - Copy the HTML after user confirmation; if pushing is required, call
publish.py.
The output directory defaults to ~/WorkBuddy/wechat-typeset-pro (consistent with output_dir in config.json).
Installation & Enablement¶
Method 1: Let the Agent install via SkillHub docs¶
In clients supporting Skills, you can send the prompt provided on the official page to the Agent:
Please install `@user_5dda6a29/wechat-typeset-pro` according to https://skillhub.cn/install/skillhub.md.
Method 2: skillhub CLI¶
First, install the CLI according to the SkillHub Installation Guide, then install it to the current Agent’s skills directory (defaults to ./skills/ if --dir is not specified, which may not be recognized by the client).
command -v skillhub && skillhub --version
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only
skillhub install @user_5dda6a29/wechat-typeset-pro --dir <skills directory>
Common skills paths (excerpted from official installation docs):
- Cursor:
~/.cursor/skills/ - Claude Code:
~/.claude/skills/ - Codex:
~/.codex/skills/or.agents/skills/under the project
After installation, trigger the typesetting process via natural language in the conversation; whether the skill loads automatically depends on the specific client’s Skill mechanism.
Configuration¶
config.json in the skill directory can set output_dir, settings.default_theme, settings.auto_open_browser, etc. WeChat AppID / AppSecret are recommended to be placed in environment variables rather than written into the config file:
| Variable | Usage |
|---|---|
WECHAT_APP_ID |
WeChat Official Account AppID |
WECHAT_APP_SECRET |
WeChat Official Account AppSecret |
The typesetting script relies on Python 3 and imports markdown (see format.py); ensure the local Python environment and dependencies are available before running.
Typical Usage¶
Replace {baseDir} with the skill installation directory (i.e., the path where SKILL.md is located).
Open Theme Gallery (Recommended)¶
Render multiple themes with a real article, select and copy in the browser:
python3 {baseDir}/scripts/format.py \
--input "article_path.md" \
--gallery \
--recommend newspaper magazine ink
Directly Specify Theme¶
python3 {baseDir}/scripts/format.py \
--input "article_path.md" \
--theme terracotta
Common format.py parameters: --output / -o output directory, --no-open do not automatically open browser, --format takes wechat / html / plain.
Push to Draft Box (Requires WeChat Credentials)¶
Push from the typesetting output directory:
python3 {baseDir}/scripts/publish.py \
--dir "typesetting_output_directory" \
--cover "cover_image_path (optional)"
Typeset and push from Markdown in one step:
python3 {baseDir}/scripts/publish.py \
--input "article.md" \
--theme terracotta
--dry-run only typesets without pushing; --title, --author can override metadata.
Use Cases & Notes¶
Who is it for
- Those who write long-form articles for Official Accounts in Markdown and want unified layouts with less manual style adjustment in the backend;
- Those who need to compare various visual themes before pasting into the WeChat backend;
- Those who already possess Official Account development credentials and want to push finished drafts to the Draft Box for manual publishing.
Limitations & Notes
- The finished product is inline HTML; complex interactions and external stylesheets are still not suitable for Official Accounts;
- The gallery mode description states that it renders multiple themes using real articles for selection. The total number of themes is 30, but the specific number displayed in the gallery depends on the script implementation;
requires_api_key=truemainly applies to the WeChat Open Platform credentials required for Draft Box pushing; local typesetting and copying do not require configuration;- The
config.jsonexample contains paths likevault_root, which need to be adjusted according to your own directory when using across machines; - The skill can be called by the typesetting process of other skills like
wechat-content-studio; if you already have a content production pipeline, you can treat it as a typesetting sub-step.
Conclusion¶
“WeChat Official Account Article Typesetting” bundles Markdown, 30 themes, gallery preview, and optional draft pushing into a Skill + script package, suitable for separating “writing” from “HTML pasteable to Official Accounts.” For installation and coordinates, see SkillHub Skill Page, API Entry https://api.skillhub.cn/user_5dda6a29/wechat-typeset-pro.