mcpField
M
markdown-converter

markdown-converter

github.com/intellectronica文档处理2981.7k 次安装27 周前更新
代码仓库

关于 markdown-converter

markdown-converter 是一项通过 `uvx markitdown` 将多种文件转换为 Markdown 的技能,无需预先安装。适合需要提取文档结构并输出 Markdown 的工作流程。

主要功能

  1. 01无需安装即可运行转换
  2. 02支持文档、网页及数据格式
  3. 03处理图像 OCR 与音频转写
  4. 04保留标题、表格、列表和链接
  5. 05支持插件及 Azure 文档识别

适用场景

  1. 01将 PDF、Word 或演示文稿转为 Markdown
  2. 02把 CSV、JSON 或 HTML 转成可读文本
  3. 03从图像和音频提取文本内容

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/intellectronica/agent-skills --skill markdown-converter

安装后在 Claude Code 中输入/markdown-converter确认已加载。

详细介绍

Markdown 转换器

使用 uvx markitdown 将文件转换为 Markdown——无需安装。

基本用法

# Convert to stdout
uvx markitdown input.pdf

# Save to file
uvx markitdown input.pdf -o output.md
uvx markitdown input.docx > output.md

# From stdin
cat input.pdf | uvx markitdown

支持的格式

  • 文档:PDF、Word(.docx)、PowerPoint(.pptx)、Excel(.xlsx、.xls)
  • Web/数据:HTML、CSV、JSON、XML
  • 媒体:图像(EXIF + OCR)、音频(EXIF + 转录)
  • 其他:ZIP(遍历内容)、YouTube URL、EPub

选项

-o OUTPUT      # Output file
-x EXTENSION   # Hint file extension (for stdin)
-m MIME_TYPE   # Hint MIME type
-c CHARSET     # Hint charset (e.g., UTF-8)
-d             # Use Azure Document Intelligence
-e ENDPOINT    # Document Intelligence endpoint
--use-plugins  # Enable 3rd-party plugins
--list-plugins # Show installed plugins

示例

# Convert Word document
uvx markitdown report.docx -o report.md

# Convert Excel spreadsheet
uvx markitdown data.xlsx > data.md

# Convert PowerPoint presentation
uvx markitdown slides.pptx -o slides.md

# Convert with file type hint (for stdin)
cat document | uvx markitdown -x .pdf > output.md

# Use Azure Document Intelligence for better PDF extraction
uvx markitdown scan.pdf -d -e "https://your-resource.cognitiveservices.azure.com/"

注意事项

  • 输出会保留文档结构:标题、表格、列表、链接
  • 首次运行会缓存依赖项;后续运行速度更快
  • 对于提取效果不佳的复杂 PDF,可使用 -d 配合 Azure Document Intelligence

评论

支持 Markdown