将 Markdown 文件转换为格式化的 Word 文档(.docx)。当用户请求将 Markdown 转换为、导出或保存为 Word/DOCX 格式时触发。
Convert Markdown files to professionally formatted Word documents (.docx).
bash
python scripts/md_to_word.py <input.md> [output.docx]
Parameters:
input.md - Path to the source Markdown file (required)output.docx - Path for the output Word file (optional, defaults to input name with .docx extension)Example:
bash
python scripts/md_to_word.py report.md report.docx
FeatureFormatHeaders (#, ##, ###)18pt/14pt/12pt bold, 微软雅黑Bold ( text)Bold formattingTablesBordered tables with blue header backgroundCode blocks (```)Monospace font (Consolas), gray background, indentedInline code ( code)Monospace font (Consolas) within paragraphBullet lists (-, *)Bullet pointsNumbered lists (1., 2.)Numbered itemsBlockquotes (>)Italic, indented textHorizontal rules (---)Paragraph spacing
When user wants to convert a Markdown file:
Example prompt handling:
The conversion script is located at:
text
scripts/md_to_word.py
Install if needed:
bash
pip install python-docx