Docx to markdown

From cas-bigdatalab/piflow · View interactive version

Docx to markdown is an AI agent skill from the GitHub repository cas-bigdatalab/piflow. 将DOCX文档转换为Markdown格式

How to use this skill

Skill file

docx_to_markdown 技能

功能说明

该技能将DOCX文档转换为Markdown格式,支持提取文本内容、标题样式、表格等元素,适用于文档格式转换和内容迁移场景。

核心功能

使用方法

python scripts/run_docx_to_markdown.py --input_path <输入DOCX> --output_path <输出MD>

参数说明

| 参数 | 类型 | 必填 | 默认值 | 说明 |

| :--- | :--- | :--- | :--- | :--- |

| input_path | string | 是 | - | 输入DOCX文件路径 |

| output_path | string | 是 | - | 输出Markdown文件路径 |

示例

python scripts/run_docx_to_markdown.py --input_path document.docx --output_path document.md

支持的样式转换

| DOCX样式 | Markdown格式 |

| :--- | :--- |

| Heading1 | # 标题 |

| Heading2 | ## 标题 |

| Heading3 | ### 标题 |

| Heading4 | #### 标题 |

| Heading5 | ##### 标题 |

| Heading6 | ###### 标题 |

| 粗体 | **文本** |

| 斜体 | _文本_ |

| 粗斜体 | **_文本_** |

| ListParagraph | - 列表项 |

| Quote | > 引用 |

| 表格 | Markdown表格格式 |

输出示例

# 文档标题

## 章节标题

这是一段普通文本,包含**粗体**和_斜体_样式。

- 列表项1
- 列表项2

> 这是一段引用文本

| 列1 | 列2 | 列3 |
| --- | --- | --- |
| 数据1 | 数据2 | 数据3 |

注意事项

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.