cal-docs-server 3.0.0b1__py3-none-any.whl
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.
- cal_docs_server/.gitignore +1 -0
- cal_docs_server/__init__.py +1 -0
- cal_docs_server/__main__.py +64 -0
- cal_docs_server/_version.py +4 -0
- cal_docs_server/api.py +643 -0
- cal_docs_server/async_file.py +112 -0
- cal_docs_server/auth.py +253 -0
- cal_docs_server/cache_render_index.py +106 -0
- cal_docs_server/index_docs.py +449 -0
- cal_docs_server/main.py +191 -0
- cal_docs_server/render_index.py +174 -0
- cal_docs_server/render_md.py +90 -0
- cal_docs_server/resources/__init__.py +1 -0
- cal_docs_server/resources/help.md +171 -0
- cal_docs_server/resources/index_template.html +612 -0
- cal_docs_server/resources/md_template.html +244 -0
- cal_docs_server/resources/openapi.yaml +281 -0
- cal_docs_server/version.py +38 -0
- cal_docs_server/web_server.py +217 -0
- cal_docs_server-3.0.0b1.dist-info/METADATA +12 -0
- cal_docs_server-3.0.0b1.dist-info/RECORD +24 -0
- cal_docs_server-3.0.0b1.dist-info/WHEEL +4 -0
- cal_docs_server-3.0.0b1.dist-info/entry_points.txt +2 -0
- cal_docs_server-3.0.0b1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>$SERVER_NAME</title>
|
|
7
|
+
<style>
|
|
8
|
+
* {
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:root {
|
|
15
|
+
--bg-primary: #0a0f1e;
|
|
16
|
+
--bg-secondary: #111827;
|
|
17
|
+
--bg-card: #1a2332;
|
|
18
|
+
--bg-card-hover: #1f2937;
|
|
19
|
+
--text-primary: #f0f4f8;
|
|
20
|
+
--text-secondary: #94a3b8;
|
|
21
|
+
--text-muted: #64748b;
|
|
22
|
+
--accent-primary: #3b82f6;
|
|
23
|
+
--accent-secondary: #06b6d4;
|
|
24
|
+
--border-color: #2d3748;
|
|
25
|
+
--shadow: rgba(0, 0, 0, 0.4);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
body {
|
|
29
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
30
|
+
"Helvetica Neue", Arial, sans-serif;
|
|
31
|
+
background: linear-gradient(
|
|
32
|
+
135deg,
|
|
33
|
+
var(--bg-primary) 0%,
|
|
34
|
+
var(--bg-secondary) 100%
|
|
35
|
+
);
|
|
36
|
+
color: var(--text-primary);
|
|
37
|
+
min-height: 100vh;
|
|
38
|
+
line-height: 1.6;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.nav {
|
|
42
|
+
background: rgba(26, 33, 66, 0.95);
|
|
43
|
+
backdrop-filter: blur(10px);
|
|
44
|
+
border-bottom: 1px solid var(--border-color);
|
|
45
|
+
padding: 1.5rem 0;
|
|
46
|
+
position: sticky;
|
|
47
|
+
top: 0;
|
|
48
|
+
z-index: 100;
|
|
49
|
+
box-shadow: 0 4px 20px var(--shadow);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.nav-container {
|
|
53
|
+
max-width: 1200px;
|
|
54
|
+
margin: 0 auto;
|
|
55
|
+
padding: 0 2rem;
|
|
56
|
+
display: flex;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
align-items: center;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.brand {
|
|
62
|
+
font-size: 1.5rem;
|
|
63
|
+
font-weight: 700;
|
|
64
|
+
background: linear-gradient(
|
|
65
|
+
135deg,
|
|
66
|
+
var(--accent-primary),
|
|
67
|
+
var(--accent-secondary)
|
|
68
|
+
);
|
|
69
|
+
-webkit-background-clip: text;
|
|
70
|
+
-webkit-text-fill-color: transparent;
|
|
71
|
+
background-clip: text;
|
|
72
|
+
text-decoration: none;
|
|
73
|
+
letter-spacing: -0.5px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.nav-links {
|
|
77
|
+
display: flex;
|
|
78
|
+
gap: 2rem;
|
|
79
|
+
list-style: none;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.nav-links a {
|
|
83
|
+
color: var(--text-secondary);
|
|
84
|
+
text-decoration: none;
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
transition: color 0.3s ease;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.nav-links a:hover {
|
|
90
|
+
color: var(--accent-primary);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.container {
|
|
94
|
+
max-width: 1200px;
|
|
95
|
+
margin: 0 auto;
|
|
96
|
+
padding: 3rem 2rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.header {
|
|
100
|
+
text-align: center;
|
|
101
|
+
margin-bottom: 3rem;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.header h1 {
|
|
105
|
+
font-size: 3rem;
|
|
106
|
+
font-weight: 800;
|
|
107
|
+
background: linear-gradient(
|
|
108
|
+
135deg,
|
|
109
|
+
var(--accent-primary),
|
|
110
|
+
var(--accent-secondary)
|
|
111
|
+
);
|
|
112
|
+
-webkit-background-clip: text;
|
|
113
|
+
-webkit-text-fill-color: transparent;
|
|
114
|
+
background-clip: text;
|
|
115
|
+
margin-bottom: 0.5rem;
|
|
116
|
+
letter-spacing: -1px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.header p {
|
|
120
|
+
color: var(--text-muted);
|
|
121
|
+
font-size: 1.125rem;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.docs-grid {
|
|
125
|
+
display: grid;
|
|
126
|
+
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
|
|
127
|
+
gap: 2rem;
|
|
128
|
+
margin-top: 2rem;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.doc-card {
|
|
132
|
+
background: var(--bg-card);
|
|
133
|
+
border: 1px solid var(--border-color);
|
|
134
|
+
border-radius: 1rem;
|
|
135
|
+
padding: 2rem;
|
|
136
|
+
transition: all 0.3s ease;
|
|
137
|
+
position: relative;
|
|
138
|
+
overflow: hidden;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.doc-card::before {
|
|
142
|
+
content: "";
|
|
143
|
+
position: absolute;
|
|
144
|
+
top: 0;
|
|
145
|
+
left: 0;
|
|
146
|
+
right: 0;
|
|
147
|
+
height: 4px;
|
|
148
|
+
background: linear-gradient(
|
|
149
|
+
90deg,
|
|
150
|
+
var(--accent-primary),
|
|
151
|
+
var(--accent-secondary)
|
|
152
|
+
);
|
|
153
|
+
opacity: 0;
|
|
154
|
+
transition: opacity 0.3s ease;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.doc-card:hover {
|
|
158
|
+
background: var(--bg-card-hover);
|
|
159
|
+
border-color: var(--accent-primary);
|
|
160
|
+
transform: translateY(-4px);
|
|
161
|
+
box-shadow: 0 12px 40px var(--shadow);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.doc-card:hover::before {
|
|
165
|
+
opacity: 1;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.doc-header {
|
|
169
|
+
display: flex;
|
|
170
|
+
align-items: center;
|
|
171
|
+
gap: 1.25rem;
|
|
172
|
+
margin-bottom: 1.5rem;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.doc-logo {
|
|
176
|
+
width: 60px;
|
|
177
|
+
height: 60px;
|
|
178
|
+
border-radius: 12px;
|
|
179
|
+
object-fit: cover;
|
|
180
|
+
background: var(--bg-secondary);
|
|
181
|
+
border: 2px solid var(--border-color);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.doc-title {
|
|
185
|
+
flex: 1;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.doc-title h3 {
|
|
189
|
+
font-size: 1.5rem;
|
|
190
|
+
font-weight: 700;
|
|
191
|
+
color: var(--text-primary);
|
|
192
|
+
margin-bottom: 0.25rem;
|
|
193
|
+
letter-spacing: -0.5px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.doc-title a {
|
|
197
|
+
color: var(--text-primary);
|
|
198
|
+
text-decoration: none;
|
|
199
|
+
transition: color 0.3s ease;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.doc-title a:hover {
|
|
203
|
+
color: var(--accent-primary);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.doc-description {
|
|
207
|
+
color: var(--text-secondary);
|
|
208
|
+
margin-bottom: 1.5rem;
|
|
209
|
+
line-height: 1.7;
|
|
210
|
+
font-size: 0.95rem;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.doc-versions {
|
|
214
|
+
display: flex;
|
|
215
|
+
flex-wrap: wrap;
|
|
216
|
+
gap: 0.75rem;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.version-link {
|
|
220
|
+
display: inline-flex;
|
|
221
|
+
align-items: center;
|
|
222
|
+
padding: 0.5rem 1rem;
|
|
223
|
+
background: var(--bg-secondary);
|
|
224
|
+
border: 1px solid var(--border-color);
|
|
225
|
+
border-radius: 0.5rem;
|
|
226
|
+
color: var(--text-secondary);
|
|
227
|
+
text-decoration: none;
|
|
228
|
+
font-size: 0.875rem;
|
|
229
|
+
font-weight: 500;
|
|
230
|
+
transition: all 0.2s ease;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.version-link:hover {
|
|
234
|
+
background: var(--accent-primary);
|
|
235
|
+
border-color: var(--accent-primary);
|
|
236
|
+
color: white;
|
|
237
|
+
transform: translateY(-2px);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.version-link.latest {
|
|
241
|
+
background: linear-gradient(
|
|
242
|
+
135deg,
|
|
243
|
+
var(--accent-primary),
|
|
244
|
+
var(--accent-secondary)
|
|
245
|
+
);
|
|
246
|
+
border: none;
|
|
247
|
+
color: white;
|
|
248
|
+
font-weight: 600;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.version-link.latest:hover {
|
|
252
|
+
transform: translateY(-2px);
|
|
253
|
+
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.versions-toggle {
|
|
257
|
+
display: inline-flex;
|
|
258
|
+
align-items: center;
|
|
259
|
+
gap: 0.5rem;
|
|
260
|
+
padding: 0.5rem 1rem;
|
|
261
|
+
background: transparent;
|
|
262
|
+
border: 1px solid var(--border-color);
|
|
263
|
+
border-radius: 0.5rem;
|
|
264
|
+
color: var(--text-muted);
|
|
265
|
+
text-decoration: none;
|
|
266
|
+
font-size: 0.875rem;
|
|
267
|
+
font-weight: 500;
|
|
268
|
+
cursor: pointer;
|
|
269
|
+
transition: all 0.2s ease;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.versions-toggle:hover {
|
|
273
|
+
border-color: var(--accent-primary);
|
|
274
|
+
color: var(--text-secondary);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.versions-toggle svg {
|
|
278
|
+
width: 14px;
|
|
279
|
+
height: 14px;
|
|
280
|
+
transition: transform 0.2s ease;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.versions-toggle.expanded svg {
|
|
284
|
+
transform: rotate(180deg);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.versions-list {
|
|
288
|
+
display: none;
|
|
289
|
+
gap: 0.75rem;
|
|
290
|
+
margin-top: 0.75rem;
|
|
291
|
+
flex-wrap: wrap;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.versions-list.visible {
|
|
295
|
+
display: flex;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.empty-state {
|
|
299
|
+
text-align: center;
|
|
300
|
+
padding: 4rem 2rem;
|
|
301
|
+
color: var(--text-muted);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.empty-state svg {
|
|
305
|
+
width: 80px;
|
|
306
|
+
height: 80px;
|
|
307
|
+
margin-bottom: 1.5rem;
|
|
308
|
+
opacity: 0.5;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
@media (max-width: 768px) {
|
|
312
|
+
.header h1 {
|
|
313
|
+
font-size: 2rem;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.docs-grid {
|
|
317
|
+
grid-template-columns: 1fr;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.nav-container {
|
|
321
|
+
flex-direction: column;
|
|
322
|
+
gap: 1rem;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.container {
|
|
326
|
+
padding: 2rem 1rem;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
@keyframes fadeIn {
|
|
331
|
+
from {
|
|
332
|
+
opacity: 0;
|
|
333
|
+
transform: translateY(20px);
|
|
334
|
+
}
|
|
335
|
+
to {
|
|
336
|
+
opacity: 1;
|
|
337
|
+
transform: translateY(0);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.doc-card {
|
|
342
|
+
animation: fadeIn 0.5s ease backwards;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.doc-card:nth-child(1) {
|
|
346
|
+
animation-delay: 0.05s;
|
|
347
|
+
}
|
|
348
|
+
.doc-card:nth-child(2) {
|
|
349
|
+
animation-delay: 0.1s;
|
|
350
|
+
}
|
|
351
|
+
.doc-card:nth-child(3) {
|
|
352
|
+
animation-delay: 0.15s;
|
|
353
|
+
}
|
|
354
|
+
.doc-card:nth-child(4) {
|
|
355
|
+
animation-delay: 0.2s;
|
|
356
|
+
}
|
|
357
|
+
.doc-card:nth-child(5) {
|
|
358
|
+
animation-delay: 0.25s;
|
|
359
|
+
}
|
|
360
|
+
.doc-card:nth-child(6) {
|
|
361
|
+
animation-delay: 0.3s;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.search-container {
|
|
365
|
+
max-width: 600px;
|
|
366
|
+
margin: 2rem auto 0;
|
|
367
|
+
position: relative;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.search-wrapper {
|
|
371
|
+
position: relative;
|
|
372
|
+
display: flex;
|
|
373
|
+
align-items: center;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.search-icon {
|
|
377
|
+
position: absolute;
|
|
378
|
+
left: 1.25rem;
|
|
379
|
+
width: 20px;
|
|
380
|
+
height: 20px;
|
|
381
|
+
color: var(--text-muted);
|
|
382
|
+
pointer-events: none;
|
|
383
|
+
z-index: 1;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.search-input {
|
|
387
|
+
width: 100%;
|
|
388
|
+
padding: 1rem 1rem 1rem 3.5rem;
|
|
389
|
+
background: var(--bg-card);
|
|
390
|
+
border: 2px solid var(--border-color);
|
|
391
|
+
border-radius: 1rem;
|
|
392
|
+
color: var(--text-primary);
|
|
393
|
+
font-size: 1rem;
|
|
394
|
+
font-family: inherit;
|
|
395
|
+
transition: all 0.3s ease;
|
|
396
|
+
outline: none;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.search-input::placeholder {
|
|
400
|
+
color: var(--text-muted);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.search-input:focus {
|
|
404
|
+
border-color: var(--accent-primary);
|
|
405
|
+
background: var(--bg-card-hover);
|
|
406
|
+
box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.clear-search {
|
|
410
|
+
position: absolute;
|
|
411
|
+
right: 1rem;
|
|
412
|
+
background: transparent;
|
|
413
|
+
border: none;
|
|
414
|
+
color: var(--text-muted);
|
|
415
|
+
cursor: pointer;
|
|
416
|
+
padding: 0.5rem;
|
|
417
|
+
border-radius: 0.5rem;
|
|
418
|
+
transition: all 0.2s ease;
|
|
419
|
+
display: none;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.clear-search:hover {
|
|
423
|
+
background: var(--bg-secondary);
|
|
424
|
+
color: var(--text-primary);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.clear-search.visible {
|
|
428
|
+
display: block;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.search-results-info {
|
|
432
|
+
text-align: center;
|
|
433
|
+
margin-top: 1rem;
|
|
434
|
+
color: var(--text-muted);
|
|
435
|
+
font-size: 0.95rem;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.doc-card.hidden {
|
|
439
|
+
display: none;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.no-results {
|
|
443
|
+
grid-column: 1 / -1;
|
|
444
|
+
text-align: center;
|
|
445
|
+
padding: 4rem 2rem;
|
|
446
|
+
color: var(--text-muted);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.no-results svg {
|
|
450
|
+
width: 80px;
|
|
451
|
+
height: 80px;
|
|
452
|
+
margin-bottom: 1.5rem;
|
|
453
|
+
opacity: 0.5;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.no-results h3 {
|
|
457
|
+
font-size: 1.5rem;
|
|
458
|
+
margin-bottom: 0.5rem;
|
|
459
|
+
color: var(--text-secondary);
|
|
460
|
+
}
|
|
461
|
+
</style>
|
|
462
|
+
</head>
|
|
463
|
+
<body>
|
|
464
|
+
<nav class="nav">
|
|
465
|
+
<div class="nav-container">
|
|
466
|
+
<a href="/" class="brand">$SERVER_NAME</a>
|
|
467
|
+
<ul class="nav-links">
|
|
468
|
+
<li><a href="/help">Help</a></li>
|
|
469
|
+
</ul>
|
|
470
|
+
</div>
|
|
471
|
+
</nav>
|
|
472
|
+
|
|
473
|
+
<div class="container">
|
|
474
|
+
<div class="header">
|
|
475
|
+
<h1>Project Documentation</h1>
|
|
476
|
+
<p>Browse available documentation and API references</p>
|
|
477
|
+
<div class="search-container">
|
|
478
|
+
<div class="search-wrapper">
|
|
479
|
+
<svg class="search-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
480
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
|
|
481
|
+
</svg>
|
|
482
|
+
<input
|
|
483
|
+
type="text"
|
|
484
|
+
class="search-input"
|
|
485
|
+
id="searchInput"
|
|
486
|
+
placeholder="Search projects..."
|
|
487
|
+
autocomplete="off"
|
|
488
|
+
/>
|
|
489
|
+
<button class="clear-search" id="clearSearch" aria-label="Clear search">
|
|
490
|
+
<svg width="20" height="20" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
491
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
|
|
492
|
+
</svg>
|
|
493
|
+
</button>
|
|
494
|
+
</div>
|
|
495
|
+
<div class="search-results-info" id="resultsInfo"></div>
|
|
496
|
+
</div>
|
|
497
|
+
</div>
|
|
498
|
+
|
|
499
|
+
<div class="docs-grid" id="docsGrid">$INSERT_DATA</div>
|
|
500
|
+
</div>
|
|
501
|
+
|
|
502
|
+
<script>
|
|
503
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
504
|
+
// Search functionality
|
|
505
|
+
const searchInput = document.getElementById("searchInput");
|
|
506
|
+
const clearButton = document.getElementById("clearSearch");
|
|
507
|
+
const resultsInfo = document.getElementById("resultsInfo");
|
|
508
|
+
const docsGrid = document.getElementById("docsGrid");
|
|
509
|
+
const docCards = Array.from(document.querySelectorAll(".doc-card"));
|
|
510
|
+
let noResultsElement = null;
|
|
511
|
+
|
|
512
|
+
function createNoResultsMessage() {
|
|
513
|
+
const div = document.createElement("div");
|
|
514
|
+
div.className = "no-results";
|
|
515
|
+
div.innerHTML = `
|
|
516
|
+
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
517
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
518
|
+
</svg>
|
|
519
|
+
<h3>No projects found</h3>
|
|
520
|
+
<p>Try adjusting your search terms</p>
|
|
521
|
+
`;
|
|
522
|
+
return div;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function filterProjects() {
|
|
526
|
+
const searchTerm = searchInput.value.toLowerCase().trim();
|
|
527
|
+
|
|
528
|
+
// Show/hide clear button
|
|
529
|
+
if (searchTerm) {
|
|
530
|
+
clearButton.classList.add("visible");
|
|
531
|
+
} else {
|
|
532
|
+
clearButton.classList.remove("visible");
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// Remove existing no-results message if any
|
|
536
|
+
if (noResultsElement) {
|
|
537
|
+
noResultsElement.remove();
|
|
538
|
+
noResultsElement = null;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
let visibleCount = 0;
|
|
542
|
+
|
|
543
|
+
docCards.forEach((card) => {
|
|
544
|
+
const title = card.querySelector(".doc-title h3")?.textContent.toLowerCase() || "";
|
|
545
|
+
|
|
546
|
+
if (!searchTerm || title.includes(searchTerm)) {
|
|
547
|
+
card.classList.remove("hidden");
|
|
548
|
+
visibleCount++;
|
|
549
|
+
} else {
|
|
550
|
+
card.classList.add("hidden");
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
// Update results info
|
|
555
|
+
if (searchTerm) {
|
|
556
|
+
if (visibleCount === 0) {
|
|
557
|
+
resultsInfo.textContent = "No matches found";
|
|
558
|
+
noResultsElement = createNoResultsMessage();
|
|
559
|
+
docsGrid.appendChild(noResultsElement);
|
|
560
|
+
} else if (visibleCount === 1) {
|
|
561
|
+
resultsInfo.textContent = "1 project found";
|
|
562
|
+
} else {
|
|
563
|
+
resultsInfo.textContent = visibleCount + " projects found";
|
|
564
|
+
}
|
|
565
|
+
} else {
|
|
566
|
+
resultsInfo.textContent = "";
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// Live search on input
|
|
571
|
+
searchInput.addEventListener("input", filterProjects);
|
|
572
|
+
|
|
573
|
+
// Clear search
|
|
574
|
+
clearButton.addEventListener("click", function () {
|
|
575
|
+
searchInput.value = "";
|
|
576
|
+
searchInput.focus();
|
|
577
|
+
filterProjects();
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
// Clear on Escape key
|
|
581
|
+
searchInput.addEventListener("keydown", function (e) {
|
|
582
|
+
if (e.key === "Escape") {
|
|
583
|
+
searchInput.value = "";
|
|
584
|
+
filterProjects();
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
// Add click handlers to all version toggles
|
|
589
|
+
document.querySelectorAll(".versions-toggle").forEach((toggle) => {
|
|
590
|
+
toggle.addEventListener("click", function (e) {
|
|
591
|
+
e.preventDefault();
|
|
592
|
+
const card = this.closest(".doc-card");
|
|
593
|
+
const versionsList = card.querySelector(".versions-list");
|
|
594
|
+
const countSpan = this.querySelector(".version-count");
|
|
595
|
+
|
|
596
|
+
// Toggle visibility
|
|
597
|
+
versionsList.classList.toggle("visible");
|
|
598
|
+
this.classList.toggle("expanded");
|
|
599
|
+
|
|
600
|
+
// Update text
|
|
601
|
+
if (versionsList.classList.contains("visible")) {
|
|
602
|
+
countSpan.textContent = "Hide versions";
|
|
603
|
+
} else {
|
|
604
|
+
const count = versionsList.querySelectorAll(".version-link").length;
|
|
605
|
+
countSpan.textContent = count + " version" + (count !== 1 ? "s" : "");
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
});
|
|
609
|
+
});
|
|
610
|
+
</script>
|
|
611
|
+
</body>
|
|
612
|
+
</html>
|