據 AlphaMoat 統計,截至 2026-09,tomark-skill 累計下載 1,201 次、獲 0 個星標,在全部 5,078 個 AI 技能中排名第 4,936 位,在「辦公效率」分類(435 個)中排名第 415 位。
| 平台 | 累計安裝 | 累計下載 | 星標 | 評論 |
|---|---|---|---|---|
| SkillHub ↗ | 129 | 1201 | - | — |
各平台的計數口徑不同,統計時間不一致。
該技能把 DOCX 文件轉換為 Markdown,並可按原有結構保留標題、粗體與列表;DOC 和 WPS 檔案需要先透過 Windows 上的 WPS Office COM 轉為 DOCX,再繼續轉換。批次任務可保留子目錄結構。執行前應確認檔案範圍、目標目錄以及所需轉換環境,尤其是舊格式對 Windows/WPS 的依賴。
資料釋出於 2026-10-29
以下是根據技能文件生成的示例,不代表實際執行結果。
2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。
| 月份 | 累計下載 | 環比 | 星標 |
|---|---|---|---|
| 2026-09 | 1201 | — | - |
| 2026-08 | 952 | +16.1% | - |
| 2026-07 | 820 | +41.4% | - |
| 2026-06 | 580 | +33.6% | - |
| 2026-05 | 434 | — | - |
| 2026-03 | 91 | — | - |
以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。
--- 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.
---
# 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
透過 MCP 在騰訊文件裡新建、編輯與管理線上文件的完整操作手冊。
在保留公式、格式和活頁簿結構的前提下建立、檢查或編輯 Excel 檔案。
處理 Word 與 DOCX 文件的作業指南,著重維持樣式、編號與版面。
透過命令列存取 Gmail、日曆、Drive、Contacts、Sheets 與 Docs。
PDF和圖片文字提取 將文件文字、表格與掃描頁識別整理為文字結果。
按主題與風格自動生成 PPT 檔案的技能。
透過 kdocs-cli 操作金山文件雲文件的官方技能。
用自然語言指令改 PDF 指定頁的小工具。
資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。