dsh-ai-book-shelf 2.5.2 → 2.6.4
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.md +29 -28
- package/client.js +616 -38
- package/index.js +422 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
# AI Book Shelf / AI 书架
|
|
2
2
|
|
|
3
3
|
[](https://github.com/0avatar0/dsh-ai-book-shelf)
|
|
4
|
-
[](https://github.com/0avatar0/dsh-ai-book-shelf/releases/tag/v2.6.4)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
|
|
7
7
|
A persistent DSH Web UI plugin that adds a full-page multi-format reader to the
|
|
@@ -11,27 +11,29 @@ comparison.
|
|
|
11
11
|
|
|
12
12
|
## Install
|
|
13
13
|
|
|
14
|
-
1. Download `dsh-ai-book-shelf-2.
|
|
15
|
-
[latest release](https://github.com/0avatar0/dsh-ai-book-shelf/releases/tag/v2.
|
|
16
|
-
or install from npm with `dsh-ai-book-shelf@2.
|
|
17
|
-
2. In DSH open **Plugins
|
|
14
|
+
1. Download `dsh-ai-book-shelf-2.6.4.tgz` from the
|
|
15
|
+
[latest release](https://github.com/0avatar0/dsh-ai-book-shelf/releases/tag/v2.6.4),
|
|
16
|
+
or install from npm with `dsh-ai-book-shelf@2.6.4`.
|
|
17
|
+
2. In DSH open **Plugins → Add plugin** and choose the downloaded tgz, or paste
|
|
18
18
|
the npm package spec.
|
|
19
|
-
3.
|
|
20
|
-
`dsh-ai-book-shelf` to **On** once; later updates keep it enabled.
|
|
21
|
-
4. Refresh the page and open **AI 涔︽灦 / AI Book Shelf** in the sidebar.
|
|
19
|
+
3. Reload the plugin and open **AI 书架 / AI Book Shelf** in the sidebar.
|
|
22
20
|
|
|
23
21
|
Chinese step-by-step guide: [INSTALL-zh.md](INSTALL-zh.md). Publishing and npm
|
|
24
22
|
instructions: [PUBLISHING.md](PUBLISHING.md).
|
|
25
23
|
|
|
26
24
|
## What it does
|
|
27
25
|
|
|
28
|
-
- **Shelf**
|
|
26
|
+
- **Shelf** — scans the archive shelf (the first registered workspace by
|
|
29
27
|
default, which is `D:\BookLib` on this deployment), plus any extra
|
|
30
28
|
`libraryDirs`, for supported book files.
|
|
31
|
-
- **Copies external books**
|
|
29
|
+
- **Copies external books** — a book opened or imported from outside the
|
|
32
30
|
archive shelf is copied into `archiveDir` first. Identical files are reused;
|
|
33
31
|
a name collision gets a ` (2)` suffix rather than overwriting anything.
|
|
34
|
-
- **
|
|
32
|
+
- **Dossier mode** — a separate dossier library with folders, multi-select
|
|
33
|
+
import (Ctrl/Cmd or Ctrl+A in the file picker), folder-scoped full-text
|
|
34
|
+
search, streamed AI summaries, and folder skills. A Markdown file named
|
|
35
|
+
Creating a folder adds an empty skill you can fill in; an imported `SKILL.md` can replace it, and AI summaries follow it.
|
|
36
|
+
- **Public-domain search** — the **Search books** tab queries Project Gutenberg
|
|
35
37
|
(Gutendex, with the Gutenberg website search as a fallback), a Chinese-only
|
|
36
38
|
Project Gutenberg catalog (`lang=zh`), Chinese Wikisource, Chinese Wikibooks,
|
|
37
39
|
and Standard Ebooks, then saves the chosen book (EPUB, or an HTML book for
|
|
@@ -50,24 +52,24 @@ instructions: [PUBLISHING.md](PUBLISHING.md).
|
|
|
50
52
|
can be added with the **+** button. The built-in Chinese catalogs cover
|
|
51
53
|
traditional Chinese Gutenberg titles and Wikisource; other catalogs are
|
|
52
54
|
mostly English.
|
|
53
|
-
- **Reader**
|
|
55
|
+
- **Reader** — parses the book into chapters, sanitizes HTML, and renders a
|
|
54
56
|
comfortable serif reading page with per-book progress. EPUB keeps its OPF
|
|
55
57
|
spine, headings, lists, tables, images and TOC; PDF/Text/Markdown/HTML/FB2/
|
|
56
58
|
DOCX are normalized into readable chapters.
|
|
57
|
-
- **Ask while selecting**
|
|
58
|
-
field to the left of
|
|
59
|
-
|
|
59
|
+
- **Ask while selecting** — the floating selection bar contains a question
|
|
60
|
+
field to the left of **解释**. Type a specific question and press Enter or
|
|
61
|
+
**解释**, or leave it blank for a direct explanation. The question is sent
|
|
60
62
|
together with the book, chapter, selection, and nearby context; the right
|
|
61
63
|
rail opens and streams the answer.
|
|
62
|
-
- **Follow-ups**
|
|
64
|
+
- **Follow-ups** — keep the whole Q&A thread in the panel and send the previous
|
|
63
65
|
turns to the model, so pronouns and earlier details stay in context. You can
|
|
64
66
|
stop the stream, copy the answer, or use quick asks (translate / example /
|
|
65
67
|
background).
|
|
66
|
-
- **Per-book annotations**
|
|
68
|
+
- **Per-book annotations** — every completed explanation and its follow-ups are
|
|
67
69
|
saved on the Host under the archive directory. Opening a book opens the right
|
|
68
70
|
annotation rail with that book's saved records; click a record to reopen its
|
|
69
71
|
Q&A thread and continue asking. Records survive browser reloads and restarts.
|
|
70
|
-
- **Paper mode**
|
|
72
|
+
- **Paper mode** — a separate paper library for English PDFs, with virtual
|
|
71
73
|
folders (create, drag papers in, rename), paragraph-level translation into a
|
|
72
74
|
JSON translation file, manual correction, retranslation, whole-paper
|
|
73
75
|
translation saved as a new Chinese paper, and a bilingual compare view.
|
|
@@ -89,17 +91,17 @@ instructions: [PUBLISHING.md](PUBLISHING.md).
|
|
|
89
91
|
translation box is resizable from its bottom edge, auto-fits its text on
|
|
90
92
|
first open, remembers its height/collapsed state, and can be collapsed
|
|
91
93
|
individually or all at once. Translation text supports AI explanation.
|
|
92
|
-
- **Zoom**
|
|
94
|
+
- **Zoom** — Ctrl/Cmd + mouse wheel changes the reading font size in both books
|
|
93
95
|
and papers; the paper compare view also zooms its source/translation text.
|
|
94
|
-
- **AI panels**
|
|
95
|
-
individually or with one
|
|
96
|
-
- **Find in book**
|
|
96
|
+
- **AI panels** — explanations are expanded by default and can be collapsed
|
|
97
|
+
individually or with one “Collapse all” action.
|
|
98
|
+
- **Find in book** — `Ctrl/Cmd+F` opens a full-book search across every
|
|
97
99
|
chapter, including PDF/HTML/DOCX books. Results show chapter, occurrence and
|
|
98
100
|
a text snippet; clicking one jumps to the chapter and highlights every match.
|
|
99
101
|
The reader toolbar shows the shortcut next to the search button. Simplified
|
|
100
|
-
Chinese queries also match traditional text (
|
|
101
|
-
- **Keyboard**
|
|
102
|
-
`Alt
|
|
102
|
+
Chinese queries also match traditional text (`陈文龙` finds `陳文龍`).
|
|
103
|
+
- **Keyboard** — `Ctrl/Cmd+Shift+E` explains the current selection,
|
|
104
|
+
`Alt+←` / `Alt+→` move between chapters, `Esc` closes search/rail.
|
|
103
105
|
|
|
104
106
|
## Supported formats
|
|
105
107
|
|
|
@@ -111,7 +113,7 @@ instructions: [PUBLISHING.md](PUBLISHING.md).
|
|
|
111
113
|
| `.md` / `.markdown` | Headings, paragraphs, lists, quotes, code blocks |
|
|
112
114
|
| `.html` / `.htm` / `.xhtml` | Sanitized HTML body |
|
|
113
115
|
| `.fb2` | FictionBook XML |
|
|
114
|
-
| `.docx` | Word paragraphs and Heading 1
|
|
116
|
+
| `.docx` | Word paragraphs and Heading 1–3 chapters |
|
|
115
117
|
| `.mobi` / `.azw3` / `.azw` | Convert to EPUB or PDF first (for example with Calibre) |
|
|
116
118
|
|
|
117
119
|
PDF extraction uses a vendored PDF.js runtime under `vendor/pdfjs/`; the package
|
|
@@ -176,4 +178,3 @@ explanations over SSE.
|
|
|
176
178
|
Plugin code is released under the [MIT License](LICENSE). The bundled PDF.js
|
|
177
179
|
runtime keeps its own Apache-2.0 license under `vendor/pdfjs/LICENSE`; bundled
|
|
178
180
|
fonts keep the licenses in `vendor/pdfjs/standard_fonts/`.
|
|
179
|
-
|