T

tomark-skill

オフィス効率化v1.0.0
作者:user_f474679a更新日 2026-10-01@user_f474679a/tomark-skill
文書処理業務自動化

AlphaMoatによると、2026-09時点でtomark-skillのダウンロード数は1,201、スター数は0で、AIスキル全体5,078件中4,936位、オフィス効率化では435件中415位です。

インストール数
129
ダウンロード数
1201
スター数
-
総合順位
#4,936
全体の上位 98% · オフィス効率化の上位 96%
プラットフォームインストール数ダウンロード数スター数コメント
SkillHub ↗1291201-—

プラットフォームごとに集計方法と集計時点が異なります。

このスキルでできること

DOCXをMarkdownへ変換し、見出し、太字、リストを保持できます。DOCやWPSはWindows上のWPS Office COM自動化で先にDOCXへ変換する必要があります。一括変換ではサブディレクトリ構成を保持できます。実行前に入力範囲と出力先を確認し、特に旧形式で必要となるWindows/WPS環境を用意してください。

資料公開日 2026-10-29

できること

  • 単一のDOCXファイルをMarkdownに変換する
  • DOC、DOCX、WPS文書を一括変換する
  • 一括出力でサブディレクトリ構成を保つ

使う場面

  • 利用者がWordまたはWPS文書のMarkdown変換を依頼したとき
  • 対象形式と出力先を確認できたとき
  • 必要なmammothまたはWindows/WPS環境を利用できるとき

プロンプト例

スキルのドキュメントをもとに生成した例であり、実際の実行結果ではありません。

このフォルダー内のDOCXをサブディレクトリ構成を保って一括Markdown変換してください。まず処理するファイルと出力先を一覧にしてください。

月次の推移

ダウンロード数1201
264612902026-03 · ダウンロード数 912026-05 · ダウンロード数 4342026-06 · ダウンロード数 5802026-07 · ダウンロード数 8202026-08 · ダウンロード数 9522026-09 · ダウンロード数 120126-0326-09
スター数-
0112026-03 · スター数 -2026-05 · スター数 -2026-06 · スター数 -2026-07 · スター数 -2026-08 · スター数 -2026-09 · スター数 -26-0326-09

2026-09 から集計方法を変更し、同名スキルを作者ごとに分けて集計し、全スキルを対象にしました。破線は変更前の月で、変更後のデータとは直接比較せず、変更をまたぐ増減も計算していません。

月ダウンロード数前月比スター数
2026-091201—-
2026-08952+16.1%-
2026-07820+41.4%-
2026-06580+33.6%-
2026-05434—-
2026-0391—-

SKILL.md 原文

作者が公開した元のファイルをテキストのまま表示しています。AlphaMoat による編集や審査はしていません。リンクはクリックできません。コマンドは内容を確認してから実行してください。取得日 2026-10-23。

3.5 KB・SkillHub v1.0.0
---
name: tomark-skill
description: >
  This skill should be used when the user wants to convert documents (.doc, .docx, .wps)
  to Markdown format — either a single file or an entire folder in batch.
  Trigger phrases include: "转为markdown", "转成md", "文档转markdown", "批量转换markdown",
  "convert to markdown", "doc to md", "wps转markdown".
  Provides a ready-to-run Python script that handles .docx (via mammoth), and .doc/.wps
  (via WPS Office COM automation on Windows), producing clean Chinese-language Markdown
  with no garbled characters.
すべて表示(全 130 行)
---

# tomark-skill — 文档批量转 Markdown

## Overview

To convert Word/WPS documents (.doc, .docx, .wps) to Markdown (.md) format.

**Supported formats:**
- `.docx` — converted via `mammoth` (preserves headings, bold, lists)
- `.doc` / `.wps` — converted via WPS Office COM (`KWps.Application`) to .docx first, then mammoth
- Batch or single file, with sub-directory structure preserved

**Prerequisites (Windows):**
- Python 3.x
- `mammoth` library: `pip install mammoth`
- `pywin32` library: `pip install pywin32`
- WPS Office installed (for .doc/.wps files)

---

## Workflow Decision Tree

```
User request
    │
    ├─ Single file?
    │       └─ Call convert_file() directly
    │
    └─ Folder / batch?
            └─ Run scripts/convert_to_markdown.py with SRC_DIR set
```

---

## Step 1 — Check Prerequisites

To verify the environment before running:

```python
import shutil, importlib

# Check mammoth
try:
    import mammoth
    print("mammoth: ok")
except ImportError:
    print("mammoth: MISSING — run: pip install mammoth")

# Check pywin32 (for .doc/.wps)
try:
    import win32com.client
    print("pywin32: ok")
except ImportError:
    print("pywin32: MISSING — run: pip install pywin32")

# Check WPS Office
import glob
wps = glob.glob("C:/Program Files (x86)/Kingsoft/WPS Office/*/office6/wps.exe")
print("WPS Office:", wps[0] if wps else "NOT FOUND")
```

If WPS Office is not installed, `.doc`/`.wps` files cannot be converted.
Only `.docx` files can be processed with mammoth alone.

---

## Step 2 — Configure and Run

To run the batch conversion script:

1. Open `scripts/convert_to_markdown.py`
2. Set `SRC_DIR` to the source folder path
3. Optionally set `OUT_DIR` (default: `<SRC_DIR>/markdown_output/`)
4. Run: `python -X utf8 scripts/convert_to_markdown.py`

To convert a single file inline:

```python
from pathlib import Path
# import the helper functions from the script
from scripts.convert_to_markdown import convert_file

src = Path(r"D:\documents\example.doc")
out = Path(r"D:\documents\example.md")
ok, msg = convert_file(src, out)
print(ok, msg)
```

---

## Step 3 — Interpret the Output

After conversion completes:

- All `.md` files are in `OUT_DIR`, mirroring the original sub-directory structure
- A `转换报告.md` report is generated listing successes and failures
- Typical failure causes:
  - WPS Office not installed (for .doc/.wps)
  - Password-protected documents
  - Severely corrupted files

---

## Encoding Notes

- Always run with `python -X utf8` on Windows to avoid GBK encoding issues
- The script forces `sys.stdout` to UTF-8 internally
- Output `.md` files are always written as UTF-8

---

## Resources

### scripts/
- `convert_to_markdown.py` — main batch conversion script (configure `SRC_DIR` at the top)

### references/
- `format_guide.md` — notes on mammoth output format and post-processing tips

オフィス効率化の人気スキル

データ月:2026-09 · ダウンロード数、スター数、インストール数は公開スキルレジストリ(ClawHub、SkillHub)から月単位で集計しています。詳しくはデータの方法論をご覧ください。