markdown-to-docx

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

markdown-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 install
Dependencies:
markdown-docx
(uses docx internally)
bash
cd .claude/skills/markdown-to-docx
npm install
依赖:
markdown-docx
(内部使用docx库)

Quick Start

快速开始

bash
undefined
bash
undefined

Basic conversion

基础转换

node .claude/skills/markdown-to-docx/scripts/convert.cjs
--file ./README.md
node .claude/skills/markdown-to-docx/scripts/convert.cjs
--file ./README.md

Custom output path

自定义输出路径

node .claude/skills/markdown-to-docx/scripts/convert.cjs
--file ./doc.md
--output ./output/doc.docx
undefined
node .claude/skills/markdown-to-docx/scripts/convert.cjs
--file ./doc.md
--output ./output/doc.docx
undefined

CLI Options

CLI选项

OptionRequiredDescription
--file <path>
YesInput markdown file
--output <path>
NoOutput DOCX path (default: input name + .docx)
选项是否必填描述
--file <path>
输入的Markdown文件路径
--output <path>
输出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
npm install
in skill directory Image not loading: Ensure path is correct; URL images require network access (10s timeout)
未找到依赖项: 在技能目录下运行
npm install
图片无法加载: 确保路径正确;URL图片需要网络访问(超时时间10秒)

IMPORTANT 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
  • 始终规划并拆分为多个小型待办任务
  • 始终添加最终审核待办任务,在最后检查已完成的工作,找出需要修复或优化的地方