520mianxiangduixiang520/md2img/SKILL.md
Convert Markdown (inline text or a `.md` file path) into a single PNG image using local code (Markdown -> HTML -> headless browser screenshot). Use when the user asks for a PNG image output from Markdown content or a `.md` file.
npx skillsauth add openclaw/skills md2imgInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
把 Markdown 渲染成 PNG,并确保最终只返回/输出 一张图片。
/path/to/input.md,且以 .md 结尾)output 会被解释为“最终 PNG 的文件路径”。.png 结尾),则在该目录下输出默认文件名:md2img.png。fullPage=True 截图,确保最终输出为 单张 PNG(不分页)。当你主要用于手机端预览时,建议设置浏览器渲染宽度,从而让文字换行/表格布局符合移动端比例。
--image-width <px>375(iPhone 常见宽度)390(Android 常见宽度)414(大屏 iPhone 常见宽度)./.venv/bin/python scripts/md_to_png.py --input <in.md> --output <out.png> --image-width 375脚本使用 @media (prefers-color-scheme: dark) 做了样式适配,所以暗黑效果取决于 headless 浏览器/系统的深色偏好。
prefers-color-scheme(best-effort)--theme dark|light 之类的参数来强制渲染。pip install(PEP 668 外部托管环境):
python3 -m venv .venvsource .venv/bin/activatepython -m pip install -U pippython -m pip install -U markdown playwright bleach pygmentspython -m playwright install chromium.md 路径:直接使用该路径作为 input_md_path,不创建/不删除临时文件tmp_dir=$(mktemp -d)$tmp_dir/input.mdinput_md_path=$tmp_dir/input.mdoutput:
output 以 .png 结尾:把它当作最终 PNG 文件路径output/md2img.png./.venv/bin/python scripts/md_to_png.py --input $input_md_path --output <final_png_path> --image-width <移动端宽度像素(如375)>source .venv/bin/activate 再用 python scripts/md_to_png.py ...<img> 图片资源 base64 内联),再用无头 Chromium 截图 fullPage=True,并等待字体/资源加载,确保只有一张 PNGtmp_dir),转换结束后执行删除:rm -rf "$tmp_dir"scripts/md_to_png.py 执行失败:需要报错并包含你实际执行的命令与以下其一,方便用户排查:
$tmp_dir/input.md.md 文件路径场景:用户提供的 .md 路径用户:把下面 Markdown 转成图片,并输出到 /tmp/out.png
# Hello
This is a **Markdown** example.
Agent steps:
$tmp_dir/input.md./.venv/bin/python scripts/md_to_png.py --input $tmp_dir/input.md --output /tmp/out.pngrm -rf "$tmp_dir".md 文件路径 -> 单张 PNG用户:把文件 /tmp/input.md 转成图片,输出到 /tmp/images/
Agent steps:
/tmp/input.md 为 input.md./.venv/bin/python scripts/md_to_png.py --input /tmp/input.md --output /tmp/images/md2img.png/tmp/input.md(它来自用户提供)tools
Use when the user wants to connect to, test, or use the McDonalds service at mcp.mcd.cn, including checking authentication, probing MCP endpoints, listing tools, or calling McDonalds MCP tools through a reusable local CLI.
development
Web scraping platform — Twitter/X data, Vinted marketplace, and general web scraping API
development
SlowMist AI Agent Security Review — comprehensive security framework for skills, repositories, URLs, on-chain addresses, and products (Claude Code version)
data-ai
去除中文文本中的 AI 写作痕迹,使其读起来自然。基于维基百科 AI 写作特征指南,检测 24 种 AI 模式。触发词:humanizer-cn、去除 AI 痕迹、去除 AI 写作痕迹、中文文本人性化。