Install
openclaw skills install @pkutitan/wechat-mp-formatter公众号(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.
openclaw skills install @pkutitan/wechat-mp-formatterConvert 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.
说明:本 skill 当前实现以歌曲 / 音乐类排版为第一优先级。其他类型若要长期量产,建议后续补一套中性 / 冷色调配色与通用组件库(例如 1.1 版本规划)。
The WeChat公众号 editor filters out certain CSS properties when pasting. Follow these rules strictly:
<section> for ALL styled containers — NOT <div>. The editor strips background-color from <div> but preserves it on <section>.<table> for music cards or any multi-column layouts.background-color (not background: shorthand) for all background colors.style="..." attributes on each element.border-radius, border, padding, margin, color, font-size, line-height, text-align — all safe.display:flex — the editor removes it, layouts collapse.linear-gradient — the editor removes it, backgrounds turn transparent.box-shadow — the editor removes it.<div> for styled blocks (background-color will be stripped).position, transform, animation — filtered by the editor.For the full compatibility reference, see references/compatibility.md.
Table-based layout with a circular disc icon + song info. Use <table> structure.
<table style="width:100%;background-color:#faf6f0;border:1px solid #e8ddd0;border-radius:8px;margin-bottom:28px;border-collapse:collapse;">
<tr>
<td style="padding:12px 16px;width:52px;vertical-align:middle;">
<section style="width:44px;height:44px;border-radius:50%;background-color:#8b4513;"></section>
</td>
<td style="padding:12px 16px;vertical-align:middle;">
<p style="margin:0;font-size:15px;color:#8b4513;font-weight:600;">🎵 歌曲名</p>
<p style="margin:4px 0 0;font-size:13px;color:#b08968;">歌手名 · 年份</p>
</td>
</tr>
</table>
Warm-toned background + left border + italic text. Use <section>.
<section style="background-color:#faf6f0;border-left:3px solid #d4a574;padding:16px 20px;margin:20px 0;font-size:16px;line-height:1.9;color:#6b5544;font-style:italic;border-radius:0 6px 6px 0;">歌词内容</section>
Bordered box for key insights. Use <section>.
<section style="background-color:#faf6f0;border:1px solid #e8ddd0;border-radius:10px;padding:20px 22px;margin:28px 0 20px;">
<p style="font-size:15px;line-height:1.9;color:#3f3f3f;margin:0;">内容</p>
</section>
Centered or left-aligned emphasis with distinct background. Use <section>.
<section style="background-color:#f5f0e8;padding:14px 20px;margin:18px 0;border-radius:6px;font-size:16px;line-height:2.0;color:#4a3f35;">金句内容</section>
Dark background box at the end guiding comments/shares. Use <section>.
<section style="background-color:#2c2520;border-radius:8px;padding:16px 20px;margin-top:16px;color:#d4a574;font-size:13px;line-height:1.8;">
互动引导文字
</section>
Left border accent + bold. Use <h2> with inline style.
<h2 style="font-size:18px;font-weight:700;color:#2c2c2c;margin:36px 0 20px;padding-left:14px;border-left:4px solid #8b4513;line-height:1.5;">标题文字</h2>
Standard paragraph style. Use <p> with inline style.
<p style="font-size:16px;line-height:2.0;color:#3f3f3f;margin:0 0 18px;text-align:justify;letter-spacing:0.3px;">正文内容</p>
Colored bold text within paragraphs. Use <span>.
<span style="color:#8b4513;font-weight:600;">强调文字</span>
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.
Get the article title, body text, and any special elements (lyrics, quotes, key sentences, music info) from the user.
Select which formatting components to use based on content type:
Use assets/template.html as the base template. Fill in:
<h1> and <title> tagsThe 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.
Save the HTML file to the user's working directory. Tell the user to:
The base template is at assets/template.html. It contains:
<style> block for page chrome (nav bar, buttons) — these use CSS classes (safe, not copied)execCommand-based, works on file://)To use: read the template, replace the example content with the actual article, save as a new HTML file.
letter-spacing:0.3px on body paragraphs for slight breathing room<div> instead of <section> → background colors will be stripped after pastingbackground: instead of background-color: → less reliableClipboardItem in the copy function → fails on file:// protocolborder-collapse:collapse on tables → gaps in music cards