返回顶部
a

aws-wechat-article-formatting 微信公众号排版

给公众号文章排版,转换为可直接粘贴到微信后台的格式,支持多套主题。当用户提到「排版」「版式」「美化」「格式化」「字号」「段落样式」「换个主题」「转 HTML」「弄好看点」「调整格式」时使用。

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
130
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

aws-wechat-article-formatting

排版

路由

一键发文且未明确只要排版 → aws-wechat-article-main

将 Markdown 文章转换为微信公众号兼容的 HTML,所有样式 inline。

脚本目录

Agent 执行:确定本 SKILL.md 所在目录为 {baseDir}。

脚本用途
scripts/format.pyMarkdown → 微信兼容 HTML

配置检查 ⛔

任何操作执行前,必须首次引导 执行其中的 「检测顺序」单独启用本 skill 时同上。检测通过后才能进行以下操作(或用户明确书面确认「本次不检查」):

内置主题

主题风格适用场景
default经典蓝 — 左边框小标题,底部分割线大标题科技、干货、通用
grace
优雅紫 — 圆角色块小标题,文字阴影 | 文艺、生活方式 | | modern | 暖橙 — 胶囊圆角小标题,宽松行高 | 现代感、品牌 | | simple | 极简黑 — 底线小标题,最少装饰 | 极简主义、学术 |

每个主题包含:标题样式、引用块样式、分割线、强调色、段落间距等完整规则。

工作流

排版进度:

  • - [ ] 第0步:配置检查(见本节「配置检查」)⛔
  • [ ] 第1步:确定主题(与合并配置 / 用户指定)
  • [ ] 第2步:转换
  • [ ] 第3步:输出 HTML

第1步:确定主题

主题解析顺序(format.py 行为与智能体择一):

  1. 1. 命令行 --theme <名称>:显式指定时始终优先
  2. 未传 --theme:format.py 读取 合并后的本篇配置:先 .aws-article/config.yaml 顶层(不含 writingmodel / imagemodel),再叠 与 article.md 同目录的 article.yaml同键本篇优先 embeds.relatedarticles 单独与全局合并,见下节)。从合并结果取 defaultformat_preset(非空则作为主题名);若仍为空,则用内置主题名 default
  3. 智能体在对话中帮用户选主题时,仍按:用户口述 → 上条合并配置中的预设 → .aws-article/presets/formatting/ 自定义 → 内置 default。

主题名须对应 内置主题.aws-article/presets/formatting/<名>.yaml。字段说明见 articlescreening-schema.md(与仓库 config.yaml 顶层字段对齐)。

第2步:转换

仓库根执行(路径按实际本篇目录调整):

bash

不传 --theme:使用合并配置中的 defaultformatpreset,否则 default


python {baseDir}/scripts/format.py drafts/YYYYMMDD-slug/article.md -o drafts/YYYYMMDD-slug/article.html

显式指定主题(覆盖配置)

python {baseDir}/scripts/format.py drafts/YYYYMMDD-slug/article.md --theme grace -o drafts/YYYYMMDD-slug/article.html

自定义主色 / 字号

python {baseDir}/scripts/format.py article.md --theme modern --color #A93226 python {baseDir}/scripts/format.py article.md --font-size 15px

列出可用主题

python {baseDir}/scripts/format.py --list-themes

嵌入元素 {embed:...}

  • - format.py名片 / 小程序 的 embeds 以 .aws-article/config.yaml 为准;仅「往期链接」:本篇 article.yaml 可写 embeds.relatedarticles,与全局 relatedarticles 深度合并(用于每篇不同推荐)。合并结果中非空 embeds 时解析 {embed:profile|miniprogram|miniprogramcard|link:名称};否则不对嵌入占位符做替换(视为无配置)。
  • writing 结构模板 中的占位说明一致。

第3步:输出 HTML

输出的 HTML 特性:

  • - 所有样式 inline(微信编辑器兼容)
  • 正文不含文章标题:Markdown 中第一个 #(h1)在转换时被跳过,标题在公众号后台单独填写,正文不重复
  • 配图标记 类型:描述 保留为 标签,待 images skill 替换
  • 图注自动从标记描述中提取
  • 同目录存在 closing.md 时,format.py 会追加到文末(脚本既有行为)

选项

选项说明默认值
--theme <名称>主题;省略则按合并配置 → default见上文
--color <hex>
自定义主色 | 主题默认 | | --font-size | 字号 | 16px | | -o <路径> | 输出路径 | 同名 .html | | --list-themes | 列出可用主题 | |

自定义主题

在 .aws-article/presets/formatting/ 下新建主题文件即可。

主题文件格式和扩展方式详见:references/presets/README.md

过程文件

读取产出
article.md、.aws-article/config.yaml + 同目录 article.yaml(默认主题与 embeds)、closing.md(可选)article.html

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 aws-wechat-article-formatting-1775900822 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 aws-wechat-article-formatting-1775900822 技能

通过命令行安装

skillhub install aws-wechat-article-formatting-1775900822

下载

⬇ 下载 aws-wechat-article-formatting v1.0.0(免费)

文件大小: 16.26 KB | 发布时间: 2026-4-12 09:06

v1.0.0 最新 2026-4-12 09:06
- Initial release of aws-wechat-article-formatting.
- Converts Markdown articles to WeChat-compatible HTML with inline styles.
- Supports multiple built-in and custom themes; users can select or configure via command line or config files.
- Ensures a configuration check before any operation, with an option to skip by user confirmation.
- Keeps article title out of output HTML (for input in WeChat backend separately).
- Supports embedding custom elements and merging related articles from global and local config.
- Includes example commands and workflow for formatting and theme management.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部