agent-reader 1.0.0
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 +213 -0
- package/bin/agent-reader.js +83 -0
- package/package.json +52 -0
- package/src/cli/commands.js +602 -0
- package/src/core/assets.js +429 -0
- package/src/core/exporter.js +710 -0
- package/src/core/opener.js +329 -0
- package/src/core/renderer.js +235 -0
- package/src/core/sanitizer.js +79 -0
- package/src/core/slideshow.js +383 -0
- package/src/core/templates/docx-table.lua +4 -0
- package/src/core/templates/reference.docx +0 -0
- package/src/core/themes/dark.css +256 -0
- package/src/core/themes/light.css +312 -0
- package/src/core/themes/print.css +54 -0
- package/src/mcp/server.js +381 -0
- package/src/templates/document.html +145 -0
- package/src/templates/slideshow.html +42 -0
- package/src/utils/logger.js +64 -0
- package/src/utils/naturalSort.js +12 -0
- package/src/utils/output.js +85 -0
- package/src/utils/preferences.js +89 -0
- package/src/utils/server.js +295 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/* ================= 全局排版基调 (Notion/Apple 极简风) ================= */
|
|
2
|
+
:root {
|
|
3
|
+
--bg-color: #FFFFFF;
|
|
4
|
+
--sidebar-bg: #F9F9F8;
|
|
5
|
+
--text-main: #37352F;
|
|
6
|
+
--text-muted: #787774;
|
|
7
|
+
--border-color: #EFEFED;
|
|
8
|
+
--accent-color: #8B5CF6;
|
|
9
|
+
--hover-bg: #F1F1EF;
|
|
10
|
+
--highlight-bg: #FDE047;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
body {
|
|
14
|
+
margin: 0;
|
|
15
|
+
padding: 0;
|
|
16
|
+
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
|
|
17
|
+
color: var(--text-main);
|
|
18
|
+
background-color: var(--bg-color);
|
|
19
|
+
display: flex;
|
|
20
|
+
height: 100vh;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
-webkit-font-smoothing: antialiased;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#sidebar {
|
|
26
|
+
width: 280px;
|
|
27
|
+
background-color: var(--sidebar-bg);
|
|
28
|
+
border-right: 1px solid var(--border-color);
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
transition: margin-left 0.3s ease;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
#sidebar.hidden {
|
|
35
|
+
margin-left: -280px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#main-content {
|
|
39
|
+
flex: 1;
|
|
40
|
+
overflow-y: auto;
|
|
41
|
+
scroll-behavior: smooth;
|
|
42
|
+
position: relative;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.doc-toolbar {
|
|
46
|
+
position: sticky;
|
|
47
|
+
top: 0;
|
|
48
|
+
background: rgba(255, 255, 255, 0.9);
|
|
49
|
+
backdrop-filter: blur(12px);
|
|
50
|
+
-webkit-backdrop-filter: blur(12px);
|
|
51
|
+
padding: 16px 40px;
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-content: space-between;
|
|
54
|
+
align-items: center;
|
|
55
|
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
|
|
56
|
+
z-index: 100;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.toolbar-right {
|
|
60
|
+
display: flex;
|
|
61
|
+
gap: 12px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.action-btn {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: 6px;
|
|
68
|
+
padding: 8px 16px;
|
|
69
|
+
border-radius: 8px;
|
|
70
|
+
border: 1px solid var(--border-color);
|
|
71
|
+
background: var(--bg-color);
|
|
72
|
+
color: var(--text-main);
|
|
73
|
+
font-size: 14px;
|
|
74
|
+
font-weight: 500;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
transition: all 0.2s;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.action-btn:hover {
|
|
80
|
+
background: var(--hover-bg);
|
|
81
|
+
transform: translateY(-1px);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.action-btn.primary {
|
|
85
|
+
color: var(--accent-color);
|
|
86
|
+
border-color: rgba(139, 92, 246, 0.3);
|
|
87
|
+
background: rgba(139, 92, 246, 0.05);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.action-btn.primary:hover {
|
|
91
|
+
background: rgba(139, 92, 246, 0.1);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.sidebar-header {
|
|
95
|
+
padding: 24px 20px 12px;
|
|
96
|
+
font-weight: 600;
|
|
97
|
+
font-size: 14px;
|
|
98
|
+
color: var(--text-muted);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.logo {
|
|
102
|
+
font-weight: 600;
|
|
103
|
+
font-size: 14px;
|
|
104
|
+
color: var(--text-muted);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
#toc-container {
|
|
108
|
+
padding: 0 12px 24px;
|
|
109
|
+
overflow-y: auto;
|
|
110
|
+
flex: 1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
#toc-container ul {
|
|
114
|
+
list-style: none;
|
|
115
|
+
padding-left: 0;
|
|
116
|
+
margin: 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
#toc-container li {
|
|
120
|
+
margin: 4px 0;
|
|
121
|
+
position: relative;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
#toc-container a {
|
|
125
|
+
display: block;
|
|
126
|
+
padding: 6px 12px;
|
|
127
|
+
color: var(--text-muted);
|
|
128
|
+
text-decoration: none;
|
|
129
|
+
font-size: 14px;
|
|
130
|
+
border-radius: 6px;
|
|
131
|
+
line-height: 1.5;
|
|
132
|
+
transition: color 0.2s, background 0.2s;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
#toc-container a:hover {
|
|
136
|
+
background-color: var(--hover-bg);
|
|
137
|
+
color: var(--text-main);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
#toc-container ul ul {
|
|
141
|
+
padding-left: 16px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.toc-toggle-arrow {
|
|
145
|
+
position: absolute;
|
|
146
|
+
left: -10px;
|
|
147
|
+
top: 8px;
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
font-size: 10px;
|
|
150
|
+
color: var(--text-muted);
|
|
151
|
+
user-select: none;
|
|
152
|
+
padding: 2px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
#toc-container li.has-children.collapsed > ul {
|
|
156
|
+
display: none;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.markdown-body {
|
|
160
|
+
max-width: 700px;
|
|
161
|
+
margin: 0 auto;
|
|
162
|
+
padding: 40px 0 100px;
|
|
163
|
+
line-height: 1.8;
|
|
164
|
+
font-size: 16px;
|
|
165
|
+
color: var(--text-main);
|
|
166
|
+
text-align: justify;
|
|
167
|
+
word-break: break-word;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.markdown-body h1 {
|
|
171
|
+
font-size: 2.4em;
|
|
172
|
+
font-weight: 800;
|
|
173
|
+
margin-bottom: 1.5em;
|
|
174
|
+
letter-spacing: -0.03em;
|
|
175
|
+
color: #111;
|
|
176
|
+
line-height: 1.3;
|
|
177
|
+
text-align: left;
|
|
178
|
+
word-break: keep-all;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.markdown-body h2 {
|
|
182
|
+
font-size: 1.6em;
|
|
183
|
+
font-weight: 700;
|
|
184
|
+
margin-top: 2.2em;
|
|
185
|
+
margin-bottom: 0.8em;
|
|
186
|
+
border-bottom: none;
|
|
187
|
+
color: #222;
|
|
188
|
+
text-align: left;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.markdown-body h3 {
|
|
192
|
+
font-size: 1.3em;
|
|
193
|
+
font-weight: 600;
|
|
194
|
+
margin-top: 1.8em;
|
|
195
|
+
color: #333;
|
|
196
|
+
text-align: left;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.markdown-body p {
|
|
200
|
+
margin-bottom: 1.2em;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.markdown-body strong {
|
|
204
|
+
font-weight: 600;
|
|
205
|
+
color: #111;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.markdown-body mark {
|
|
209
|
+
background-color: var(--highlight-bg);
|
|
210
|
+
padding: 0.2em 0.4em;
|
|
211
|
+
border-radius: 4px;
|
|
212
|
+
font-weight: 500;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.markdown-body blockquote {
|
|
216
|
+
margin: 2em 0;
|
|
217
|
+
padding: 20px 24px;
|
|
218
|
+
background: linear-gradient(135deg, #F5F3FF 0%, #FAFAFA 100%);
|
|
219
|
+
border-left: 4px solid var(--accent-color);
|
|
220
|
+
border-radius: 0 12px 12px 0;
|
|
221
|
+
color: #4C1D95;
|
|
222
|
+
font-size: 1.05em;
|
|
223
|
+
box-shadow: 0 2px 10px rgba(139, 92, 246, 0.05);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.markdown-body blockquote p:last-child {
|
|
227
|
+
margin-bottom: 0;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.markdown-body blockquote strong {
|
|
231
|
+
color: var(--accent-color);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.markdown-body pre {
|
|
235
|
+
background-color: #F6F8FA;
|
|
236
|
+
border-radius: 12px;
|
|
237
|
+
padding: 20px;
|
|
238
|
+
overflow-x: auto;
|
|
239
|
+
border: 1px solid var(--border-color);
|
|
240
|
+
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.markdown-body code {
|
|
244
|
+
font-family: "SFMono-Regular", Menlo, monospace;
|
|
245
|
+
font-size: 0.85em;
|
|
246
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
247
|
+
padding: 0.2em 0.4em;
|
|
248
|
+
border-radius: 4px;
|
|
249
|
+
color: #EB5757;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.markdown-body pre code {
|
|
253
|
+
background-color: transparent;
|
|
254
|
+
padding: 0;
|
|
255
|
+
color: #24292E;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.markdown-body table {
|
|
259
|
+
display: table !important;
|
|
260
|
+
width: 100% !important;
|
|
261
|
+
border-collapse: separate;
|
|
262
|
+
border-spacing: 0;
|
|
263
|
+
margin: 2.5em 0;
|
|
264
|
+
border-radius: 12px;
|
|
265
|
+
overflow: hidden;
|
|
266
|
+
border: 1px solid var(--border-color);
|
|
267
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.markdown-body th,
|
|
271
|
+
.markdown-body td {
|
|
272
|
+
padding: 14px 18px;
|
|
273
|
+
border-bottom: 1px solid var(--border-color);
|
|
274
|
+
border-right: 1px solid var(--border-color);
|
|
275
|
+
font-size: 0.95em;
|
|
276
|
+
text-align: left;
|
|
277
|
+
word-break: normal;
|
|
278
|
+
white-space: normal;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.markdown-body th {
|
|
282
|
+
background: linear-gradient(135deg, #F5F3FF 0%, #EEF2FF 100%);
|
|
283
|
+
font-weight: 600;
|
|
284
|
+
color: #4C1D95;
|
|
285
|
+
text-align: center;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.markdown-body tr:last-child td {
|
|
289
|
+
border-bottom: none;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/* ================= 目录层级视觉优化 ================= */
|
|
293
|
+
#toc-container > ul > li > a {
|
|
294
|
+
font-weight: 600;
|
|
295
|
+
color: #222;
|
|
296
|
+
font-size: 14.5px;
|
|
297
|
+
margin-top: 8px;
|
|
298
|
+
padding-top: 8px;
|
|
299
|
+
padding-bottom: 8px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
#toc-container > ul > li > a:hover {
|
|
303
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
#toc-container ul ul a {
|
|
307
|
+
font-weight: 400;
|
|
308
|
+
color: var(--text-muted);
|
|
309
|
+
font-size: 13.5px;
|
|
310
|
+
padding-top: 4px;
|
|
311
|
+
padding-bottom: 4px;
|
|
312
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
color-scheme: light;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
html,
|
|
6
|
+
body {
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 0;
|
|
9
|
+
color: #111;
|
|
10
|
+
background: #fff;
|
|
11
|
+
font-family: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.page {
|
|
15
|
+
max-width: 100%;
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.markdown-body {
|
|
21
|
+
border: none;
|
|
22
|
+
border-radius: 0;
|
|
23
|
+
padding: 0;
|
|
24
|
+
box-shadow: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.markdown-body pre,
|
|
28
|
+
.markdown-body code {
|
|
29
|
+
background: #f5f5f5;
|
|
30
|
+
color: #1f2937;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media print {
|
|
34
|
+
#sidebar,
|
|
35
|
+
.doc-toolbar {
|
|
36
|
+
display: none !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
body {
|
|
40
|
+
display: block !important;
|
|
41
|
+
height: auto !important;
|
|
42
|
+
overflow: visible !important;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
#content-wrapper {
|
|
46
|
+
padding: 0 !important;
|
|
47
|
+
overflow: visible !important;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.doc-inner {
|
|
51
|
+
max-width: none !important;
|
|
52
|
+
padding: 0 !important;
|
|
53
|
+
}
|
|
54
|
+
}
|