WeChat Official Account Layout Previewer: Local Markdown to Copyable HTML Preview

Preface

When writing for Official Accounts (WeChat Public Accounts), the common workflow is to draft content in Markdown or a notes app first, then paste it into the Official Account editor to adjust styles paragraph by paragraph. The final result in the editor often differs from the draft, requiring repeated previewing in the browser after each round of edits. If you want to see a layout locally that approximates the white-background body text and common font sizes/line spacing before deciding which paragraphs can be copied wholesale, you need a lightweight solution that does not rely on online typesetting services or send body text to third-party APIs.

The following introduces the WeChat Formatting Previewer (@user_9e6539c8/wechat-markdown-preview) on SkillHub: a local Python script that converts Markdown into a single-page HTML for preview in a browser before copying it to the Official Account backend.

What is this

The WeChat Formatting Previewer renders Markdown into local HTML suitable for copying and previewing to an Official Account. The publisher is SkillHub community user user_9e6539c8 (the author is listed as Abel on the SkillHub page), version 1.0.0, categorized under content-creation, with a source of community. The Skill tags indicate requires_api_key=false, meaning it does not rely on external API Keys.

The SkillHub page description further mentions: it is applicable to scenarios such as Official Account formatting, Markdown preview, WeChat formatting, article preview, Official Account styles, and copying to Official Accounts, and includes local Python scripts. As of the data retrieval time, SkillHub shows a rating of 100000 and 1783 downloads.

Core Features

Based on the SKILL.md and scripts/wechat_markdown_preview.py within the Skill package, the currently verifiable capabilities are as follows:

  1. Local Rendering: Reads UTF-8 text Markdown files and generates an HTML preview page with inline styles. The default output filename is wechat_preview.html.
  2. Layout Orientation: The page features a white background, a maximum width of approximately 720px, system fonts, and common line heights; level 2 headings have a green left border, closely matching the common reading experience of Official Account body text.
  3. Markdown Subset: The script parses line by line, supporting level 1 headings (#), level 2 headings (##), unordered lists (-), and normal paragraphs; blank lines are rendered as line breaks.
  4. Agent Workflow: Once installed as a Skill, the Agent will first confirm if the input is clear, then prioritize calling the script to generate a draft, and provide the path and follow-up suggestions based on the output (see “Workflow” and “Quality Requirements” within the Skill).

Note: The Skill description mentions generating deliverables like Markdown, JSON, CSV, and HTML; however, the main script currently implemented in the package covers only the HTML preview path. Complex tables, code blocks, images, etc., need to be handled in the Markdown source or require future script extensions.

Installation and Activation

The Skill follows the standard SKILL.md format. When installing from SkillHub, the official prompt suggests letting the AI handle it according to the SkillHub Installation Documentation, with the coordinate:

@user_9e6539c8/wechat-markdown-preview

If the SkillHub CLI is already installed on your machine, run the following in the current Agent’s skills directory (--dir is mandatory; otherwise, installing to the default ./skills/ might not be loaded by the Agent):

skillhub install wechat-markdown-preview --namespace user_9e6539c8 --dir <your skills directory>

Common client skills directories (from SkillHub installation documentation):

Environment Path
Cursor ~/.cursor/skills/
Claude Code ~/.claude/skills/
Codex ~/.codex/skills/ or .agents/skills/ under the project

If the CLI is not installed, you can execute the following first:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

After installation, restart or refresh the Agent according to your client’s instructions so the Skill is recognized.

Typical Usage

In the directory where the Skill is installed, run the official quick usage command on a Markdown source file:

python3 scripts/wechat_markdown_preview.py article.md --out out/wechat

Brief explanation of the meaning:

  • article.md: The path to the Markdown source file to be rendered.
  • --out out/wechat: The output directory; it will be created automatically if it does not exist.

On success, the terminal will print the preview file path, e.g., out/wechat/wechat_preview.html. Open this HTML in a browser to check if the heading hierarchy and paragraph line breaks meet your expectations, then select and copy content from the page to the Official Account editor.

If using via an Agent like Cursor, you can simply state “Process this Markdown with the WeChat Formatting Previewer,” and the Agent will invoke the script according to the Skill workflow and report the output path.

Suitable Scenarios and Notes

Who is it for

  • Operations staff or authors who are used to writing drafts in Markdown and need to see the “white-background body text” effect locally before publishing.
  • Teams or individuals who want to keep the formatting process on their local machine without configuring third-party APIs.

Limitations and Notes

  • The renderer uses lightweight line-by-line parsing and is not a full CommonMark implementation; multi-level headings, quotes, code blocks, links, etc., need to be self-checked before finalizing the draft, or you must accept secondary adjustments in the Official Account editor.
  • After copying to the Official Account, the platform may still rewrite some styles; local HTML is for preview and paragraph selection and cannot replace final proofreading in the backend.
  • The Skill requires the Agent not to fabricate external facts; if input materials are insufficient, the Agent should explicitly ask the user to supplement fields (see Skill quality requirements).

Conclusion

The WeChat Formatting Previewer consolidates “Markdown drafting → Local HTML preview → Copying to Official Account” into a scriptable path, aligning with Agent workflows like SkillHub and Cursor. To install or view instructions, you can open the official Skill address:

https://api.skillhub.cn/user_9e6539c8/wechat-markdown-preview

SkillHub display page:

https://www.skillhub.cn/skills/user_9e6539c8/wechat-markdown-preview

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye