Convert Markdown files to professionally formatted Word documents (.docx).
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:
python scripts/md_to_word.py report.md report.docx
| Feature | Format |
|---|---|
| --------- | -------- |
| Headers (#, ##, ###) | 18pt/14pt/12pt bold, 微软雅黑 |
| Bold (text) | Bold formatting |
| Tables | Bordered tables with blue header background |
| Bullet lists (-, *) | Bullet points |
| Numbered lists (1., 2.) | Numbered items |
| Blockquotes (>) | Italic, indented text |
| Horizontal rules (---) | Paragraph spacing |
When user wants to convert a Markdown file:
Example prompt handling:
The conversion script is located at:
scripts/md_to_word.py
Install if needed:
pip install python-docx
共 2 个版本