paperdepot 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +14 -5
- package/README.md +35 -22
- package/lib/client.js +675 -179
- package/lib/impl.js +136 -11
- package/package.json +1 -1
- package/pipeline/config/tagmap_/344/273/252/345/231/250.json +554 -554
- package/pipeline/config/tagmap_/345/272/224/347/224/250.json +626 -626
- package/pipeline/config/tagmap_/346/226/271/346/263/225.json +890 -890
- package/pipeline/config/tagmap_/351/242/206/345/237/237.json +221 -221
- package/pipeline/tools/_paths.py +49 -8
- package/pipeline/tools/mineru_parse.py +537 -462
package/README.en.md
CHANGED
|
@@ -12,9 +12,12 @@ It handles ingestion and organization; Obsidian only stores and reads.
|
|
|
12
12
|
|
|
13
13
|
- Import PDFs by drag-and-drop, file picker, or local path (deduplicated by fingerprint).
|
|
14
14
|
- Parse with MinerU, resolve metadata via Crossref / arXiv.
|
|
15
|
-
- Generate a structured Chinese summary and four controlled tag categories with an LLM
|
|
15
|
+
- Generate a structured Chinese summary and four controlled tag categories with an LLM;
|
|
16
|
+
re-run per paper, or **backfill in batch** (queued, stoppable, and resumable — finished
|
|
17
|
+
entries are skipped on the next run).
|
|
16
18
|
- Write Obsidian-native frontmatter, `index.md`, `full.md`, `paper.pdf`, and `images/`.
|
|
17
|
-
- Browse overview / papers / concepts in the DSH sidebar panel
|
|
19
|
+
- Browse overview / papers / concepts in the DSH sidebar panel, with a typeset reader
|
|
20
|
+
(headings, lists, tables, inline math and wikilinks instead of raw Markdown).
|
|
18
21
|
- Generate taxonomy pages and paper navigation blocks; export a read-only mobile edition.
|
|
19
22
|
|
|
20
23
|
## Requirements
|
|
@@ -28,11 +31,17 @@ It handles ingestion and organization; Obsidian only stores and reads.
|
|
|
28
31
|
## Quick start
|
|
29
32
|
|
|
30
33
|
1. Install DSH Desktop and create/open an Obsidian vault (keep the path short).
|
|
31
|
-
2. Install the plugin
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
2. Install the plugin — published on npm as `paperdepot`:
|
|
35
|
+
```powershell
|
|
36
|
+
cd "$env:USERPROFILE\.dsh\profiles\desktop"
|
|
37
|
+
pnpm add paperdepot
|
|
38
|
+
```
|
|
39
|
+
or pick the GitHub Release tarball / source link. Prefer not to run commands yourself?
|
|
40
|
+
Hand the [one-prompt installer](https://github.com/HUAWEIYYLS/paperdepot/blob/main/docs/install-prompt.md) to DSH.
|
|
34
41
|
3. Get a MinerU token at <https://mineru.net>.
|
|
35
42
|
4. Open the **论文库** panel in DSH, paste the token, verify it, and choose your vault.
|
|
43
|
+
The token is stored in `~/.dsh/paperdepot/config/` and passed to the Python pipeline
|
|
44
|
+
(`MINERU_API_KEY` / `PAPERDEPOT_*`), so the panel and the pipeline read the same file.
|
|
36
45
|
5. Drop a PDF into the panel and open the generated entry in Obsidian.
|
|
37
46
|
|
|
38
47
|
Full instructions (in Chinese): [README.md](README.md).
|
package/README.md
CHANGED
|
@@ -20,9 +20,12 @@ PDF
|
|
|
20
20
|
|
|
21
21
|
- **拖 PDF 入库**:拖拽、选择文件或粘贴本地路径;同一 PDF 按指纹自动跳过。
|
|
22
22
|
- **自动元数据**:优先读 PDF 首页 DOI / arXiv 号,再走 Crossref / arXiv 精确查询。
|
|
23
|
-
- **结构化摘要与标签**:LLM 生成中文摘要和四类受控标签(领域 / 方法 / 应用 /
|
|
23
|
+
- **结构化摘要与标签**:LLM 生成中文摘要和四类受控标签(领域 / 方法 / 应用 / 仪器),
|
|
24
|
+
支持单篇补跑与「批量补摘要」(排队跑完待生成条目,可随时停止,再点会跳过已完成的继续)。
|
|
24
25
|
- **Obsidian 原生体验**:元数据写进 frontmatter,Properties / Dataview / 标签面板 / 双链 / Graph 直接可用。
|
|
25
26
|
- **总览 / 论文 / 概念**:面板内看统计、搜索条目、浏览概念页与相关论文。
|
|
27
|
+
- **阅读版式**:论文与概念详情按摘要排版(标题 / 列表 / 表格 / 行内公式 / 双链),
|
|
28
|
+
不再显示原始 Markdown;概念页带引用数、别名与相关论文列表。
|
|
26
29
|
- **分类页与导航块**:自动生成 `3-Taxonomy/` 分类页和论文页导航块,幂等可重建。
|
|
27
30
|
- **手机只读导出**:整库导出 EPUB / DOCX / PDF,放到同步盘用手机阅读器看。
|
|
28
31
|
- **跨平台尽力而为**:Windows 一等支持;macOS / Linux 实验性(欢迎反馈)。
|
|
@@ -30,7 +33,8 @@ PDF
|
|
|
30
33
|
## 5 分钟快速开始
|
|
31
34
|
|
|
32
35
|
1. **准备 DSH + Obsidian**:安装 DSH 桌面版,并在 Obsidian 里新建或打开一个库(路径尽量短)。
|
|
33
|
-
2.
|
|
36
|
+
2. **安装插件**:任选下面一种方式(已发布到 npm,推荐 `pnpm add paperdepot`;也可用 tarball 或
|
|
37
|
+
DSH 的「添加插件」对话框);
|
|
34
38
|
不想手动敲命令,就把[一键安装提示词](https://github.com/HUAWEIYYLS/paperdepot/blob/main/docs/install-prompt.md)整段发给 DSH。
|
|
35
39
|
3. **申请 MinerU Token**:打开 <https://mineru.net> 注册 → 控制台 → API 管理 → 创建 Token。
|
|
36
40
|
4. **首次配置**:打开左侧栏「论文库」→ 配置卡里粘贴 Token → 保存并验证 → 选择 Obsidian 库路径。
|
|
@@ -44,17 +48,15 @@ PDF
|
|
|
44
48
|
> 完全不想手动操作?把[一键安装提示词](https://github.com/HUAWEIYYLS/paperdepot/blob/main/docs/install-prompt.md)
|
|
45
49
|
> 复制给 DSH,它会自己定位 profile、装包、写 `cordis.patch.yml`、装 Python 依赖并做安装后验证。
|
|
46
50
|
|
|
47
|
-
### 方式 A:
|
|
48
|
-
|
|
49
|
-
DSH → 设置 → 插件 → 插件市场 → 搜索「论文库」→ 安装 → 刷新页面。
|
|
50
|
-
|
|
51
|
-
### 方式 B:npm 安装(进阶)
|
|
51
|
+
### 方式 A:npm 安装(推荐)
|
|
52
52
|
|
|
53
53
|
```powershell
|
|
54
54
|
cd "$env:USERPROFILE\.dsh\profiles\desktop"
|
|
55
55
|
pnpm add paperdepot
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
也可以在 DSH「插件 → 添加插件」对话框里直接填包名 `paperdepot`,它会自动装进 profile。
|
|
59
|
+
|
|
58
60
|
然后在 profile 的 `cordis.patch.yml` 末尾加上:
|
|
59
61
|
|
|
60
62
|
```yaml
|
|
@@ -67,15 +69,27 @@ pnpm add paperdepot
|
|
|
67
69
|
|
|
68
70
|
刷新 DSH(必要时重启)。
|
|
69
71
|
|
|
72
|
+
### 方式 B:DSH「发现」页 + 自建索引源
|
|
73
|
+
|
|
74
|
+
DSH 目前**没有官方插件市场**:开箱的「发现」页默认没有任何索引源。本仓库自带一个自建索引
|
|
75
|
+
(`market/index.json`,npm 源),启用后可在「发现」页搜索并一键安装:
|
|
76
|
+
|
|
77
|
+
1. DSH 侧栏 → **插件** → **实验性插件**旁的**更多** → 启用**自定义插件市场**;
|
|
78
|
+
2. 插件页 → **发现** → **添加索引源** → 粘贴:
|
|
79
|
+
`https://raw.githubusercontent.com/HUAWEIYYLS/paperdepot/main/market/index.json`
|
|
80
|
+
3. 搜索「论文库」或 `paperdepot` → 安装。
|
|
81
|
+
|
|
70
82
|
### 方式 C:GitHub Release tarball(国内网络更稳)
|
|
71
83
|
|
|
72
|
-
从 Releases 下载 `paperdepot-0.1.
|
|
84
|
+
从 Releases 下载 `paperdepot-<版本>.tgz`(如 `paperdepot-0.1.2.tgz`),然后:
|
|
73
85
|
|
|
74
86
|
```powershell
|
|
75
87
|
cd "$env:USERPROFILE\.dsh\profiles\desktop"
|
|
76
|
-
pnpm add "D:\downloads\paperdepot-0.1.
|
|
88
|
+
pnpm add "D:\downloads\paperdepot-0.1.2.tgz"
|
|
77
89
|
```
|
|
78
90
|
|
|
91
|
+
也可以把 tgz 的绝对路径填进 DSH「添加插件」对话框的输入框。
|
|
92
|
+
|
|
79
93
|
同样在 `cordis.patch.yml` 里加 `id: paperdepot / name: paperdepot` 的 insert。
|
|
80
94
|
|
|
81
95
|
### 方式 D:源码 link(开发 / 调试)
|
|
@@ -91,25 +105,14 @@ pnpm add "link:D:\path\to\paperdepot"
|
|
|
91
105
|
> **重要**:profile 里的 `name:` 必须是包名 `paperdepot`,不能写 `paperdepot/host`。
|
|
92
106
|
> 写子路径会出现「host 正常、左侧栏没有论文库」。
|
|
93
107
|
|
|
94
|
-
### 方式 E:DSH「发现」页的自定义索引源(可选)
|
|
95
|
-
|
|
96
|
-
DSH 目前**没有官方插件市场**:开箱的「发现」页默认没有任何索引源,直接搜不到任何第三方插件。
|
|
97
|
-
本仓库自带一个自建索引(`market/index.json`),加上它就能在「发现」页搜到并一键安装:
|
|
98
|
-
|
|
99
|
-
1. DSH 侧栏 → **插件** → **实验性插件**旁的**更多** → 启用**自定义插件市场**;
|
|
100
|
-
2. 插件页 → **发现** → **添加索引源** → 粘贴:
|
|
101
|
-
`https://raw.githubusercontent.com/HUAWEIYYLS/paperdepot/main/market/index.json`
|
|
102
|
-
3. 在搜索框搜「论文库」或 `paperdepot` → 安装(索引里只有本插件,来源是 GitHub 提交)。
|
|
103
|
-
|
|
104
|
-
> 这个索引只收录 PaperDepot 自己,属于自建源;别人要搜到,得先添加这个 URL。
|
|
105
|
-
> 索引格式与校验器是 DSH 官方的 format 1(`@deepseek-ai/dsh-plugin-market-index`)。
|
|
106
|
-
|
|
107
108
|
## 首次配置
|
|
108
109
|
|
|
109
110
|
打开左侧栏「论文库」面板,第一次会看到配置卡:
|
|
110
111
|
|
|
111
112
|
1. **MinerU Token**:粘贴 → 「保存并验证」。插件会真的调一次 MinerU 接口验 key。
|
|
112
113
|
Token 只写到本机配置文件,不会上传;也可以用环境变量 `MINERU_API_KEY`。
|
|
114
|
+
安装态文件在 `~/.dsh/paperdepot/config/secrets.local.json`,插件启动 Python 流水线时
|
|
115
|
+
会把同一份 key 与配置目录传进去(面板会显示「Python 流水线能读到同一个 key」)。
|
|
113
116
|
2. **Obsidian 库路径**:选择一个已存在的文件夹;空库也可以,第一次导入会创建 `1-Papers/`。
|
|
114
117
|
3. **Python 依赖**:需要 Python 3.10+ 和以下依赖:
|
|
115
118
|
|
|
@@ -135,6 +138,7 @@ DSH 目前**没有官方插件市场**:开箱的「发现」页默认没有任
|
|
|
135
138
|
| 看统计 | 面板「总览」页 |
|
|
136
139
|
| 搜索条目 | 面板「论文」页;点开可看 `index.md` 原文、在 Obsidian 打开 |
|
|
137
140
|
| 补摘要 | 论文页里对「待生成」条目点「生成摘要与标签」 |
|
|
141
|
+
| 批量补摘要 | 顶栏「批量补摘要(N)」:把待生成条目排队跑完,底部显示进度、可「停止」;中断后再点会跳过已完成的继续(断点续跑) |
|
|
138
142
|
| 看概念 | 面板「概念」页;概念页是跨论文综合,由你或 LLM 维护 |
|
|
139
143
|
| 看关系图 | 在 Obsidian 里用原生 Graph / Local Graph;论文页导航块提供概念/分类边 |
|
|
140
144
|
| 重建分类页/导航 | 面板「重建导航」(幂等,可反复跑) |
|
|
@@ -169,6 +173,8 @@ DSH 目前**没有官方插件市场**:开箱的「发现」页默认没有任
|
|
|
169
173
|
|
|
170
174
|
- `MINERU_API_KEY`:MinerU Token(优先于本地文件)。
|
|
171
175
|
- `PAPERDEPOT_HOME`:安装态数据根。
|
|
176
|
+
- `PAPERDEPOT_CONFIG_DIR`:配置目录覆盖(默认 `<PAPERDEPOT_HOME>/config`)。安装态由插件在启动 Python 时自动注入;
|
|
177
|
+
手动跑 `pipeline/tools/` 下的脚本时才需要自己设置。
|
|
172
178
|
- `PAPERDEPOT_VAULT`:默认库路径。
|
|
173
179
|
- `PAPERDEPOT_PYTHON`:Python 解释器。
|
|
174
180
|
- `ZOTERO_STORAGE`:Zotero storage 目录(仅 `--from-storage` 用)。
|
|
@@ -185,8 +191,15 @@ DSH 目前**没有官方插件市场**:开箱的「发现」页默认没有任
|
|
|
185
191
|
- 401/403:Token 无效或过期,重新申请并保存。
|
|
186
192
|
- 429:免费额度或频率限制,等一会儿或换自己的额度。
|
|
187
193
|
|
|
194
|
+
**面板显示「MinerU 已配置」,导入却报「未配置 MinerU key」**
|
|
195
|
+
- 0.1.2 及更早的安装态已知问题:面板(Node)把 key 写到 `~/.dsh/paperdepot/config/`,
|
|
196
|
+
Python 流水线却去插件包的 `pipeline/config/` 找,两边路径不一致。
|
|
197
|
+
- 升级到含本修复的版本即可;临时绕过:给 DSH 进程设置环境变量 `MINERU_API_KEY` 后重启。
|
|
198
|
+
- 新版本配置卡会显示「Python 流水线能读到同一个 key」;如果显示读不到,按上面两条处理。
|
|
199
|
+
|
|
188
200
|
**导入成功但没有摘要**
|
|
189
201
|
- 没有配置可用模型,或模型调用失败。入库不受影响;之后在论文页补摘要即可。
|
|
202
|
+
- 开源前的旧条目不会自动补:顶栏「批量补摘要(N)」可一次排队跑完,跑长任务时可随时停止,下次再点跳过已完成的。
|
|
190
203
|
- 检查 profile 里的 `provider` / `model` 是否是宿主真实存在的路由。
|
|
191
204
|
|
|
192
205
|
**图片打不开 / 路径太长**
|