返回顶部
m

md-to-shareMarkdown转长图

将 Markdown 文件转换为原生长图的 skill,可被 OpenClaw、Claude Code 等 AI Agent 直接调用。A skill that converts Markdown to long images, callable by AI Agents like OpenClaw and Claude Code.

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

md-to-share

MD to Share / MD 转长图

A skill that converts Markdown files to long images, directly callable by AI Agents like OpenClaw and Claude Code. Perfect for sharing on WeChat, Discord, and other platforms.

将 Markdown 文件转换为原生长图的 skill,可使用 OpenClaw、Claude Code 等 AI Agent 直接调用。方便分享到微信、Discord 等平台。

Features / 特点

  • - Environment Auto-Detection: Automatically detects OpenClaw vs Claude Code and applies optimal settings
  • High Resolution: Configurable width up to 1600px (2x scale factor) for crisp display
  • Auto Theme: Light mode (6:00-18:00) / Dark mode (18:00-6:00) based on time
  • Discord Optimized: JPEG format at 85% quality, auto-splits large files
  • Self-Contained: Bundled Chromium via Playwright — no system browser needed
  • Smart Splitting: Splits at semantic boundaries (headings, hr) not mid-paragraph
  • Robust Error Handling: Clear exit codes for AI agents to understand failures
  • - 环境自动检测:自动检测 OpenClaw 或 Claude Code 环境,应用最优设置
  • 高分辨率:可配置宽度最高 1600px(2x 缩放因子),在所有平台上清晰显示
  • 自动主题:根据时间自动切换浅色(6:00-18:00)/ 深色(18:00-6:00)模式
  • Discord 优化:JPEG 格式 85% 质量,自动切分大文件
  • 独立运行:内置 Playwright Chromium,无需系统安装浏览器
  • 智能切分:在语义边界(标题、分隔线)处切分,不会在段落中间
  • 健壮错误处理:清晰的退出码,方便 AI Agent 理解错误

Quick Start / 快速使用

Use this skill when user asks to forward, convert to image, share, generate long image.

当用户要求转发、转成图片、方便分享、生成长图时使用此 skill。

⚠️ Decision Flow for Agents / Agent 决策流程

IMPORTANT: Before calling md2img, determine the target channel first.

用户要求生成图片
├── 明确要发到 Discord → 使用 --channel=discord(自动切图,确保清晰)
├── 明确要发到 WeChat → 使用 --channel=wechat(保留长图,微信原生支持)
├── 明确要发到 iMessage → 使用 --channel=imessage(保留长图)
├── 本地使用 / 保存文件 → 使用 --channel=local(保留长图)
└── 不确定目标渠道 → ❗ 先反问用户确认渠道,再执行

Why this matters: Discord has strict image dimension limits (images taller than ~2000px get scaled down to unreadable sizes). WeChat and iMessage handle long images natively — splitting would break the reading experience.

为什么这很重要:Discord 对图片尺寸有严格限制(超过 ~2000px 高的图会被缩放到无法阅读)。微信和 iMessage 原生支持长图 — 切分反而会破坏阅读体验。

Usage / 使用方法

1. Convert Command / 转换命令

bash
md2img [output] [options]

Options / 选项:

OptionDescriptionDefault
--preset=<name>Configuration preset: openclaw \genericAuto-detect
--channel=<name>
Target channel: discord \| wechat \| imessage \| local | None |
| --width= | CSS width in pixels | Preset value |
| --scale= | Device scale factor | 2 |
| --max-size= | Max file size before splitting | Preset value |
| --max-height= | Max pixel height per image | Channel value |
| --quality=<1-100> | JPEG quality | 85 |
| --theme= | Force theme | Auto by time |
| --timeout= | Browser operation timeout | 30000 |

Channel behavior / 渠道行为:

ChannelSplittingReason
discord✅ Auto-split at 1800px heightDiscord scales tall images, making them unreadable
wechat
❌ Keep long image | WeChat handles long images natively |
| imessage | ❌ Keep long image | iMessage handles long images well |
| local | ❌ Keep long image | No platform constraints |
| Not specified | ❌ No splitting | Default safe behavior |

Output formats / 输出格式:

  • - .jpg / .jpeg - JPEG format (default, recommended)
  • .png - PNG format (lossless, larger files)

Example / 示例:
bash

For Discord (auto-split for readability)


md2img report.md report.jpg --preset=openclaw --channel=discord

For WeChat (keep as long image)

md2img report.md report.jpg --preset=openclaw --channel=wechat

For local use (no splitting)

md2img report.md report.jpg

Force dark theme

md2img report.md report.jpg --theme=dark

2. Configuration Presets / 配置预设

PresetCSS WidthScaleActual WidthMax SizeUse Case
openclaw600px2x1200px5MBOpenClaw → Discord (optimized for compression)
generic
800px | 2x | 1600px | 8MB | Claude Code / local use (high resolution) |
预设CSS 宽度缩放实际宽度最大文件使用场景
openclaw600px2x1200px5MBOpenClaw → Discord(适配压缩层)
generic
800px | 2x | 1600px | 8MB | Claude Code / 本地使用(高分辨率) |

Auto-Detection Logic / 自动检测逻辑:

  • - If OPENCLAWCHANNEL or OPENCLAWSKILLS_DIR env var exists → openclaw preset
  • If current directory contains .openclaw/skills → openclaw preset
  • Otherwise → generic preset

3. Send to Discord / 发送到 Discord

Use the message tools media parameter:
json
{
action: send,
target: channel_id,
message: Brief description,
media: /full/path/to/image.jpg
}

Note: If the converted image exceeds the size limit, it will be automatically split into multiple files:

  • - output-1.jpg, output-2.jpg, output-3.jpg, ...

注意:如果转换后的图片超过大小限制,会自动切分为多个文件。

4. Send to WeChat / 发送到微信

  • - Image is generated at the specified path
  • Open file manager to get the image
  • Or copy to clipboard and paste

Image Quality Optimization / 图片清晰度优化

OpenClaw + Discord Flow / OpenClaw + Discord 流程

OpenClaw has two layers of image compression:

  1. 1. Agent layer: imageMaxDimensionPx=1200, maxBytes=5MB
  2. Media loading layer: MAXIMAGEBYTES=6MB, scales down from 2048px

OpenClaw 有两层图片压缩:

  1. 1. Agent 层:imageMaxDimensionPx=1200,maxBytes=5MB
  2. 媒体加载层:MAXIMAGEBYTES=6MB,从 2048px 逐步缩小

Recommended / 推荐: Use --preset=openclaw to output 1200px images under 5MB. This bypasses both compression layers.

推荐:使用 --preset=openclaw 输出 1200px 且小于 5MB 的图片,这样可以绕过两层压缩。

With openclaw preset / 使用 openclaw 预设:
Skill outputs 1200px (< 5MB)

Agent layer: 1200px ≤ 1200px → No compression ✓

Media layer: 5MB < 6MB → No compression ✓

User receives: 1200px (guaranteed) / 用户收到:1200px(确定)

Final Resolution Reference / 最终分辨率参考

| Environment

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 md-to-share-1776105736 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 md-to-share-1776105736 技能

通过命令行安装

skillhub install md-to-share-1776105736

下载

⬇ 下载 md-to-share v2.2.0(免费)

文件大小: 21.37 KB | 发布时间: 2026-4-15 13:21

v2.2.0 最新 2026-4-15 13:21
v2.0: Migrate from puppeteer-core to Playwright (bundled Chromium, no system browser needed). v2.2: Add --channel flag for channel-aware smart splitting (Discord auto-split, WeChat/iMessage keep long image). Fix bash wrapper arg forwarding and symlink resolution.

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

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

p2p_official_large
返回顶部