threerocks/article2media / skills/wechat-layout
wechat-layout
Verified公众号排版:把一篇文章(Markdown)排成能直接粘贴进公众号编辑器的图文——内联样式、图片内嵌、12 套主推主题配色,附 2.35:1 头图、1:1 封面和发布信息(标题、摘要、步骤);正文一字不改,逐块读回校验。只接受文章:原文(article.md)、译文(article.zh.md)或改写稿导出的文章(rewrite.md,即"总结后发公众号")。可以单独用,也可以接在抓取、翻译、改写后面。Use when the user wants 公众号排版, 微信公众号文章排版, 推文排版, gzh, mp.weixin formatting, "排成公众号/发公众号", or to paste a Markdown article into the WeChat editor.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.1 KB |
| agents/openai.yaml | config | 241 B |
| references/wechat-guide.md | markdown | 3.2 KB |
| scripts/doctor.mjsexecutable | script | 767 B |
| scripts/wechat.mjsexecutable | script | 864 B |
references/wechat-guide.md
View on GitHub# 公众号排版指南
`wechat.mjs` 把一篇**文章**排成能直接粘贴进公众号编辑器的图文。它只接受文章(`.md`):
| 文章 | 来自 | 组合 |
|---|---|---|
| `article.md` | 抓取 / 视频转文字 / 用户粘贴 | 公众号排版(原文) |
| `article.zh.md` | 全文翻译 | 外文搬运 |
| `rewrite.md` | 改写稿导出(`article-rewrite` 的 `export.mjs`) | 公众号总结 |
三种都按原文规则排:正文一字不改,逐块读回校验(`../../article2media/references/verbatim.md`)。要删改内容,改源头(改 article.md,或改 content.json 再导出),不要改排版结果。
## 输出
| 文件 | 用途 |
|---|---|
| `article.html` | 预览页(手机宽度)。顶部「复制到公众号」按钮把正文以富文本写进剪贴板 |
| `article-body.html` | 只有正文的 HTML 片段(同样可粘贴) |
| `images/` | 文中图片的本地副本;粘贴后某张图缺了,就从这里拖进去 |
| `cover-2.35x1.png`、`cover-1x1.png` | 头图(2.35:1)和分享卡片 / 次条封面(1:1),按主题的封面样式画 |
| `wechat.md` | 标题、摘要、原文信息、封面和发布步骤 |
| `ledger.json`、`qa.json` | 原文块账本与检查结果 |
## 标题、摘要、封面
- **标题**:默认取文章标题(front matter 的 `title`),正文里不再重复。最多 64 字,建议 20–30 字、信息完整、不标题党;原标题不合适时用 `--title` 另写。
- **摘要**:`--digest`,或 front matter 的 `digest`(`rewrite.md` 来自 `wechat.digest`),都没有时取第一段的前 120 字。最多 120 字,说清"这篇能给你什么"。
- **封面标题**:默认同标题。太长会自动缩小字号,还放不下时报错:用 `--cover-title "两行\n标题"` 写一个短的、自己断行。`--kicker` 是头图上方的小字。
- **题图**:`rewrite.md` 有封面插画时自动放在正文最前面并用在头图上;文章自己没有时可以 `--hero 图片` 指定。
## 它怎么做到能粘贴
公众号编辑器会去掉 `<style>`、class、外部 CSS、网络字体和脚本。所以:
- 所有样式都从主题算出来后写成内联 `style`,颜色统一成 rgb;
- 标题、正文改用系统字体(苹方 / 宋体);
- 图片以 base64 内嵌,粘贴时编辑器会自己上传,不需要图床;原文的网络图片先下载到本地再内嵌,下载失败的保留外链并提示;
- 不用 `ul/li`、CSS Grid 和 position:列表写成带标记的段落,换行写成 `<br>`,代码的缩进写成不换行空格;
- 页首的原文署名、文末的来源说明、原文链接和品牌不算正文,不参与逐字校验。外链在正文里不能点击,原文链接以纯文本放在文末。
## 检查
- 版面检查:全文校验(逐块一致)、图片是否都加载、正文里有没有残留 class / style、标题长度、封面标题是否放得下。
- 打开 `article.html` 看一遍:手机宽度下段落、列表、引用、表格、图是否清楚。
- 粘贴后在公众号后台用「预览」发到手机上看一眼,这是最终效果。深色主题在微信深色模式下会被系统再调一次色。
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |