Markdown Converter
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
サポートされている形式
- ドキュメント: PDF、Word (.docx)、PowerPoint (.pptx)、Excel (.xlsx、.xls)
- Web/データ: HTML、CSV、JSON、XML
- メディア: 画像 (EXIF + OCR)、音声 (EXIF + 文字起こし)
- その他: ZIP(内容を反復処理)、YouTube URL、EPub
オプション
-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/"
注意事項
- 出力は文書構造を保持します: 見出し、表、リスト、リンク
- 初回実行時に依存関係がキャッシュされ、以降の実行は高速になります
- 抽出が不十分な複雑なPDFの場合は、
-dオプションでAzure Document Intelligenceを使用してください