公众号排版工具。用户提供任意格式的文章内容(草稿、纯文字、已有 Markdown 均可), AI 自动识别结构、添加排版标记,生成专业公众号 HTML。 Use when: 用户说"帮我排版"、"转成公众号格式"、"生成 HTML";用户上传文章内容或文件 NOT for: 纯文本渲染;用户只想预览已有 HTML
Coding
公众号排版器
Try it公众号(WeChat Official Account)排版工具:将文章转换成可一键复制、直接粘贴进公众号编辑器并保留全部样式的 HTML。内置音乐卡片、歌词引用块、高亮块、金句块、互动引导等组件,默认暖色调配色,特别适合歌曲/音乐/怀旧/生活方式类内容;其他类型也可用,但配色与组件通常需微调。WeChat MP Formatter: turns articles into self-contained HTML that keeps all styling when pasted into the MP editor. Ships music cards, lyric quote blocks, highlight boxes, key-sentence blocks and interactive prompts with a warm-tone palette tuned for songs/music/nostalgia/lifestyle; other topics work too but may need palette/component tweaks.
What it does
公众号(WeChat Official Account)排版工具:将文章转换成可一键复制、直接粘贴进公众号编辑器并保留全部样式的 HTML。内置音乐卡片、歌词引用块、高亮块、金句块、互动引导等组件,默认暖色调配色,特别适合歌曲/音乐/怀旧/生活方式类内容;其他类型也可用,但配色与组件通常需微调。WeChat MP Formatter: turns articles into self-contained HTML that keeps all styling when pasted into the MP editor. Ships music cards, lyric quote blocks, highlight boxes, key-sentence blocks and interactive prompts with a warm-tone palette tuned for songs/music/nostalgia/lifestyle; other topics work too but may need palette/component tweaks.
The skill document
WeChat MP Formatter(公众号排版器)
Overview
Convert article content (title + body text + optional lyrics/quotes/highlights) into a self-contained HTML file with inline styles. The user opens the HTML in a browser, clicks a "copy" button, and pastes directly into the WeChat公众号 editor — all formatting (background colors, borders, font sizes) is preserved.
When to Use
- User asks to format an article for WeChat公众号 / 公众号排版
- User wants to create styled content that can be copy-pasted into the公众号 editor
- User mentions "公众号文章" + "排版" / "格式" / "样式"
- User has article text and needs it turned into publishable公众号 format
适用场景 / Best For
- 强烈推荐(本 skill 的主打场景):歌曲分享、音乐人/专辑介绍、歌词赏析、怀旧 / 情感 / 生活方式类公众号文章。默认暖色调配色 + 音乐卡片 / 歌词引用块组件就是为这类内容调的。
- 可用但需调整:通用文章、随笔、商业或科技类 —— 可保留高亮块、金句块、互动引导,但通常要换配色(见 Color Palette 的 Alternate palettes)并去掉"音乐卡片"这种强音乐语义的组件。
- 暂不适用:依赖复杂多栏布局、数据图表,或强品牌 VI 统一规范的内容(公众号编辑器会过滤 flex / gradient / box-shadow,详见下方兼容性规则)。
说明:本 skill 当前实现以歌曲 / 音乐类排版为第一优先级。其他类型若要长期量产,建议后续补一套中性 / 冷色调配色与通用组件库(例如 1.1 版本规划)。
Critical CSS Compatibility Rules(核心兼容性规则)
The WeChat公众号 editor filters out certain CSS properties when pasting. Follow these rules strictly:
MUST DO
- Use
for ALL styled containers — NOT. The editor stripsbackground-colorfrombut preserves it on. - Use `` for music cards or any multi-column layouts.
- Use
background-color(notbackground:shorthand) for all background colors. - Put ALL styles as inline
style="..."attributes on each element. - Use
border-radius,border,padding,margin,color,font-size,line-height,text-align— all safe.
MUST NOT DO
- Do NOT use
display:flex— the editor removes it, layouts collapse. - Do NOT use
linear-gradient— the editor removes it, backgrounds turn transparent. - Do NOT use
box-shadow— the editor removes it. - Do NOT use `` for styled blocks (background-color will be stripped).
- Do NOT use external CSS classes for article content — only inline styles.
- Do NOT use
position,transform,animation— filtered by the editor.
For the full compatibility reference, see references/compatibility.md.
Formatting Components(排版组件库)
1. Music Card(音乐卡片)
Table-based layout with a circular disc icon + song info. Use `` structure.
🎵 歌曲名
歌手名 · 年份
2. Lyric Quote Block(歌词引用块)
Warm-toned background + left border + italic text. Use ``.
歌词内容
3. Highlight Box(重点高亮块)
Bordered box for key insights. Use ``.
内容
4. Key Sentence Block(金句块)
Centered or left-aligned emphasis with distinct background. Use ``.
金句内容
5. Interactive Prompt(互动引导框)
Dark background box at the end guiding comments/shares. Use ``.
互动引导文字
6. Section Heading(小标题)
Left border accent + bold. Use `` with inline style.
标题文字
7. Body Paragraph(正文段落)
Standard paragraph style. Use `` with inline style.
正文内容
8. Inline Emphasis(行内强调)
Colored bold text within paragraphs. Use ``.
强调文字
Color Palette(配色方案)
Default warm-tone palette (suitable for nostalgia/music/lifestyle content):
| Role | Color | Usage |
|---|---|---|
| Primary | #8b4513 | Headings, accents, inline emphasis |
| Secondary | #d4a574 | Left borders, decorative elements |
| Quote BG | #faf6f0 | Lyric blocks, highlight boxes, music cards |
| Highlight BG | #f5f0e8 | Key sentence blocks |
| Dark BG | #2c2520 | Interactive prompts, series navigation |
| Dark text | #d4a574 | Text on dark backgrounds |
| Body text | #3f3f3f | Paragraphs |
| Muted text | #6b5544 | Lyric text |
| Border | #e8ddd0 | Card borders |
Alternate palettes: change #8b4513 (primary) and #d4a574 (secondary) to match the article tone. Keep the BG colors neutral.
Workflow
Step 1: Receive Article Content
Get the article title, body text, and any special elements (lyrics, quotes, key sentences, music info) from the user.
Step 2: Choose Components
Select which formatting components to use based on content type:
- Music/literature articles: Music Card + Lyric Quote + Highlight + Interactive Prompt
- General articles: Highlight + Key Sentence + Interactive Prompt
- Series articles: add Series Navigation at the bottom
Step 3: Build HTML
Use assets/template.html as the base template. Fill in:
- Article title in the
andtags - Article body using the component styles above
- If multiple articles: duplicate the content section, add nav tabs
Step 4: Copy Function
The template includes a copyArticle(id, btn) function using document.execCommand('copy'). This works in file:// context (no HTTPS needed). Do NOT use ClipboardItem API — it requires a secure context.
Step 5: Output
Save the HTML file to the user's working directory. Tell the user to:
- Open the HTML file in a browser
- Click the "复制全文" button
- Paste (Ctrl+V) into the WeChat公众号 editor
Template Usage
The base template is at assets/template.html. It contains:
- Complete `` block for page chrome (nav bar, buttons) — these use CSS classes (safe, not copied)
- Copy function (
execCommand-based, works onfile://) - Example article structure with all components
- Multiple article support with tab navigation
To use: read the template, replace the example content with the actual article, save as a new HTML file.
Typography Rules
- Body font-size: 16px (17px for elderly audiences)
- Body line-height: 2.0 (generous spacing for readability)
- Heading font-size: 18px
- Lyric font-size: 16px, line-height 1.9
- Interactive prompt font-size: 13px
- Use
letter-spacing:0.3pxon body paragraphs for slight breathing room - Keep paragraphs short: 3-5 lines max per paragraph for mobile reading
Common Mistakes to Avoid
- Using
instead of→ background colors will be stripped after pasting - Using
background:instead ofbackground-color:→ less reliable - Using flexbox for layouts → will collapse after pasting
- Using
ClipboardItemin the copy function → fails onfile://protocol - Making paragraphs too long → mobile readers (especially elderly) won't finish
- Forgetting
border-collapse:collapseon tables → gaps in music cards
Related skills
公众号排版|Markdown 转 HTML|排版主题|段落样式 — 公众号一键排版工具,Markdown 文稿转微信后台可粘贴 HTML,多主题、多字号、段落样式切换,所见即所得。面向公众号编辑、独立作者、排版岗。触发词:「排版」「版式」「美化」「格式化」「字号」「段落样式」「换个排版主题」「换个版式」「转 HTML」「弄好看点」「调整格式」。换预设包/品牌包/整套主题配色请走 aws-wechat-article-assets;需要多环节串联(写+审+排+配图+发)请走 aws-wechat-article-main。
微信公众号排版引擎 — 把 Markdown 文章转换为可直接粘贴进公众号编辑器、粘贴后样式不丢失的 HTML(样式内联 + <span leaf=""> 包裹)。也从任意公众号文章 URL 自动提取视觉风格并生成匹配的组件库。触发词:公众号排版 / 微信排版 / 公众号文章 / gzh / 排成公众号 / 粘到公众号 / 提取风格 / 分析排版 / 模仿公众号 / 风格提取 / 主题提取 / 参考这篇文章的风格 / format for WeChat / WeChat article formatting。不适用于:PPT/幻灯片(用 x-design)、UI 原型设计(用 x-design
微信公众号排版文章编写。当用户需要撰写、编辑或排版微信公众号文章时使用此Skill。支持40种高级排版模块,以及标准 Markdown 基础元素
将 Markdown 文章转换为微信公众号兼容的纯 HTML 格式。当用户要求"转成微信格式"、"生成公众号文章 HTML"、"排版到微信草稿箱"、"微信粘贴格式"时触发。输出带内联样式的纯 HTML,微信编辑器可直接渲染,无需额外适配。支持标题、段落、列表、粗体、行内代码、表格、引用块、代码块、配图的完整转换。
统一内容排版引擎,支持29平台排版规则,4层排版策略(L0无需转换/L1通用HTML/L2平台专属/L3纯文本)。触发:内容排版/格式转换/平台适配