← 返回 Skills 市场
kelley99

Markdown Converter

作者 Kelley99 · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ 安全检测通过
45
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install md-converter
功能描述
Convert Markdown (.md) files to Word (.docx), PDF, and styled HTML in one shot. Use when the user asks to: "md 转 Word", "Markdown 转 PDF", "md 转 HTML", "Markd...
使用说明 (SKILL.md)

Markdown Converter

Convert a Markdown (.md) file to Word (.docx), PDF, and/or styled HTML.

安装与设置(分享给朋友时的重要说明)

在使用本 skill 前,需要先安装 Python 依赖:

macOS / Linux

python3 -m pip install python-docx reportlab

Windows

python -m pip install python-docx reportlab

如果遇到权限问题,加 --userpython3 -m pip install --user python-docx reportlab

注意: PDF 脚本使用 reportlab,首次安装可能耗时 10-30 秒。HTML 脚本无外部依赖,可直接运行。

验证安装

python3 -c "import docx, reportlab; print('OK')"

输出 OK 表示依赖已就绪。


Capabilities

  • HTML — Generates a responsive, card-layout HTML page with embedded CSS(无额外依赖)
  • DOCX — Creates a formatted Word document with headings, tables, lists, code blocks(需 python-docx
  • PDF — Generates a PDF via reportlab with proper Chinese font support(需 reportlab
  • Batchconvert_all.py runs all three formats at once

Workflow

Step 1: Auto-detect Python

Refer to the system's available Python runtimes. Prefer python3 — it works on macOS/Linux. On Windows, use python if python3 is unavailable.

Step 2: Ensure dependencies

If the user reports errors, install dependencies as described in the 安装与设置 section above.

Step 3: Convert

Choose the appropriate script based on what the user wants:

User says Run
"转成 HTML" / "只需要网页版" python3 scripts/md_to_html.py \x3Cinput.md>
"转成 Word" / "生成 docx" python3 scripts/md_to_docx.py \x3Cinput.md>
"转成 PDF" python3 scripts/md_to_pdf.py \x3Cinput.md>
"全转" / "都要" / 没说具体格式 python3 scripts/convert_all.py \x3Cinput.md>

Each script accepts an optional second argument for the output path:

python3 scripts/md_to_html.py input.md output.html
python3 scripts/md_to_docx.py input.md output.docx
python3 scripts/md_to_pdf.py input.md output.pdf
python3 scripts/convert_all.py input.md /path/to/output/dir/

Step 4: Verify & present

After conversion:

  1. Check that the output files exist and have reasonable file sizes
  2. Read the generated HTML for preview if needed
  3. Use deliver_attachments to send all generated files to the user
  4. Summarize the output briefly — file paths, sizes, formats

Supported Markdown Features

Feature HTML DOCX PDF
Headings (h1-h4)
Bold / Italic
Inline code
Code blocks
Unordered lists
Ordered lists
Tables
Links
Horizontal rules
Blockquotes

Notes

  • HTML output includes responsive CSS suitable for desktop and mobile viewing
  • PDF uses PingFang (macOS) or SimHei (Windows) for Chinese text — falls back to Helvetica if neither is found
  • DOCX uses python-docx; table styling includes header row coloring and zebra striping
  • For Chinese text with special characters (quotes, dashes), prefer using ASCII equivalents or ensure the input file is UTF-8 encoded

常见问题

Q: 报错 "No module named 'docx'" → 运行 python3 -m pip install python-docx

Q: PDF 中文显示为方块 → 脚本会自动检测系统字体。macOS 用 PingFang,Windows 用 SimHei。如果字体缺失,安装对应中文字体即可。

Q: Windows 上 python3 不存在 → 用 python 代替 python3。确认已安装 Python 3.7+ 并加入 PATH。

安全使用建议
Install only if you are comfortable letting the skill read the specific Markdown files you provide, create converted output files, and install or run local conversion dependencies. Review any package-install command before allowing it.
能力评估
Purpose & Capability
Reading Markdown input, running conversion commands, and writing converted output are coherent with a Markdown/document conversion purpose.
Instruction Scope
The documented workflow appears broader than the declared Bash-only tool metadata because it implies file reads, file writes, package installation, and Python execution.
Install Mechanism
Package installation is expected for conversion tooling but should be visible to the user and limited to required dependencies.
Credentials
The described local file and command use is proportionate for converting user-supplied documents; no broad local indexing, credential use, or unrelated network behavior was evidenced.
Persistence & Privilege
No artifact-backed evidence shows persistence, privilege escalation, background workers, credential harvesting, or hidden long-running behavior.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install md-converter
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /md-converter 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
一键将 .md 转为 .docx / .pdf / HTML。支持中文排版,含 convert_all.py 批量脚本。
元数据
Slug md-converter
版本 1.1.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Markdown Converter 是什么?

Convert Markdown (.md) files to Word (.docx), PDF, and styled HTML in one shot. Use when the user asks to: "md 转 Word", "Markdown 转 PDF", "md 转 HTML", "Markd... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 45 次。

如何安装 Markdown Converter?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install md-converter」即可一键安装,无需额外配置。

Markdown Converter 是免费的吗?

是的,Markdown Converter 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Markdown Converter 支持哪些平台?

Markdown Converter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Markdown Converter?

由 Kelley99(@kelley99)开发并维护,当前版本 v1.1.0。

💬 留言讨论