konglong87/methodology-skills / skills/wechat-article-writer
wechat-article-writer
Verified微信公众号文章写作和排版助手。输入主题+内容大纲→自动生成结构完整、排版精美的公众号文章(WeChat兼容HTML+行内样式),同时可配套调用infographic-generator生成4主题配图。触发词:'公众号文章','写公众号','公众号排版','微信文章','推文'。
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 2.8 KB |
| SKILL.md | skill md | 4.0 KB |
| package.json | manifest | 206 B |
| test_content/yuanlai003.txt | markdown | 2.7 KB |
| test_content/yuanlai01.txt | markdown | 10.2 KB |
| test_content/yuanlai02.txt | markdown | 8.3 KB |
| wechat-full.js | script | 25.2 KB |
| wechat-md2html.js | script | 8.4 KB |
| wechat-render.js | script | 7.5 KB |
| wechat-themes.json | config | 10.6 KB |
README.md
View on GitHub# 微信公众号排版器
**丢一个 .md 文件进去,自动产出可复制到公众号编辑器的精美排版文章 + 全套配图。**
## 快速开始
### 1. 准备 Markdown 文章
```markdown
# 我的文章标题
## 一、开头
正文内容...
- 要点 1
- 要点 2
## 二、核心
**重点内容**——更多文字...
```
> 用 `一、` `二、` 中文编号分段效果最好,也支持 `##` Markdown 标题。
### 2. 一键生成
```bash
cd methodology-skills
node skills/wechat-article-writer/wechat-full.js 我的文章.md -o output/
```
可选参数:
- `--theme stripe` — 配图风格:`apple`(明亮,默认)`linear`(暗黑)`stripe`(人文)`muji`(侘寂)
- `--article-theme tech` — 文章排版:`tech` `product` `warm` `zen`(默认自动推断)
- `-o ./输出目录/` — 指定输出路径
### 3. 获取结果
```
output/
├── article-plain.html ⭐ 内容已自动复制到剪贴板
├── article.html 图文混排预览(浏览器打开看效果)
├── 插入指南.md 配图上传位置对照表
└── screenshots/{theme}/
└── wide/ 宽屏配图(16:9,文章实际使用的)
```
### 4. 发布
1. 直接 `Cmd+V` 粘贴到微信公众号编辑器(生成后已自动复制)
2. 上传 `screenshots/` 里的配图到公众号素材库
3. 看 `插入指南.md` 把图片插到对应位置
4. 预览 → 发布
## 输入格式自动识别
| 你写 | 自动识别为 |
|------|-----------|
| `一、标题` `二、标题` | 一级章节标题 |
| `1. 小节` `2. 小节` | 二级标题 |
| 普通段落 | 正文 |
| `- 要点` `· 要点` | 列表 |
| `> 引用` | 引用块 |
| `**强调**` | 加粗(主题色) |
| `快速回顾` `划重点` | 高亮块 |
| `---` | 分隔线 |
## 配图说明
每篇文章自动生成:
| 图片 | 位置 |
|------|------|
| 头图 | 标题下方 |
| 每章配图 | 每个章节后面(包含该章核心要点) |
| 文末引导图 | 文章末尾 |
同时产出竖长版(750×1334)和宽屏版(1200×675),文章默认用宽屏版。
## 安装依赖
```bash
cd skills/infographic-generator
npm install
npx playwright install chromium
```
## 常见问题
**Q: 生成的 HTML 粘贴到公众号后样式不对?**
A: 用 `article-plain.html`,不要用 `article.html`。`plain` 版已经把所有图片替换为占位框,粘贴后不会出现红叉。
**Q: 图片粘贴到公众号后丢失了?**
A: 图片必须先上传到微信公众号素材库,再手动插入。参考 `插入指南.md` 的对照表。
**Q: 可以只要排版不要配图吗?**
A: 加 `--no-screenshots` 参数跳过截图。
**Q: 支持纯文本文件吗?**
A: 支持。不需要 Markdown 格式,纯文本也会自动解析章节结构。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 |