← Back to Skills Marketplace
wang-junjian

Markitdown Converter

by 军舰 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
302
Downloads
1
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install markitdown-converter
Description
使用微软 markitdown 库将多种文档格式(PDF、DOC、DOCX、PPT、HTML等)转换为 Markdown。支持批量转换、保留格式、图片提取等功能。使用场景:(1) "把这个 PDF 转成 Markdown",(2) "批量转换这个文件夹里的文档",(3) "提取文档中的图片"。
README (SKILL.md)

MarkItDown 文档转换技能

使用微软的 markitdown 库将各种文档格式转换为 Markdown。

支持的格式

  • PDF (.pdf)
  • Word 文档 (.doc, .docx)
  • PowerPoint 演示文稿 (.ppt, .pptx)
  • Excel 电子表格 (.xlsx)
  • HTML 文件 (.html, .htm)
  • 图片文件 (通过 OCR)
  • 纯文本文件
  • 等等...

快速开始

单个文件转换

from markitdown import MarkItDown

md = MarkItDown()
result = md.convert("document.pdf")
print(result.text_content)

使用提供的脚本

# 转换单个文件
python3 scripts/convert.py input.pdf output.md

# 批量转换文件夹
python3 scripts/batch_convert.py input_folder/ output_folder/

# 提取文档中的图片
python3 scripts/extract_images.py document.pdf images_folder/

详细用法

单个文件转换

使用 scripts/convert.py

python3 scripts/convert.py \x3Cinput_file> [output_file]

如果不指定输出文件,会自动生成 .md 文件。

批量转换

使用 scripts/batch_convert.py

python3 scripts/batch_convert.py \x3Cinput_directory> \x3Coutput_directory>

会递归处理目录中的所有支持的文件。

图片提取

使用 scripts/extract_images.py

python3 scripts/extract_images.py \x3Cinput_file> \x3Coutput_directory>

从文档中提取所有图片并保存到指定目录。

脚本说明

  • scripts/convert.py - 单个文件转换脚本
  • scripts/batch_convert.py - 批量转换脚本
  • scripts/extract_images.py - 图片提取脚本

每个脚本都有 --help 选项查看详细参数。

安装依赖

Python 版本要求

markitdown 需要 Python 3.10 或更高版本。

检查 Python 版本:

python3.12 --version  # 或 python3.11, python3.13

安装 markitdown

使用 Python 3.10+ 安装:

# 使用 Python 3.12(推荐)
python3.12 -m pip install --user --break-system-packages "markitdown[all]"

# 或使用虚拟环境
python3.12 -m venv markitdown-env
source markitdown-env/bin/activate
pip install "markitdown[all]"

可选:系统依赖

某些格式转换可能需要额外的系统依赖:

  • PDF 处理: brew install poppler (macOS) 或 apt install poppler-utils (Linux)
  • OCR: brew install tesseract (macOS) 或 apt install tesseract-ocr (Linux)

验证安装

python3.12 -c "from markitdown import MarkItDown; print('安装成功!')"

使用脚本

所有脚本都支持使用特定 Python 版本运行:

# 使用 Python 3.12 运行
python3.12 scripts/convert.py input.pdf output.md
python3.12 scripts/batch_convert.py input_folder/ output_folder/
python3.12 scripts/extract_images.py document.pdf images_folder/
Usage Guidance
这是一个自洽的文档转换技能,但在安装/使用前请注意: - pip install 会在本地执行第三方包的安装代码。优先在虚拟环境(venv)中或容器里安装并运行,而不要使用全局系统环境。 - 在安装前在 PyPI 或源码仓库核验 markitdown 包的发布者、版本和下载量(确认是否为可信的微软相关包或官方实现)。若可能,查看包的源代码或 release 页面。 - 避免在批量转换时把系统关键目录(如 /etc、用户主目录的敏感子目录)作为输入目录;脚本会递归读取并写入你指定的目录。 - 注意脚本对不受信任的文档存在解析器层面的安全风险(恶意 PDF/Office 文件可能利用解析器漏洞)。对不信任的文件请在隔离环境中处理。
Capability Analysis
Type: OpenClaw Skill Name: markitdown-converter Version: 1.0.0 The skill bundle provides a legitimate interface for Microsoft's 'markitdown' library to convert various document formats (PDF, DOCX, etc.) into Markdown. The Python scripts (scripts/convert.py, scripts/batch_convert.py, and scripts/extract_images.py) contain standard file handling logic and lack any indicators of malicious intent, such as data exfiltration, unauthorized network access, or obfuscated code.
Capability Assessment
Purpose & Capability
名称和描述匹配实际代码:三个脚本(单文件转换、批量转换、图片提取)实现了声明的功能并使用 markitdown 库。没有要求与目的不符的凭据、二进制或配置路径。
Instruction Scope
SKILL.md 明确指导使用 markitdown 库并调用脚本,脚本只访问由用户提供的输入文件/目录并把输出写到指定目录;没有读取系统范围的敏感路径或访问未声明的环境变量。
Install Mechanism
没有 install spec(instruction-only 附带脚本),但文档建议通过 pip 安装 "markitdown[all]"(python3.12 -m pip install ...)。这是常见做法,但 pip 安装会在本地执行第三方包的安装脚本 —— 建议在虚拟环境或受控环境中安装并验证包来源/版本。
Credentials
技能不要求任何环境变量、凭据或外部服务访问;所需权限仅限于读取由用户指定的输入文件/目录和写输出文件/目录,与技能目的相称。
Persistence & Privilege
always: false,默认可由用户调用且允许模型自主调用(平台默认)。技能不修改其他技能或系统配置,也不请求长期驻留权限。
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install markitdown-converter
  3. After installation, invoke the skill by name or use /markitdown-converter
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of markitdown-converter: - Converts multiple document formats (PDF, DOC/DOCX, PPT, HTML, etc.) to Markdown. - Supports batch conversion and image extraction from documents. - Retains original formatting during conversion. - Provides convenient scripts for file, folder, and image extraction operations. - Requires Python 3.10 or higher with optional system dependencies for some formats (e.g., poppler, tesseract).
Metadata
Slug markitdown-converter
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is Markitdown Converter?

使用微软 markitdown 库将多种文档格式(PDF、DOC、DOCX、PPT、HTML等)转换为 Markdown。支持批量转换、保留格式、图片提取等功能。使用场景:(1) "把这个 PDF 转成 Markdown",(2) "批量转换这个文件夹里的文档",(3) "提取文档中的图片"。 It is an AI Agent Skill for Claude Code / OpenClaw, with 302 downloads so far.

How do I install Markitdown Converter?

Run "/install markitdown-converter" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Markitdown Converter free?

Yes, Markitdown Converter is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Markitdown Converter support?

Markitdown Converter is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Markitdown Converter?

It is built and maintained by 军舰 (@wang-junjian); the current version is v1.0.0.

💬 Comments