Add export to Word functionality with Markdown support
- Implemented a new plugin to export current conversation content from Markdown to Word (.docx) format.
- Added README_CN.md for Chinese documentation, detailing features, supported Markdown syntax, usage instructions, font configurations, and author information.
- Developed export_to_word.py to handle the conversion process, including title extraction, document creation, and file download triggering.
- Included support for various Markdown elements such as headings, lists, tables, and inline formatting.
- Ensured proper handling of Chinese and English text without encoding issues.
2025-12-30 13:29:44 +08:00
|
|
|
|
# 导出为 Word
|
|
|
|
|
|
|
2025-12-30 14:56:57 +08:00
|
|
|
|
将当前对话内容从 Markdown 转换并导出为 Word (.docx) 文件,支持**代码语法高亮**、**引用块样式**和更智能的文件命名。
|
Add export to Word functionality with Markdown support
- Implemented a new plugin to export current conversation content from Markdown to Word (.docx) format.
- Added README_CN.md for Chinese documentation, detailing features, supported Markdown syntax, usage instructions, font configurations, and author information.
- Developed export_to_word.py to handle the conversion process, including title extraction, document creation, and file download triggering.
- Included support for various Markdown elements such as headings, lists, tables, and inline formatting.
- Ensured proper handling of Chinese and English text without encoding issues.
2025-12-30 13:29:44 +08:00
|
|
|
|
|
|
|
|
|
|
## 功能特点
|
|
|
|
|
|
|
2025-12-30 14:56:57 +08:00
|
|
|
|
- **一键导出**:在聊天界面添加“导出为 Word”动作按钮。
|
Add export to Word functionality with Markdown support
- Implemented a new plugin to export current conversation content from Markdown to Word (.docx) format.
- Added README_CN.md for Chinese documentation, detailing features, supported Markdown syntax, usage instructions, font configurations, and author information.
- Developed export_to_word.py to handle the conversion process, including title extraction, document creation, and file download triggering.
- Included support for various Markdown elements such as headings, lists, tables, and inline formatting.
- Ensured proper handling of Chinese and English text without encoding issues.
2025-12-30 13:29:44 +08:00
|
|
|
|
- **Markdown 转换**:将 Markdown 语法转换为 Word 格式(标题、粗体、斜体、代码、表格、列表)。
|
2025-12-30 14:56:57 +08:00
|
|
|
|
- **代码语法高亮**:使用 Pygments 库为代码块添加语法高亮(支持 500+ 种语言)。
|
|
|
|
|
|
- **引用块支持**:Markdown 引用块会渲染为带左侧边框的灰色斜体样式。
|
Add export to Word functionality with Markdown support
- Implemented a new plugin to export current conversation content from Markdown to Word (.docx) format.
- Added README_CN.md for Chinese documentation, detailing features, supported Markdown syntax, usage instructions, font configurations, and author information.
- Developed export_to_word.py to handle the conversion process, including title extraction, document creation, and file download triggering.
- Included support for various Markdown elements such as headings, lists, tables, and inline formatting.
- Ensured proper handling of Chinese and English text without encoding issues.
2025-12-30 13:29:44 +08:00
|
|
|
|
- **多语言支持**:正确处理中文和英文文本,无乱码问题。
|
2025-12-30 16:09:39 +08:00
|
|
|
|
- **更智能的文件名**:可配置标题来源(对话标题、AI 生成或 Markdown 标题)。
|
|
|
|
|
|
|
|
|
|
|
|
## 配置 (Configuration)
|
|
|
|
|
|
|
|
|
|
|
|
您可以通过插件设置中的 **Valves** 按钮配置以下选项:
|
|
|
|
|
|
|
|
|
|
|
|
- **TITLE_SOURCE**:选择文档标题/文件名的生成方式。
|
|
|
|
|
|
- `chat_title`:使用对话标题(默认)。
|
|
|
|
|
|
- `ai_generated`:使用 AI 根据内容生成简短标题。
|
|
|
|
|
|
- `markdown_title`:从 Markdown 内容中提取第一个一级或二级标题。
|
Add export to Word functionality with Markdown support
- Implemented a new plugin to export current conversation content from Markdown to Word (.docx) format.
- Added README_CN.md for Chinese documentation, detailing features, supported Markdown syntax, usage instructions, font configurations, and author information.
- Developed export_to_word.py to handle the conversion process, including title extraction, document creation, and file download triggering.
- Included support for various Markdown elements such as headings, lists, tables, and inline formatting.
- Ensured proper handling of Chinese and English text without encoding issues.
2025-12-30 13:29:44 +08:00
|
|
|
|
|
|
|
|
|
|
## 支持的 Markdown 语法
|
|
|
|
|
|
|
2025-12-30 14:56:57 +08:00
|
|
|
|
| 语法 | Word 效果 |
|
|
|
|
|
|
| :-------------------------- | :----------------------- |
|
|
|
|
|
|
| `# 标题1` 到 `###### 标题6` | 标题级别 1-6 |
|
|
|
|
|
|
| `**粗体**` 或 `__粗体__` | 粗体文本 |
|
|
|
|
|
|
| `*斜体*` 或 `_斜体_` | 斜体文本 |
|
|
|
|
|
|
| `***粗斜体***` | 粗体 + 斜体 |
|
|
|
|
|
|
| `` `行内代码` `` | 等宽字体 + 灰色背景 |
|
|
|
|
|
|
| ` ``` 代码块 ``` ` | **语法高亮**的代码块 |
|
|
|
|
|
|
| `> 引用文本` | 带左侧边框的灰色斜体文本 |
|
|
|
|
|
|
| `[链接](url)` | 蓝色下划线链接文本 |
|
|
|
|
|
|
| `~~删除线~~` | 删除线文本 |
|
|
|
|
|
|
| `- 项目` 或 `* 项目` | 无序列表 |
|
|
|
|
|
|
| `1. 项目` | 有序列表 |
|
|
|
|
|
|
| Markdown 表格 | 带边框表格 |
|
|
|
|
|
|
| `---` 或 `***` | 水平分割线 |
|
Add export to Word functionality with Markdown support
- Implemented a new plugin to export current conversation content from Markdown to Word (.docx) format.
- Added README_CN.md for Chinese documentation, detailing features, supported Markdown syntax, usage instructions, font configurations, and author information.
- Developed export_to_word.py to handle the conversion process, including title extraction, document creation, and file download triggering.
- Included support for various Markdown elements such as headings, lists, tables, and inline formatting.
- Ensured proper handling of Chinese and English text without encoding issues.
2025-12-30 13:29:44 +08:00
|
|
|
|
|
|
|
|
|
|
## 使用方法
|
|
|
|
|
|
|
|
|
|
|
|
1. 安装插件。
|
|
|
|
|
|
2. 在任意对话中,点击"导出为 Word"按钮。
|
|
|
|
|
|
3. .docx 文件将自动下载到你的设备。
|
|
|
|
|
|
|
2025-12-30 14:45:51 +08:00
|
|
|
|
### 说明
|
|
|
|
|
|
|
|
|
|
|
|
- 标题检测仅考虑一级/二级标题(h1/h2)。
|
|
|
|
|
|
- 若请求体或 metadata 提供 `chat_id`,当正文缺少标题时会从数据库查询对话标题。
|
|
|
|
|
|
- 默认字体:英文 Times New Roman,中文宋体/黑体,代码 Consolas。
|
|
|
|
|
|
|
|
|
|
|
|
### 依赖
|
|
|
|
|
|
|
2025-12-30 14:56:57 +08:00
|
|
|
|
- `python-docx==1.1.2` - Word 文档生成
|
|
|
|
|
|
- `Pygments>=2.15.0` - 语法高亮(可选但建议安装)
|
|
|
|
|
|
|
|
|
|
|
|
两者已在插件文档字符串中声明,请确保环境已安装。
|
2025-12-30 14:45:51 +08:00
|
|
|
|
|
Add export to Word functionality with Markdown support
- Implemented a new plugin to export current conversation content from Markdown to Word (.docx) format.
- Added README_CN.md for Chinese documentation, detailing features, supported Markdown syntax, usage instructions, font configurations, and author information.
- Developed export_to_word.py to handle the conversion process, including title extraction, document creation, and file download triggering.
- Included support for various Markdown elements such as headings, lists, tables, and inline formatting.
- Ensured proper handling of Chinese and English text without encoding issues.
2025-12-30 13:29:44 +08:00
|
|
|
|
## 字体配置
|
|
|
|
|
|
|
|
|
|
|
|
- **英文文本**:Times New Roman
|
|
|
|
|
|
- **中文文本**:宋体(正文)、黑体(标题)
|
|
|
|
|
|
- **代码**:Consolas
|
|
|
|
|
|
|
|
|
|
|
|
## 作者
|
|
|
|
|
|
|
|
|
|
|
|
Fu-Jie
|
|
|
|
|
|
GitHub: [Fu-Jie/awesome-openwebui](https://github.com/Fu-Jie/awesome-openwebui)
|
|
|
|
|
|
|
|
|
|
|
|
## 许可证
|
|
|
|
|
|
|
|
|
|
|
|
MIT License
|