AI Agent Hub
Back to skills
Word and WPS Batch Markdown Converter icon

Word and WPS Batch Markdown Converter

Office Efficiency Updated 2026.08.30

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

Please follow https://skillhub.cn/install/skillhub.md and install @user_f474679a/tomark-skill.

About this skill

The Problem

In Windows workflows, .docx, .doc, and .wps files do not cleanly become Markdown by default. .docx conversion can rely on mammoth to preserve headings, bold text, and lists, while .doc and .wps files need WPS Office to convert them to .docx first. Batch runs also need to preserve sub-directory structure and make it easy to audit which files succeeded or failed.

How It Works

tomark-skill centers on scripts/convert_to_markdown.py:
- Single or batch conversion: set SRC_DIR, optionally OUT_DIR, with default output under /markdown_output/
- Format routing: .docx uses mammoth; .doc / .wps use KWps.Application COM to produce .docx first
- Auditable results: Markdown files are emitted and 转换报告.md lists successes and failures
- Stable encoding: UTF-8 runtime mode is recommended, the script forces UTF-8 stdout, and output files are written as UTF-8

Boundaries

This skill targets Windows office-document conversion. If WPS Office is unavailable, .doc and .wps files cannot be converted, and only .docx files can be processed. Password-protected or severely corrupted documents may fail. It focuses on conversion and batch output, not perfect reconstruction of complex tables, formulas, or visual layout.

Use Cases

  • Maintain a Windows document library and batch-export nested .docx files to Markdown.
  • Convert legacy .doc or .wps files via WPS to .docx before exporting Markdown.
  • Use the generated conversion report to identify failures from protected or corrupted files.
  • Organize office materials in subdirectories and keep the same folder hierarchy in .md output.

Best For

  • Windows documentation engineers maintaining office archives who need stable UTF-8 Markdown output.
  • Editors organizing legacy Word or WPS materials who need batch conversion with headings, bold, and lists.
  • Team assistants handling nested document folders who want .md output to mirror the source hierarchy.
  • Operations engineers troubleshooting batch failures who need a report to locate problematic files.