Install
openclaw skills install weixin-long-imageTurn Weixin/Wechat replies into readable image cards by rendering HTML into long PNG screenshots. Use when a Weixin direct-chat reply would exceed 150 Chinese characters, when the user asks for a card, a beautiful visual, or a poster-like output, or when the content benefits from HTML-based rendering such as charts, tables, curves, timelines, relation diagrams, comparison layouts, dashboards, or mixed text-image presentation. First write HTML, then render it into an image.
openclaw skills install weixin-long-imageUse this skill to turn rich HTML layouts into long PNGs for Weixin delivery.
In Weixin direct chats, if the reply body for the user would exceed 150 Chinese characters, treat this as a hard rule: prefer this skill over a long plain-text message.
Use this skill when any of these is true:
Unless the user explicitly wants a poster/card/dashboard style, default to a WeChat public-article layout, not a centered floating card.
In Asia/Shanghai time, if the image is being prepared at 22:00 or later, default to a dark-mode article template to reduce eye strain, unless the user explicitly asks for a light theme.
Reserve card/poster/dashboard styling for cases like:
For ordinary long articles, analysis notes, translated writeups, and image-heavy explanations, prefer article layout.
Use assets/wechat-article-template.html as the default starting point for daytime article-style pages.
Use assets/wechat-article-template-dark.html as the default starting point for article-style pages prepared at or after 22:00 Asia/Shanghai.
They provide:
assets/wechat-article-template.htmlassets/wechat-article-template-dark.htmlscripts/render_long_image.py.message tool using an absolute local path.message send succeeds, immediately delete temporary render artifacts (.png and temporary .html) unless the user explicitly asked to keep them.message for any progress update; do not rely on multi-part assistant text arriving in order.python3 scripts/render_long_image.py \
--input /absolute/path/to/page.html \
--png-out /absolute/path/to/output.png
You may also pass raw HTML via --input or stdin.
--input can be a file path or inline HTML.--input is omitted, read HTML from stdin.--html-out is optional.
--input is an existing HTML file, reuse that file.max-width: 100% unless overflow is intentional./tmp, send the PNG, then remove temporary files if appropriate.Use message with the generated PNG path.
action=sendchannel=openclaw-weixinmedia=/absolute/path/to/output.pngmessage=一句很短的说明For temporary outputs, once message reports success, delete the local render artifacts immediately.
Typical cleanup:
rm -f /absolute/path/to/output.png /absolute/path/to/output.html
Rules:
/tmp.render_long_image.py used inline HTML or stdin without --html-out, the script already auto-deletes its temporary HTML file; you still need to delete the PNG after send.After a user-visible message send, reply with NO_REPLY to avoid duplicates.
--width or fix the HTML/CSS layout first.assets/wechat-article-template.html: Default daytime HTML template for WeChat-article-style long images.assets/wechat-article-template-dark.html: Default night-mode HTML template for WeChat-article-style long images after 22:00 Asia/Shanghai.scripts/render_long_image.py: Render complete HTML into a long PNG screenshot.