feat: 新增 .doc 格式支持,借助 LibreOffice soffice
- 提取 LibreOffice 解析逻辑为公共工具函数 _utils.parse_via_libreoffice() - 新增 DocReader 独立 Reader,支持 .doc 格式 - 新增 is_valid_doc() 文件验证函数(复用 OLE2 检测) - 新增 doc 格式依赖配置(独立配置) - 新增完整的测试套件,使用静态测试文件 - 更新 README.md 和 SKILL.md,添加 .doc 格式支持说明 - 新增 openspec/specs/doc-reader/spec.md 规范文档 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
7
SKILL.md
7
SKILL.md
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: lyxy-document-reader
|
||||
description: 统一文档解析工具 - 将 DOCX、XLS、XLSX、PPTX、PDF、HTML/URL 转换为 Markdown。支持全文输出、字数统计、行数统计、标题提取、章节提取、正则搜索。当用户要求"读取/解析/打开文档"、上传 .docx/.xls/.xlsx/.pptx/.pdf/.html 文件、或提供 URL 时使用。
|
||||
description: 统一文档解析工具 - 将 DOC、DOCX、XLS、XLSX、PPTX、PDF、HTML/URL 转换为 Markdown。支持全文输出、字数统计、行数统计、标题提取、章节提取、正则搜索。当用户要求"读取/解析/打开文档"、上传 .doc/.docx/.xls/.xlsx/.pptx/.pdf/.html 文件、或提供 URL 时使用。
|
||||
license: MIT
|
||||
compatibility: Requires Python 3.11+。优先使用 lyxy-runner-python skill,次选 uv run --with,降级到主机 Python。
|
||||
---
|
||||
@@ -26,6 +26,7 @@ python scripts/lyxy_document_reader.py <文件路径或URL>
|
||||
## Purpose
|
||||
|
||||
**支持格式**
|
||||
- DOC(Word 旧格式)
|
||||
- DOCX(Word 文档)
|
||||
- XLS(Excel 旧格式)
|
||||
- XLSX(Excel 表格)
|
||||
@@ -44,8 +45,8 @@ python scripts/lyxy_document_reader.py <文件路径或URL>
|
||||
|
||||
### 触发词
|
||||
- 中文:"读取/解析/打开 文档/Word/Excel/PPT/PDF/网页"
|
||||
- 英文:"read/parse/extract document/docx/xls/xlsx/pptx/pdf/html"
|
||||
- 文件扩展名:`.docx`、`.xls`、`.xlsx`、`.pptx`、`.pdf`、`.html`、`.htm`
|
||||
- 英文:"read/parse/extract document/doc/docx/xls/xlsx/pptx/pdf/html"
|
||||
- 文件扩展名:`.doc`、`.docx`、`.xls`、`.xlsx`、`.pptx`、`.pdf`、`.html`、`.htm`
|
||||
- URL:`http://`、`https://`
|
||||
|
||||
## Quick Reference
|
||||
|
||||
Reference in New Issue
Block a user