MD2DOC 文档转换器

v1.0.1

Markdown 转 Word/PDF/HTML 文档转换器。支持 6 种样式模板(商务蓝、技术灰、简洁白、产品红、学术风、默认),自动生成封面、目录、页眉页脚。当用户需要将 Markdown 转成 Word、PDF 或 HTML,生成带样式的文档,或提到文档导出、格式转换时,使用此技能。

0· 80·0 current·0 all-time
by冢猫@glory904649854

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for glory904649854/md2doc.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "MD2DOC 文档转换器" (glory904649854/md2doc) from ClawHub.
Skill page: https://clawhub.ai/glory904649854/md2doc
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install md2doc

ClawHub CLI

Package manager switcher

npx clawhub@latest install md2doc
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the included code: scripts implement Markdown parsing, style templates, image downloading, table extraction, chart generation and .docx creation. Required binaries/env vars are none, which is proportionate for a local converter. Minor incongruities: package.json is structured like an npm file but the project is Python (it lists "python" in dependencies and points main to SKILL.md) — this is a packaging oddity but not a security problem.
Instruction Scope
SKILL.md instructs the agent to run the included Python scripts via subprocess (expected). The code will download network images referenced in Markdown (requests.get), generate charts (matplotlib if installed) and write files (output docx/.temp_images). These actions are appropriate for the stated purpose, but note that downloading images causes outbound network requests to arbitrary URLs present in user-supplied Markdown (expected functionality but a privacy/network consideration). There are also small code-quality mismatches: convert.py imports analyze_document from ai_analyzer but the shown ai_analyzer defines DocumentAnalyzer class (this may be a naming wrapper elsewhere or a minor bug).
Install Mechanism
There is no install spec; this is an instruction-and-script skill that relies on host Python and pip-installed packages. Dependencies listed in SKILL.md and README (python-docx, requests, markdown, beautifulsoup4, Pillow) are reasonable. No remote binary downloads or extract-from-URL installs are used.
Credentials
The skill requests no environment variables or credentials and does not declare config paths. The only external access is optional network image downloads triggered by Markdown content — appropriate for embedding images but worth noting because it causes outbound HTTP(S) requests to hosts referenced in the Markdown.
Persistence & Privilege
The skill does not request always:true and does not attempt to modify other skills or system-wide configs. It writes output files and a temporary images directory inside the output location — normal and scoped to its purpose.
Assessment
This skill appears to do what it says: convert Markdown to .docx/.pdf/.html and apply templates. Before installing or running it: 1) Review any Markdown files for remote image URLs you don't trust (the skill will download them, making outbound requests). 2) Install dependencies in a controlled environment (virtualenv) and verify you are comfortable running arbitrary Python scripts from an unknown source. 3) If you don't need AI image suggestions or chart generation, inspect ai_analyzer.py to confirm it doesn't call external APIs (the provided snippet shows only local analysis and matplotlib usage). 4) Because package.json looks like a leftover/npm-style file, treat this as a Python project — no hidden installers were found. If you want higher assurance, run the scripts in a sandbox and review the full ai_analyzer and convert code paths for any network POSTs or unexpected subprocess calls.

Like a lobster shell, security has layers — review code before you run it.

latestvk9770qn9600q42b9er426v9sp584c0q7
80downloads
0stars
1versions
Updated 3w ago
v1.0.1
MIT-0

MD2DOC - Markdown 文档转换技能

将 Markdown 文件转换为专业美观的 Word (.docx)、PDF 和 HTML 文档。

安装

方式一:直接复制

md2doc 文件夹复制到 OpenClaw 的 skills 目录:

# Windows
xcopy /E md2doc %USERPROFILE%\.openclaw\skills\

# Linux/Mac
cp -r md2doc ~/.openclaw/skills/

方式二:安装依赖

pip install python-docx requests markdown beautifulsoup4 Pillow

功能特性

  • ✅ Markdown 转 Word (.docx)
  • ✅ Markdown 转 PDF(需安装 Word 或 LibreOffice)
  • 6 种样式模板(商务蓝、技术灰、简洁白、产品红、学术风、默认)
  • ✅ 图片自动嵌入(支持本地路径和网络图片)
  • ✅ 表格自动美化(表头带背景色)
  • ✅ 代码块带背景色
  • ✅ 标题层级自动处理
  • ✅ 中文排版优化
  • ✅ 同时输出 Word + PDF

使用方法

OpenClaw 中使用

当用户需要将 Markdown 文件转换为 Word/PDF 时:

  1. 确认文件路径 - 获取用户提供的 MD 文件路径
  2. 检查依赖 - 确保已安装 python-docx 和 requests
  3. 执行转换 - 使用脚本转换文件
  4. 返回结果 - 告知用户输出文件位置
# 在 OpenClaw 中调用
import subprocess
result = subprocess.run([
    "python", "skills/md2doc/scripts/md2doc.py", 
    "用户文件.md"
], capture_output=True, text=True)

命令行使用

# 转 Word(默认样式)
python scripts/md2doc.py input.md

# 同时转 Word + PDF
python scripts/md2doc.py input.md --pdf

# 指定输出目录
python scripts/md2doc.py input.md --output-dir ./output --pdf

# 使用样式模板
python scripts/md2doc.py input.md --style business
python scripts/md2doc.py input.md --style product --pdf

# 查看所有可用样式
python scripts/md2doc.py --list-styles

可用样式模板

样式说明适用场景
default标准样式一般文档
business商务蓝,蓝色主题企业报告、商务文档
tech技术灰,灰色主题技术文档、API 文档
minimal简洁白,极简风格轻量文档、笔记
product产品红,红色强调PRD、产品需求文档
academic学术风,宋体正文论文、学术报告

支持的 Markdown 语法

  • 标题(# ## ### 等)
  • 段落和文本格式(粗体斜体
  • 列表(有序/无序)
  • 图片(本地路径或 URL)
  • 表格
  • 代码块(行内和块级)
  • 引用块
  • 分隔线

工作流程

  1. 检查依赖:确保 Python 和必要库已安装
  2. 读取 MD 文件:解析 Markdown 内容
  3. 处理图片:下载网络图片,验证本地图片路径
  4. 生成 Word:使用 python-docx 创建 .docx 文件
  5. 生成 PDF(可选):使用 Word 转 PDF 或 reportlab
  6. 返回结果:告知用户输出文件路径

依赖安装

pip install python-docx markdown beautifulsoup4 requests Pillow

样式说明

  • 标题:微软雅黑,层级递减
  • 正文:宋体,11pt
  • 代码块:等宽字体,浅灰背景
  • 表格:带边框,表头加粗
  • 图片:最大宽度 6 英寸,居中

注意事项

  • 图片路径可以是相对路径(相对于 MD 文件位置)或绝对路径
  • 网络图片会自动下载并嵌入
  • 不支持的 Markdown 扩展语法会被当作普通文本处理

Comments

Loading comments...