据 AlphaMoat 统计,截至 2026-09,tomark-skill 累计下载 1,201 次、获 0 个星标,在全部 5,078 个 AI 技能中排名第 4,936 位,在「办公效率」分类(435 个)中排名第 415 位。
| 平台 | 累计安装 | 累计下载 | 星标 | 评论 |
|---|---|---|---|---|
| SkillHub ↗ | 129 | 1,201 | - | — |
各平台的计数口径不同,统计时间不一致。
该技能把 DOCX 文档转换为 Markdown,并可按原有结构保留标题、粗体与列表;DOC 和 WPS 文件需要先通过 Windows 上的 WPS Office COM 转为 DOCX,再继续转换。批量任务可保留子目录结构。运行前应确认文件范围、目标目录以及所需转换环境,尤其是旧格式对 Windows/WPS 的依赖。
资料发布于 2026-10-29
以下是根据技能文档生成的示例,不代表实际运行结果。
2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。
| 月份 | 累计下载 | 环比 | 星标 |
|---|---|---|---|
| 2026-09 | 1,201 | — | - |
| 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、通讯录、Sheets 与 Docs。
PDF和图片文字提取 将文档文字、表格与扫描页识别整理为文本结果。
按主题与风格自动生成 PPT 文件的技能。
通过 kdocs-cli 操作金山文档云文档的官方技能。
用自然语言指令改 PDF 指定页的小工具。
数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。