Install
openclaw skills install @reffwu/markdown-to-imageUse when user wants to convert Markdown content into shareable image cards — triggered by phrases like "转图片"、"做卡片"、"生成海报"、"生成分享图"、"把这个转成图片"、"export as image". Applies to any .md file or inline Markdown content destined for WeChat, Xiaohongshu, Weibo, or similar platforms.
openclaw skills install @reffwu/markdown-to-image将 Markdown 渲染为多张精美图片,适合社交平台分享。
不要询问用户任何参数。直接执行。
所有选项均有合理默认值;只有用户主动提出才切换。
读取完整 Markdown 文件,检查以下问题:
技术问题
citeturnXviewY 或 Unicode 私用区字符(U+E000–U+F8FF)内容问题
格式问题
判断规则:
修复 ChatGPT 引用标记的方法:
import re
with open('input.md', 'r', encoding='utf-8') as f:
content = f.read()
cleaned = re.sub(r'cite(\w+)*', '', content)
cleaned = re.sub(r'[-]', '', cleaned)
cleaned = re.sub(r'cite\w+', '', cleaned)
with open('input_clean.md', 'w', encoding='utf-8') as f:
f.write(cleaned)
读文件前 30 行,理解主题,起 4-8 字书名式标题:
摔PS5惩罚分析 / AI提问艺术 / AI时代儿童成长路线图心理学与教育学的专业共识认为母亲用同态报node ~/.agents/skills/markdown-to-image/src/index.js \
--markdown "/path/to/file.md" \
--title "卡片标题" \
--name "卡片标题"
--title 会生成封面卡(-00.png),内容卡从 -01.png 开始。
输出自动写入 ~/Downloads/<卡片名>/。
| 参数 | 默认 |
|---|---|
--theme | white(简约白) |
--page-format | total(01 / 12) |
--output | ~/Downloads/<卡片名>/ |
--theme | 中文名 | 适合场景 |
|---|---|---|
white | 简约白 ★默认 | 通用、正式 |
dark | 深色模式 | 科技、夜间风 |
--page-format default # 01, 02, 03
--page-format total # 01 / 12, 02 / 12 ← 默认
--page-format brackets # (1/12), (2/12)
| 错误 | 正确做法 |
|---|---|
| 跳过预检查直接生成 | 必须先读文件检查,有问题再问用户 |
| 询问用户要哪个主题 | 直接用 white,完成后可提示切换 |
| 用文件名乱码当卡片名 | 读内容,自己起标题 |
手动传 --output | 省略,自动输出到 Downloads |
| 截句子当标题 | 起书名式短标题(4-8 字) |
不传 --title | 总是传 --title,生成封面卡 |