markdown-to-docx
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesemarkdown-to-docx
Markdown转DOCX
Convert markdown files to Microsoft Word (.docx) documents.
将Markdown文件转换为Microsoft Word(.docx)文档。
Installation Required
需要安装依赖
bash
cd .claude/skills/markdown-to-docx
npm installDependencies: (uses docx internally)
markdown-docxbash
cd .claude/skills/markdown-to-docx
npm install依赖: (内部使用docx库)
markdown-docxQuick Start
快速开始
bash
undefinedbash
undefinedBasic conversion
基础转换
node .claude/skills/markdown-to-docx/scripts/convert.cjs
--file ./README.md
--file ./README.md
node .claude/skills/markdown-to-docx/scripts/convert.cjs
--file ./README.md
--file ./README.md
Custom output path
自定义输出路径
node .claude/skills/markdown-to-docx/scripts/convert.cjs
--file ./doc.md
--output ./output/doc.docx
--file ./doc.md
--output ./output/doc.docx
undefinednode .claude/skills/markdown-to-docx/scripts/convert.cjs
--file ./doc.md
--output ./output/doc.docx
--file ./doc.md
--output ./output/doc.docx
undefinedCLI Options
CLI选项
| Option | Required | Description |
|---|---|---|
| Yes | Input markdown file |
| No | Output DOCX path (default: input name + .docx) |
| 选项 | 是否必填 | 描述 |
|---|---|---|
| 是 | 输入的Markdown文件路径 |
| 否 | 输出DOCX文件路径(默认:输入文件名 + .docx) |
Output Format (JSON)
输出格式(JSON)
json
{
"success": true,
"input": "/path/to/input.md",
"output": "/path/to/output.docx",
"wordCount": 1523
}json
{
"success": true,
"input": "/path/to/input.md",
"output": "/path/to/output.docx",
"wordCount": 1523
}Supported Markdown Elements
支持的Markdown元素
- Headings (H1-H6)
- Paragraphs and emphasis (bold, italic)
- Ordered and unordered lists
- Code blocks
- Tables (GFM style)
- Links and images (local + URL)
- Blockquotes
- 标题(H1-H6)
- 段落和强调格式(粗体、斜体)
- 有序和无序列表
- 代码块
- 表格(GFM格式)
- 链接和图片(本地文件+URL)
- 块引用
Default Styling
默认样式
Uses markdown-docx default styling:
- Standard Word fonts
- Professional formatting
- Letter/A4 page size
使用markdown-docx的默认样式:
- 标准Word字体
- 专业排版格式
- 信纸/A4页面尺寸
Troubleshooting
故障排除
Dependencies not found: Run in skill directory
Image not loading: Ensure path is correct; URL images require network access (10s timeout)
npm install未找到依赖项: 在技能目录下运行
图片无法加载: 确保路径正确;URL图片需要网络访问(超时时间10秒)
npm installIMPORTANT Task Planning Notes
重要的任务规划说明
- Always plan and break many small todo tasks
- Always add a final review todo task to review the works done at the end to find any fix or enhancement needed
- 始终规划并拆分为多个小型待办任务
- 始终添加最终审核待办任务,在最后检查已完成的工作,找出需要修复或优化的地方