From organize_markdown
将普通 Markdown 文档格式化为微信公众号风格,自动添加章节 emoji、生成目录、优化段落间距和列表格式,让排版更清晰美观。使用当需要将 markdown 文章导出为微信公众号格式排版时。
How this skill is triggered — by the user, by Claude, or both
Slash command
/organize_markdown:wechat-formatThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
将普通 Markdown 文档自动格式化为微信公众号风格的清晰排版:
将普通 Markdown 文档自动格式化为微信公众号风格的清晰排版:
将 markdown 转换为带微信公众号样式的 HTML,可一键复制后直接粘贴到微信公众号编辑器:
python3 skills/wechat-format/scripts/markdown_to_wechat.py <输入文件.md> [输出文件.html]
打开生成的 HTML 文件,点击右上角 📋 一键复制 按钮,然后直接粘贴到微信公众号编辑器即可。
如果你只需要格式化 markdown 格式(保留 emoji 和目录),仍然可以使用:
python3 skills/wechat-format/scripts/format_wechat.py <输入文件.md> [输出文件.md]
--no-emoji:不自动添加 emoji 到章节标题--no-toc:不生成目录(仅 format_wechat.py)根据章节标题关键词自动匹配合适的 emoji:
| 关键词 | Emoji |
|---|---|
| 概览、概述、简介、介绍 | 🔍 |
| 背景、相关 | 📚 |
| 原理、理论、概念 | 💡 |
| 方法、步骤、流程、实践 | ⚙️ |
| 最佳实践、推荐 | ✨ |
| 示例、案例 | 📝 |
| 问题、故障、错误 | ⚠️ |
| 解决、方案 | ✅ |
| 对比、比较 | ⚖️ |
| 总结、结语 | 🎯 |
| 参考、链接 | 🔗 |
| 安装、部署 | 🚀 |
| 配置、设置 | ⚙️ |
| 使用、用法 | 📖 |
| 特性、功能 | 🌟 |
| 性能、优化 | ⚡ |
| 安全、风险 | 🔒 |
| 测试、验证 | 🧪 |
| 架构、设计 | 🏗️ |
| 实现、开发 | 👨💻 |
| 未来、展望 | 🔮 |
没有匹配关键词时按标题层级使用默认 emoji:
在标题后自动提取所有章节生成 Table of Contents 目录,方便读者快速导航。
确保:
优化列表项的间距,让长列表更易读。
当用户要求"格式化成微信公众号风格"或类似需求时:
python3 skills/wechat-format/scripts/format_wechat.py <输入文件> [输出文件]
python3 skills/wechat-format/scripts/format_wechat.py my_article.md
# 输出: my_article_wechat.md
python3 skills/wechat-format/scripts/format_wechat.py input.md output.md
python3 skills/wechat-format/scripts/format_wechat.py input.md --no-toc
格式化前:
# AI编程如何告别屎山代码
## 概览
软件开发正在经历一场深刻的范式变革。
## 传统 SDLC
传统瀑布式 / 敏捷 SDLC 流程:需求分析 → 系统设计 → 编码开发 → 测试验证 → 部署上线 → 维护迭代
格式化后:
# 📌 AI编程如何告别屎山代码
## 🔍 概览
软件开发正在经历一场深刻的范式变革。
## ⚡ 传统 SDLC
传统瀑布式 / 敏捷 SDLC 流程:需求分析 → 系统设计 → 编码开发 → 测试验证 → 部署上线 → 维护迭代
| 参数 | 必填 | 说明 |
|---|---|---|
input | 是 | 输入 markdown 文件路径 |
output | 否 | 输出文件路径,默认 {input}_wechat.md |
--no-toc | 否 | 跳过目录生成 |
将 markdown 直接转换为带完整 CSS 样式的 HTML,适配微信公众号阅读体验:
1.8,适合手机阅读生成的 HTML 页面右上角自带 📋 一键复制 按钮,点击即可复制全部内容,直接粘贴到微信公众号编辑器,样式完美保留。
生成的 HTML 参考了优质微信公众号文章的排版风格,和你提供的示例文章 https://mp.weixin.qq.com/s/gIzGWlN-KJIT7uIucojB4A 风格一致:
当用户要求"格式化成微信公众号风格"或类似需求时:
python3 skills/wechat-format/scripts/markdown_to_wechat.py <输入文件.md> [输出文件.html]
如果用户只需要 markdown 格式化,使用:
python3 skills/wechat-format/scripts/format_wechat.py <输入文件> [输出文件]
python3 skills/wechat-format/scripts/markdown_to_wechat.py my_article.md
# 输出: my_article_wechat.html
打开 HTML 文件 → 点击"📋 一键复制" → 粘贴到微信公众号编辑器 → 完成发布!
python3 skills/wechat-format/scripts/markdown_to_wechat.py input.md --no-emoji
python3 skills/wechat-format/scripts/markdown_to_wechat.py input.md output.html
| 参数 | 必填 | 说明 |
|---|---|---|
input | 是 | 输入 markdown 文件路径 |
output | 否 | 输出 HTML 文件路径,默认 {input}_wechat.html |
--no-emoji | 否 | 不自动添加 emoji 到章节标题 |
| 参数 | 必填 | 说明 |
|---|---|---|
input | 是 | 输入 markdown 文件路径 |
output | 否 | 输出文件路径,默认 {input}_wechat.md |
--no-toc | 否 | 跳过目录生成 |
markdown 包(仅 HTML 输出需要):pip install markdownformat_wechat.py 仅使用标准库,无需额外依赖npx claudepluginhub xiaodizi/organize_markdown_skills --plugin organize_markdownCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.