Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
etiwo avatar

Mineru Converter

  • 1 installs
  • Updated May 19, 2026
  • etiwo/mineru-converter

Converts PDF, DOCX, PPTX, XLSX, EPUB, and image files to Markdown using MinerU, with incremental detection, page ranges, OCR, and image extraction.

About

Batch-converts documents to Markdown via MinerU (EPUB via a built-in converter), skipping already-converted files by SHA256 and extracting images into Obsidian-compatible paths. A developer uses it to feed documents into a knowledge pipeline or convert a folder of PDFs.

  • Incremental conversion skips already-converted files by hash
  • Supports page ranges, OCR method, language, and image path rewriting

Mineru Converter by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #565 of 688 Office & Documents skills by installs in the Skillselion catalog
  • Data as of Jul 8, 2026 (Skillselion catalog sync)
npx skills add https://github.com/etiwo/mineru-converter --skill mineru-converter

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
Last updatedMay 19, 2026
Repositoryetiwo/mineru-converter

What it does

Converts PDF, DOCX, PPTX, XLSX, EPUB, and image files to Markdown using MinerU, with incremental detection, page ranges, OCR, and image extraction.

Files

SKILL.mdMarkdownGitHub ↗

MinerU Document Converter

Convert documents (PDF, DOCX, PPTX, XLSX, EPUB, PNG, JPG, JPEG, BMP, TIFF) to Markdown.

What I do

  • Convert single files or batch directories to Markdown
  • Incremental conversion — skips already-converted files (SHA256 based)
  • Extract and organize images into raw/attachments/<hash>/
  • Rewrite image paths in Markdown to be Obsidian-compatible
  • Clean up MinerU temporary files
  • Support page range, OCR method, and language selection
  • Convert EPUB files to Markdown with image extraction (no MinerU needed)

When to use me

Use when the user wants to:

  • Convert a PDF or other document to Markdown
  • Convert a specific page range of a PDF
  • Batch convert a folder of documents
  • Check which files are already converted and which need conversion
  • Integrate document conversion into a knowledge pipeline

Source and Output

  • Source: Documents in the project's inbox/ directory
  • Output: Converted files in the project's raw/ directory
  • Manifest: raw/manifest.json tracks conversion state

Prerequisites

  • MinerU must be installed for PDF/DOCX/PPTX/XLSX/image conversion (mineru --version)
  • EPUB conversion uses a built-in converter and does not require MinerU
  • Python packages: ebooklib, html2text (installed automatically with pip install -r requirements.txt)
  • The converter automatically detects if MinerU is installed before converting
  • If MinerU is not found, the converter will prompt the user to install it

Commands

Always run commands from the project directory, or use the full path. The converter lives at: ~/.config/opencode/skills/mineru-converter/

Convert a single file

cd <project_dir> && python3 ~/.config/opencode/skills/mineru-converter/run.py convert --file <path> [--force] [--pages 3-5] [--method ocr] [--lang en]
OptionDescriptionExample
--filePath to file to convert (required)--file report.pdf
--forceForce re-conversion even if already done--force
--pagesPage range to convert (1-indexed, only for PDF)--pages 3-5
--methodPDF parsing method: auto, txt, or ocr--method ocr
--langDocument language code--lang en

Convert all files in a directory

cd <project_dir> && python3 ~/.config/opencode/skills/mineru-converter/run.py convert --dir <path> [--force] [--workers 2] [--method ocr] [--lang en]
OptionDescriptionExample
--dirDirectory of files to convert (required)--dir inbox/
--forceForce re-conversion even if already done--force
--workersParallel workers for batch (default: 1)--workers 2
--methodPDF parsing method applied to all files--method ocr
--langDocument language applied to all files--lang en
Note: --pages is only allowed with --file, not with --dir.

View conversion plan (no execution)

python3 ~/.config/opencode/skills/mineru-converter/run.py plan --dir <path> [--json]

Check conversion status

python3 ~/.config/opencode/skills/mineru-converter/run.py status

Output Structure

<output_dir>/
├── document.md                  # Converted markdown
├── attachments/
│   └── <hash8>/                 # Images grouped by file hash
│       ├── image1.jpg
│       └── image2.png
└── manifest.json                # Conversion records

JSON Output

Add --json flag to get structured output for parsing:

{
  "scanned": 3,
  "processed": 1,
  "skipped": 2,
  "failed": 0,
  "items": [
    {
      "path": "/abs/path/to/file.pdf",
      "status": "success",
      "details": {
        "md_path": "document.md",
        "images": 5
      }
    }
  ]
}

Supported Formats

PDF, DOCX, PPTX, XLSX, EPUB, PNG, JPG, JPEG, BMP, TIFF

Page Range Syntax

Use --pages to specify a range of pages to convert (PDF only):

# Convert pages 3 to 5
convert --file doc.pdf --pages 3-5

# Convert single page 10
convert --file doc.pdf --pages 10

Pages are 1-indexed (human-friendly) and are automatically converted to 0-indexed for MinerU.

OCR Method

Use --method to control PDF parsing strategy:

MethodDescriptionUse case
autoAuto-detect (default)Most documents
txtText extraction onlyDocuments with extractable text
ocrOCR recognitionScanned/image PDFs
# Use OCR for scanned PDFs
convert --file scanned.pdf --method ocr

# Use text extraction for digital PDFs
convert --file digital.pdf --method txt

Language

Use --lang to specify the document language for better OCR accuracy:

# English document
convert --file doc.pdf --lang en

# Japanese document
convert --file doc.pdf --lang ja

# Chinese (default)
convert --file doc.pdf --lang ch

Configuration

Edit config.yaml to change defaults:

mineru:
  command: "mineru"          # or absolute path to venv/bin/mineru
  args:
    backend: "pipeline"
    model: "auto"
    language: "ch"           # default language
    method: "auto"           # default parsing method

Error Handling

  • Unsupported file formats are skipped (not failed)
  • Individual file failures do not stop the batch
  • Failed files are logged in manifest.json with error details
  • MinerU installation is checked before every conversion

Related skills

Office & Documentspipelinesetl

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.