名称: markdown-converter
描述: 使用 markitdown 将文档和文件转换为 Markdown 格式。适用于将 PDF、Word (.docx)、PowerPoint (.pptx)、Excel (.xlsx, .xls)、HTML、CSV、JSON、XML、图像(含 EXIF/OCR)、音频(含转录)、ZIP 归档、YouTube 网址或 EPub 转换为 Markdown,以便进行大语言模型处理或文本分析。
使用 uvx markitdown 将文件转换为 Markdown 格式,无需安装。
# 转换并输出到标准输出
uvx markitdown input.pdf
# 保存到文件
uvx markitdown input.pdf -o output.md
uvx markitdown input.docx > output.md
# 从标准输入读取
cat input.pdf | uvx markitdown
-o OUTPUT # 指定输出文件
-x EXTENSION # 提示文件扩展名(用于标准输入)
-m MIME_TYPE # 提示 MIME 类型
-c CHARSET # 提示字符集(如 UTF-8)
-d # 使用 Azure Document Intelligence
-e ENDPOINT # Document Intelligence 服务端点
--use-plugins # 启用第三方插件
--list-plugins # 显示已安装插件
# 转换 Word 文档
uvx markitdown report.docx -o report.md
# 转换 Excel 表格
uvx markitdown data.xlsx > data.md
# 转换 PowerPoint 演示文稿
uvx markitdown slides.pptx -o slides.md
# 通过文件类型提示转换标准输入流
cat document | uvx markitdown -x .pdf > output.md
# 使用 Azure Document Intelligence 提升 PDF 提取效果
uvx markitdown scan.pdf -d -e "https://your-resource.cognitiveservices.azure.com/"
-d 选项使用 Azure Document Intelligence