refactor: 移除 doc 和 ppt reader 支持
移除对旧版 .doc 和 .ppt 格式的支持,以简化项目架构和减少维护负担。 变更内容: - 删除 scripts/readers/doc/ 目录 - 删除 scripts/readers/ppt/ 目录 - 从 readers/__init__.py 中移除 DocReader 和 PptReader - 从 utils/file_detection.py 中移除 is_valid_doc 和 is_valid_ppt - 从 config.py 中移除 doc 和 ppt 依赖配置 - 从 advice_generator.py 中移除相关映射 - 更新 CLI 帮助文档 - 更新 README.md 文档 - 删除相关测试用例 - 删除相关规范文档
This commit is contained in:
31
README.md
31
README.md
@@ -1,6 +1,6 @@
|
||||
# lyxy-document
|
||||
|
||||
统一文档解析工具 - 将 DOC、DOCX、XLS、XLSX、PPT、PPTX、PDF、HTML/URL 转换为 Markdown
|
||||
统一文档解析工具 - 将 DOCX、XLS、XLSX、PPTX、PDF、HTML/URL 转换为 Markdown
|
||||
|
||||
## 项目概述
|
||||
|
||||
@@ -25,11 +25,9 @@ scripts/
|
||||
│ └── exceptions.py # 异常定义
|
||||
├── readers/ # 格式阅读器
|
||||
│ ├── base.py # Reader 基类
|
||||
│ ├── doc/ # DOC 解析器(旧格式)
|
||||
│ ├── docx/ # DOCX 解析器
|
||||
│ ├── xls/ # XLS 解析器(旧格式)
|
||||
│ ├── xlsx/ # XLSX 解析器
|
||||
│ ├── ppt/ # PPT 解析器(旧格式)
|
||||
│ ├── pptx/ # PPTX 解析器
|
||||
│ ├── pdf/ # PDF 解析器
|
||||
│ └── html/ # HTML/URL 解析器
|
||||
@@ -40,9 +38,7 @@ scripts/
|
||||
tests/ # 测试套件
|
||||
├── test_readers/ # Reader 测试
|
||||
│ └── fixtures/ # 静态测试文件(Git LFS 管理)
|
||||
│ ├── doc/ # DOC 旧格式测试文件
|
||||
│ ├── xls/ # XLS 旧格式测试文件
|
||||
│ └── ppt/ # PPT 旧格式测试文件
|
||||
│ └── xls/ # XLS 旧格式测试文件
|
||||
openspec/ # OpenSpec 规范文档
|
||||
README.md # 本文档(开发者文档)
|
||||
SKILL.md # AI Skill 文档
|
||||
@@ -52,7 +48,7 @@ SKILL.md # AI Skill 文档
|
||||
|
||||
### 静态测试文件目录
|
||||
|
||||
`tests/test_readers/fixtures/` 目录用于存放**预先准备的静态测试文件**,特别是难以通过 Python 自动化创建的旧格式文件(.doc/.xls/.ppt)。
|
||||
`tests/test_readers/fixtures/` 目录用于存放**预先准备的静态测试文件**,特别是难以通过 Python 自动化创建的旧格式文件(.xls)。
|
||||
|
||||
### 目录使用规则
|
||||
|
||||
@@ -64,8 +60,8 @@ SKILL.md # AI Skill 文档
|
||||
|
||||
`tests/test_readers/conftest.py` 提供以下静态文件 fixtures:
|
||||
|
||||
- 目录路径:`doc_fixture_path`、`xls_fixture_path`、`ppt_fixture_path`
|
||||
- 单个文件:`simple_doc_path`、`with_headings_doc_path`、`with_table_doc_path` 等
|
||||
- 目录路径:`xls_fixture_path`
|
||||
- 单个文件:`simple_xls_path` 等
|
||||
|
||||
文件不存在时会自动 `pytest.skip()`,保证 CI 稳定性。
|
||||
|
||||
@@ -224,15 +220,6 @@ uv run \
|
||||
pytest tests/test_readers/test_html/
|
||||
```
|
||||
|
||||
#### 测试 DOC reader(旧格式,使用静态文件)
|
||||
```bash
|
||||
uv run \
|
||||
--with pytest \
|
||||
--with "markitdown[docx]" \
|
||||
--with pypandoc-binary \
|
||||
pytest tests/test_readers/test_doc/
|
||||
```
|
||||
|
||||
#### 测试 XLS reader(旧格式,使用静态文件)
|
||||
```bash
|
||||
uv run \
|
||||
@@ -245,14 +232,6 @@ uv run \
|
||||
pytest tests/test_readers/test_xls/
|
||||
```
|
||||
|
||||
#### 测试 PPT reader(旧格式,使用静态文件)
|
||||
```bash
|
||||
uv run \
|
||||
--with pytest \
|
||||
--with "markitdown[pptx]" \
|
||||
pytest tests/test_readers/test_ppt/
|
||||
```
|
||||
|
||||
#### 运行特定测试文件或方法
|
||||
```bash
|
||||
# 运行特定测试文件(CLI 测试无需额外依赖)
|
||||
|
||||
Reference in New Issue
Block a user