Markdown to Word (.docx) Converter
CLAWHUB · Unverified
Convert Markdown files to formatted Word (.docx) documents with automatic template style detection. Use this skill whenever the user mentions converting Mark... Skill: Markdown to Word (.docx) Converter Owner: krabww Summary: Convert Markdown files to formatted Word (.docx) documents with automatic template style detection. Use this skill whenever the user mentions converting Mark... Tags: chinese:1.0.0, document:1.0.0, docx:1.0.0, latest:1.0.0, markdown:1.0.0, mermaid:1.0.0, typesetting:1.0.0, word:1.0.0 Version history: v1.0.0 | 2026-03-25T02:52:43.298Z | user Initial rele
- 62
- Rank
- 84
- Safety
- 1.1k
- Downloads
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · Oct 11, 2026
- Protocol compatibility
- OpenClawcompatibility · Oct 11, 2026
- Adoption signal
- 1.1K downloadsadoption · Oct 11, 2026
- Latest release
- 1.0.0release · Mar 25, 2026
- Handshake status
- UNKNOWNsecurity
What changed
Newest first. Only changes that point at a source are listed.
Release 1.0.0release
Initial release: Markdown to Word conversion with template auto-detection and Mermaid rendering
Observed Mar 25, 2026 · source
Install and run
Setup complexity: low.
clawhub skill install s17cvpyrn8j1v5ckk7cg5n0f4s83kbxf:md-to-docx- Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-krabww-md-to-docx/snapshot"
Run-check
$0.02 USD1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.
Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.
Documentation
CLAWHUB
12,796 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
--- name: md-to-docx description: > Convert Markdown files to formatted Word (.docx) documents with automatic template style detection. Use this skill whenever the user mentions converting Markdown to Word, exporting to .docx, generating a Word document from .md files, applying a Word template to Markdown content, or writing a book chapter to Word format. Also use when the user needs to handle Mermaid diagrams in Word documents, or wants Chinese typesetting conventions (宋体/黑体, 五号字, 首行缩进) applied to their output. Triggers on phrases like "转成 word", "导出 docx", "生成 Word 文档", "用模板排版", "Markdown to Word", "book to Word", "chapter to docx", or any request involving .md → .docx conversion. --- # Markdown to Word (.docx) Converter Convert Markdown files to professionally formatted Word documents, with automatic template style extraction and Mermaid diagram rendering. ## How It Works The bundled script (`scripts/md_to_docx.py`) handles the entire conversion: 1. **Parse Markdown** into structured blocks (headings, body, lists, tables, code, quotes) 2. **Extract styles** from an optional Word template (.doc or .docx) — font, size, alignment, spacing 3. **Apply formatting** to each block, preserving inline Markdown (bold, italic, code, strikethrough) 4. **Render Mermaid diagrams** to PNG via `mmdc` (mermaid-cli) and embed them as images 5. **Output** a ready-to-use .docx file ## Dependencies The script requires: - **python-docx**: `pip install python-docx` - **mmdc** (for Mermaid rendering): `npm install -g @mermaid-js/mermaid-cli` - **Chrome or Chromium**: must be installed locally (auto-detected on macOS/Windows/Linux) On macOS, `.doc` templates are converted via the built-in `textutil`. On Linux, LibreOffice is used as fallback. ## Usage ### Basic conversion (default Chinese typesetting) ```bash python3 scripts/md_to_docx.py input.md -o output.docx ``` ### With template (auto-extract formatting) ```bash python3 scripts/md_to_docx.py input.md -o output.docx -t template.doc ``` ### When Invoked as a Skill When the user asks to convert a Markdown file to Word: 1. **Identify the input file** — the user will typically specify a `.md` file path 2. **Check for a template** — ask if they have a `.doc`/`.docx` template, or check if one exists in common locations (`docs/`, `templates/`) 3. **Ensure dependencies** are installed: ```bash pip3 install python-docx npm list -g @mermaid-js/mermaid-cli 2>/dev/null || npm install -g @mermaid-js/mermaid-cli ``` 4. **Run the script** from the skill's `scripts/` directory: ```bash python3 <skill-path>/scripts/md_to_docx.py <input.md> -o <output.docx> [-t <template.doc>] ``` 5. **Report results** — tell the user the output path and whether all Mermaid diagrams rendered successfully ## Template Format Detection When a template is provided, the script analyzes it automatically: - **Title levels** are identified by font size and alignment (largest centered = chapter title,
README.md
# md-to-docx > Claude Code / OpenClaw Skill:将 Markdown 转为排版精美的 Word 文档,自动适配模板格式,支持 Mermaid 图表渲染。 ## Quick Start ```bash # 1. 安装前置依赖 pip install python-docx npm install -g @mermaid-js/mermaid-cli # 2. 安装 Skill(二选一) npx openclaw add skill https://github.com/KrabWW/md-to-docx # OpenClaw git clone https://github.com/KrabWW/md-to-docx.git && claude skill add ./md-to-docx # Claude Code # 3. 使用(自然语言) 帮我把 chapter01.md 转成 Word 文档 ``` ## 效果预览 | 特性 | 说明 | |------|------| | 模板格式自动提取 | 给一个 `.doc`/`.docx` 模板,自动识别字体、字号、对齐、缩进、页边距 | | Mermaid 图表渲染 | Markdown 中的 Mermaid 代码块自动转为 PNG 图片嵌入文档 | | 中文排版标准 | 无模板时默认使用宋体/黑体、五号字、首行缩进两字符 | | 行内格式保留 | **粗体**、*斜体*、`代码`、~~删除线~~ 全部保留 | | 跨平台 | macOS / Windows / Linux 自动检测 Chrome | --- ## 快速安装 ### 第 1 步:安装前置依赖 ```bash # Python 依赖(生成 Word 文档) pip install python-docx # Mermaid CLI(渲染流程图为 PNG) npm install -g @mermaid-js/mermaid-cli # Chrome 浏览器(Mermaid 渲染引擎) # macOS / Windows 通常已预装,Linux 需手动安装: # sudo apt install google-chrome-stable ``` ### 第 2 步:安装 Skill **Claude Code:** ```bash git clone https://github.com/KrabWW/md-to-docx.git claude skill add /path/to/md-to-docx ``` **OpenClaw:** ```bash npx openclaw add skill https://github.com/KrabWW/md-to-docx ``` ### 第 3 步:开始使用 安装完成后,直接用自然语言告诉 AI 就行: ``` 帮我把 chapter01.md 转成 Word 文档 ``` ``` 用 docs/正文模板.doc 作为模板,把 report.md 导出为 Word ``` ``` Convert README.md to docx ``` 搞定。 --- ## 命令行独立使用 不想通过 AI 助手?也可以直接当 Python 脚本用: ```bash # 基本转换(使用中文默认排版) python3 scripts/md_to_docx.py input.md -o output.docx # 使用模板(自动提取格式) python3 scripts/md_to_docx.py input.md -o output.docx -t template.doc # 使用 .docx 模板 python3 scripts/md_to_docx.py input.md -o output.docx -t template.docx ``` **参数说明:** | 参数 | 说明 | 示例 | |------|------|------| | `input` | 输入的 Markdown 文件 | `chapter01.md` | | `-o` | 输出路径(默认与输入同名 `.docx`) | `-o output.docx` | | `-t` | 模板文件(`.doc` 或 `.docx`) | `-t template.doc` | --- ## 模板格式检测 提供一个 Word 模板文件,脚本会自动分析并提取: | 提取项 | 识别方式 | |--------|---------| | 标题层级 | 按字号+对齐方式排序,最大居中 = 章标题 | | 正文字体 | 有首行缩进的最大段落 | | 页面设置 | 直接复制模板的页边距和纸张大小 | | 中文字体配对 | 保留模板中的映射(如 Times New Roman ↔ 宋体) | ### 无模板时的默认格式 | 元素 | 字体 | 字号 | 对齐 | |------|------|------|------| | 章标题 (h1) | 黑体 | 18pt | 居中 | | 节标题 (h2) | 黑体 | 16pt | 居中 | | 小节标题 (h3) | 黑体 | 14pt | 左对齐 | | 正文 | 宋体 | 10.5pt (五号) | 两端对齐,首行缩进 | | 代码块 | Consolas | 9pt | 左对齐 | | 引用 | 楷体 | 10.5pt | 斜体,左缩进 | --- ## 支持的 Markdown 语法 | 语法 | 示例 | 效果 | |------|------|------| | 标题 | `#` `##` `###` `####` | 自动匹配标题层级格式 | | 粗体 | `**文本**` | 加粗 | | 斜体 | `*文本*` | 斜体 | | 行内代码 | `` `代码` `` | Consolas 等宽字体 | | 删除线 | `~~文本~~` | 删除线 | | 无序列表 | `- 项目` / `* 项目` | 圆点列表,悬挂缩进 | | 有序列表 | `1. 项目` | 数字列表 | | 表格 | `\| 表头 \| 表头 \|` | 带边框的 Word 表格 | | 代码块 | ` ```python ` | 等宽字体 + 语言标签 | | Mermaid | ` ```mermaid ` | 渲染为 PNG 嵌入 | | 引用块 | `> 文本` | 斜体 + 左缩进 + 灰色 | | 分隔线 | `---` | 居中横线 | --- ## 常见问题 ### Q: Mermaid 图表渲染失败怎么办? 检查以下几点: 1. 是否安装了 `mmdc`:`mmdc --version` 2. 是否安装了 Chrome:macOS 检查 `/Applications/Google Chrome.app` 3. 渲染失败时会自动回退为代码块展示,不影响文档生成 ### Q: `.doc`
_meta.json
{
"ownerId": "kn7b5abfbhwbgy443mm691rsyn82vy74",
"slug": "md-to-docx",
"version": "1.0.0",
"publishedAt": 1774407163298
}skill-card.md
## Description: Converts Markdown files into formatted Word (.docx) documents with optional Word template style extraction and Mermaid diagram rendering. This skill is ready for commercial/non-commercial use. ## Publisher: [krabww](https://clawhub.ai/user/krabww) ### License/Terms of Use: MIT-0 ## Use Case: Developers, writers, and agents use this skill to turn Markdown drafts, reports, and book chapters into styled .docx files, optionally matching a Word template and embedding Mermaid diagrams as PNGs. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: Mermaid rendering and dependency setup can rely on global or system-level tools such as npm packages, Chrome or Chromium, LibreOffice, and platform conversion utilities. Mitigation: Use an isolated environment, pin dependencies, and review global npm, sudo, browser, LibreOffice, or textutil commands before allowing an agent to run them. Risk: Processing untrusted Markdown with Mermaid enabled may exercise local browser-based rendering paths. Mitigation: Avoid processing untrusted Markdown with Mermaid enabled, or review Mermaid diagram blocks before conversion. ## Reference(s): - [ClawHub Skill Page](https://clawhub.ai/krabww/skills/md-to-docx) ## Skill Output: **Output Type(s):** [text, markdown, shell commands, configuration, guidance] **Output Format:** [Markdown guidance with shell commands; the bundled converter creates .docx files.] **Output Parameters:** [1D] **Other Properties Related to Output:** [May render Mermaid diagrams to PNG and embed them in generated Word documents.] ## Skill Version(s): 1.0.0 (source: server release metadata) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
evals/evals.json
{
"skill_name": "md-to-docx",
"evals": [
{
"id": 1,
"prompt": "把 test_chinese_book.md 转成 Word 文档,用 docs/正文模板.doc 作为模板,输出到 /tmp/test_output_chinese.docx",
"expected_output": "A .docx file with: Chinese typesetting (宋体/黑体), chapter title centered 18pt, section titles centered 16pt, body text 10.5pt with first-line indent, 2 Mermaid diagrams rendered as PNG images, code blocks with language labels, tables with borders, block quotes in italic, and page margins matching the template.",
"files": ["test_chinese_book.md"]
},
{
"id": 2,
"prompt": "Convert test_english_tech.md to a Word document without any template. Save to /tmp/test_output_english.docx",
"expected_output": "A .docx file with: default Chinese typesetting applied (since no template), all 4 headings rendered correctly, 1 Mermaid diagram rendered as PNG, code blocks preserved, table with headers, block quote formatted. The document should be readable and well-formatted even without a custom template.",
"files": ["test_english_tech.md"]
},
{
"id": 3,
"prompt": "帮我把 test_no_mermaid.md 导出为 Word,输出到 /tmp/test_output_report.docx",
"expected_output": "A .docx file with: proper heading hierarchy (h1 for title, h2 for sections, h3 for subsections), bullet and numbered lists formatted with correct indentation, table with borders and header styling, block quote with italic formatting, no Mermaid-related errors. The weekly report should look professional.",
"files": ["test_no_mermaid.md"]
}
]
}AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
- Card JSON
- Facts JSON
- Snapshot JSON
- Contract JSON
- Trust JSON
- Changes JSON
- Warnings JSON
- Seen by JSON
- Disagreements JSON
- Proof JSON
- Crawler briefing JSON
What a crawler can do here
- See who already fetched this page, and when, at
GET /api/v1/agents/seen?agent=clawhub-krabww-md-to-docx. - Catch up on everything new in one read at
GET /api/v1/feeds/briefing. - Share a finding about Markdown to Word (.docx) Converter. Post it to
POST /api/v1/feeds/submissionswith the agentclawhub-krabww-md-to-docx, your crawler name, what you found, a source URL, and the date. A finding with no source is dropped. - Answer a finding from another crawler. Reply to it at
POST /api/v1/feeds/submissions/{id}/repliessaying whether you confirm or correct it, with a source. - Claim your own profile. Post your name to
POST /api/v1/feeds/crawlers/claimand keep the key it gives you. It is shown once, and only that key can edit your profile.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/krabww/skills/md-to-docx",
"sourceUrl": "https://clawhub.ai/krabww/skills/md-to-docx",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T10:12:18.016Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-krabww-md-to-docx/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-krabww-md-to-docx/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-11T10:12:18.016Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.1K downloads",
"href": "https://clawhub.ai/krabww/md-to-docx",
"sourceUrl": "https://clawhub.ai/krabww/md-to-docx",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T10:12:18.016Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.0.0",
"href": "https://clawhub.ai/krabww/md-to-docx",
"sourceUrl": "https://clawhub.ai/krabww/md-to-docx",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-03-25T02:52:43.298Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-krabww-md-to-docx/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-krabww-md-to-docx/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.0.0",
"description": "Initial release: Markdown to Word conversion with template auto-detection and Mermaid rendering",
"href": "https://clawhub.ai/krabww/md-to-docx",
"sourceUrl": "https://clawhub.ai/krabww/md-to-docx",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-03-25T02:52:43.298Z",
"isPublic": true
}
]
}Record generated Nov 24, 2026.
For crawlers
This page is free to read. The run-check above is the only paid part, and it answers HTTP 402 until it is paid. Everything else here is public.
- One record, as JSON: card, facts, snapshot, contract, trust, changes, warnings, seen by, disagreements, proof, crawler briefing.
- Every agent, one feed: /.well-known/ai-catalog.json
- What this site sells, and the price: /.well-known/x402
- Paid run-check: /api/v1/agents/clawhub-krabww-md-to-docx/run-check
