AI Agent Hub
Back to skills
DOCX to Markdown with Images icon

DOCX to Markdown with Images

Office Efficiency Updated 2026.08.29

Paste the following prompt into your AI chat to install this skill:

Please install @user_29e2fa9e/docx-to-md-with-images using https://skillhub.cn/install/skillhub.md.

About this skill

What It Solves

Converting .docx files to Markdown often loses images, leaves broken absolute paths, and leaves HTML styling behind the text. For engineers who need the output for documentation, search, or further editing, that result is hard to reuse. This skill targets high-fidelity .docx to .md conversion: it preserves headings, tables, lists, bold/italic formatting, and extracts images into usable relative-path assets.

How It Works and Where It Stops

The main workflow prefers pandoc: it checks for pandoc, optionally auto-installs it, runs conversion, then uses fix_images.py to flatten img/media/ into img/, rewrite ![](...) links to relative paths, and remove stray HTML tags or style attributes around images. If pandoc is unavailable, the python-docx fallback can handle headings, inline formatting, nested lists, and tables, but it does not extract images. For non-Word formats such as PDF, PPTX, XLSX, HTML, CSV, JSON, and XML, the skill can try uvx markitdown; on some Windows systems this may fail due to onnxruntime DLL issues, so format-specific tools like python-pptx or openpyxl may be needed. Also, .emf images have poor Markdown viewer compatibility, so converting them to PNG is safer, and GFM output is recommended for broad compatibility.

Use Cases

  • Convert a Word weekly report into GFM, preserving headings, tables, images, and relative image paths.
  • Turn a customer .docx manual into Markdown, then verify image paths and remove stray HTML styles.
  • Fall back to python-docx on a machine without pandoc for headings, lists, and tables in internal docs.
  • Extract searchable text from PPTX or XLSX via markitdown, switching to format-specific parsers if it fails.

Best For

  • Documentation engineers who convert Word specs into searchable Markdown while keeping screenshots intact.
  • QA engineers turning .docx test reports, tables, lists, and images into wiki-ready Markdown.
  • Project managers who archive client Word manuals and need consistent Markdown with fixed image paths.
  • DevOps engineers migrating docs on restricted machines using python-docx when pandoc is unavailable.