@unana_dev/doxen 0.0.0-stage → 0.2.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.
@@ -0,0 +1,631 @@
1
+ :root {
2
+ font-family:
3
+ -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
4
+ color: #26292d;
5
+ background: white;
6
+ line-height: 1.7;
7
+ --line: #e1e6eb;
8
+ --muted: #818891;
9
+ --blue: #009dff;
10
+ }
11
+ * {
12
+ box-sizing: border-box;
13
+ }
14
+ body {
15
+ margin: 0;
16
+ }
17
+ a {
18
+ color: var(--blue);
19
+ text-decoration: none;
20
+ }
21
+ a:hover {
22
+ text-decoration: underline;
23
+ }
24
+ button,
25
+ input {
26
+ font: inherit;
27
+ }
28
+ button {
29
+ cursor: pointer;
30
+ color: #737d88;
31
+ background: white;
32
+ border: 1px solid var(--line);
33
+ border-radius: 7px;
34
+ padding: 5px 9px;
35
+ }
36
+ button:disabled {
37
+ opacity: 0.35;
38
+ cursor: default;
39
+ }
40
+ input {
41
+ min-width: 0;
42
+ color: #353a40;
43
+ border: 1px solid #d1dbe5;
44
+ border-radius: 10px;
45
+ padding: 8px 12px;
46
+ background: #fff;
47
+ }
48
+ input::placeholder {
49
+ color: #9ba3ad;
50
+ }
51
+ input:focus-visible,
52
+ button:focus-visible,
53
+ a:focus-visible,
54
+ summary:focus-visible {
55
+ outline: 2px solid #76caff;
56
+ outline-offset: 3px;
57
+ }
58
+ header {
59
+ max-width: 1360px;
60
+ margin: auto;
61
+ height: 64px;
62
+ display: grid;
63
+ grid-template-columns: 290px minmax(0, 768px) 224px;
64
+ gap: 40px;
65
+ align-items: center;
66
+ padding: 0 24px;
67
+ }
68
+ .brand {
69
+ display: flex;
70
+ align-items: center;
71
+ gap: 12px;
72
+ color: #24272b;
73
+ font-size: 19px;
74
+ font-weight: 650;
75
+ }
76
+ .brand-icon {
77
+ display: grid;
78
+ place-items: center;
79
+ width: 32px;
80
+ height: 32px;
81
+ border: 1px solid var(--icon-border, #bcdff8);
82
+ background: var(--icon-background, #edf8ff);
83
+ color: var(--icon-color, #467792);
84
+ border-radius: 3px;
85
+ font-size: 21px;
86
+ line-height: 1;
87
+ }
88
+ .search-trigger {
89
+ width: min(100%, 440px);
90
+ display: flex;
91
+ justify-content: space-between;
92
+ align-items: center;
93
+ border: 1px solid #d1dbe5;
94
+ border-radius: 13px;
95
+ padding: 8px 12px;
96
+ box-shadow: 0 1px 3px #182b4010;
97
+ color: #939ca6;
98
+ text-align: left;
99
+ font-size: 13px;
100
+ }
101
+ kbd {
102
+ font: 10px inherit;
103
+ border: 1px solid var(--line);
104
+ border-radius: 4px;
105
+ padding: 1px 4px;
106
+ color: #929aa4;
107
+ }
108
+ #tabs {
109
+ display: flex;
110
+ gap: 32px;
111
+ height: 44px;
112
+ padding: 0 max(24px, calc((100% - 1312px) / 2));
113
+ border-bottom: 1px solid #ebedf0;
114
+ overflow: auto;
115
+ }
116
+ #tabs a {
117
+ padding: 10px 0 9px;
118
+ font-size: 13px;
119
+ color: #858b93;
120
+ white-space: nowrap;
121
+ border-bottom: 2px solid transparent;
122
+ }
123
+ #tabs a.active {
124
+ color: var(--blue);
125
+ border-color: var(--blue);
126
+ }
127
+ .layout {
128
+ display: grid;
129
+ grid-template-columns: 290px minmax(0, 768px) 224px;
130
+ gap: 40px;
131
+ max-width: 1360px;
132
+ padding: 0 24px;
133
+ margin: auto;
134
+ }
135
+ .sidebar {
136
+ position: sticky;
137
+ top: 0;
138
+ height: 100vh;
139
+ overflow: auto;
140
+ padding: 34px 14px 30px 0;
141
+ }
142
+ .eyebrow {
143
+ font-size: 12px;
144
+ color: #8a9098;
145
+ margin-bottom: 18px;
146
+ letter-spacing: 0;
147
+ }
148
+ .powered {
149
+ font-size: 10px;
150
+ color: #abb1b8;
151
+ margin-top: 48px;
152
+ }
153
+ #documents a {
154
+ display: block;
155
+ padding: 6px 12px 6px 20px;
156
+ font-size: 13px;
157
+ color: #7d8289;
158
+ border-left: 1px solid var(--line);
159
+ overflow-wrap: anywhere;
160
+ }
161
+ #documents a.selected {
162
+ color: var(--blue);
163
+ border-left-color: var(--blue);
164
+ }
165
+ .folder-group summary {
166
+ list-style: none;
167
+ cursor: pointer;
168
+ font-size: 13px;
169
+ color: #797f87;
170
+ padding: 7px 14px 7px 20px;
171
+ position: relative;
172
+ }
173
+ .folder-group summary::after {
174
+ content: "›";
175
+ position: absolute;
176
+ right: 4px;
177
+ color: #b0b7bf;
178
+ }
179
+ .folder-group[open] > summary::after {
180
+ transform: rotate(90deg);
181
+ }
182
+ .folder-group summary::-webkit-details-marker {
183
+ display: none;
184
+ }
185
+ .folder-children {
186
+ margin-left: 20px;
187
+ border-left: 1px solid var(--line);
188
+ }
189
+ .folder-children > a {
190
+ margin-left: -1px;
191
+ }
192
+ main {
193
+ position: relative;
194
+ min-width: 0;
195
+ padding: 30px 0 64px;
196
+ }
197
+ #breadcrumb {
198
+ color: #46a5df;
199
+ font-size: 11px;
200
+ padding-right: 135px;
201
+ margin-bottom: 12px;
202
+ overflow-wrap: anywhere;
203
+ }
204
+ .document-find {
205
+ position: absolute;
206
+ right: 0;
207
+ top: 28px;
208
+ z-index: 1;
209
+ font-size: 11px;
210
+ color: #8a929c;
211
+ }
212
+ .document-find > summary {
213
+ cursor: pointer;
214
+ list-style: none;
215
+ border: 1px solid var(--line);
216
+ padding: 3px 9px;
217
+ border-radius: 6px;
218
+ background: white;
219
+ }
220
+ .document-tools {
221
+ position: absolute;
222
+ right: 0;
223
+ top: 34px;
224
+ width: 330px;
225
+ display: flex;
226
+ gap: 5px;
227
+ align-items: center;
228
+ background: white;
229
+ border: 1px solid var(--line);
230
+ padding: 10px;
231
+ border-radius: 9px;
232
+ box-shadow: 0 5px 20px #122c4115;
233
+ }
234
+ .document-tools label {
235
+ position: absolute;
236
+ clip-path: inset(50%);
237
+ width: 1px;
238
+ height: 1px;
239
+ overflow: hidden;
240
+ }
241
+ .document-tools input {
242
+ width: 130px;
243
+ flex: 1;
244
+ font-size: 12px;
245
+ padding: 5px 8px;
246
+ }
247
+ .document-tools span {
248
+ white-space: nowrap;
249
+ }
250
+ .document-tools button {
251
+ padding: 2px 7px;
252
+ }
253
+ article {
254
+ font-size: 14px;
255
+ line-height: 1.85;
256
+ overflow-wrap: anywhere;
257
+ }
258
+ article h1 {
259
+ font-size: 32px;
260
+ letter-spacing: -1.1px;
261
+ line-height: 1.4;
262
+ margin: 10px 0 25px;
263
+ color: #1e2023;
264
+ font-weight: 700;
265
+ }
266
+ article h2 {
267
+ font-size: 26px;
268
+ letter-spacing: -0.7px;
269
+ margin: 46px 0 18px;
270
+ line-height: 1.5;
271
+ font-weight: 650;
272
+ }
273
+ article h3 {
274
+ font-size: 19px;
275
+ margin: 28px 0 14px;
276
+ }
277
+ article :is(h1, h2, h3, h4, h5, h6) {
278
+ scroll-margin-top: 24px;
279
+ }
280
+ article p {
281
+ color: #646c76;
282
+ margin: 16px 0;
283
+ }
284
+ article blockquote {
285
+ margin: 24px 0 20px;
286
+ padding: 1px 22px;
287
+ border-left: 2px solid #d6dfe6;
288
+ color: #727b85;
289
+ }
290
+ article blockquote p {
291
+ color: #727b85;
292
+ }
293
+ article hr {
294
+ border: 0;
295
+ border-top: 1px solid var(--line);
296
+ margin: 24px 0 42px;
297
+ }
298
+ article ul,
299
+ article ol {
300
+ padding-left: 24px;
301
+ color: #626b75;
302
+ }
303
+ article pre {
304
+ overflow: auto;
305
+ padding: 18px;
306
+ background: #f6f8fa;
307
+ border: 1px solid var(--line);
308
+ border-radius: 8px;
309
+ }
310
+ article code {
311
+ font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
312
+ font-size: 12px;
313
+ background: #f4f7f9;
314
+ border: 1px solid #d8e0e7;
315
+ border-radius: 3px;
316
+ padding: 1px 4px;
317
+ color: #39414a;
318
+ }
319
+ article pre code {
320
+ padding: 0;
321
+ border: 0;
322
+ background: none;
323
+ }
324
+ article table {
325
+ width: 100%;
326
+ border-collapse: separate;
327
+ border-spacing: 0;
328
+ font-size: 13px;
329
+ line-height: 1.6;
330
+ margin: 12px 0 22px;
331
+ table-layout: fixed;
332
+ }
333
+ article th,
334
+ article td {
335
+ text-align: left;
336
+ padding: 9px 12px;
337
+ vertical-align: top;
338
+ overflow-wrap: anywhere;
339
+ }
340
+ article th {
341
+ background: #f5f7f9;
342
+ border-block: 1px solid var(--line);
343
+ font-weight: 500;
344
+ }
345
+ article th:first-child {
346
+ border-left: 1px solid var(--line);
347
+ border-radius: 9px 0 0 9px;
348
+ }
349
+ article th:last-child {
350
+ border-right: 1px solid var(--line);
351
+ border-radius: 0 9px 9px 0;
352
+ }
353
+ article td {
354
+ border-bottom: 1px solid var(--line);
355
+ color: #4b5158;
356
+ }
357
+ article td + td {
358
+ border-left: 1px solid var(--line);
359
+ }
360
+ article tr:last-child td {
361
+ border-bottom: 0;
362
+ }
363
+ article img {
364
+ max-width: 100%;
365
+ height: auto;
366
+ }
367
+ .search-section {
368
+ margin: 0 0 26px;
369
+ }
370
+ .section-tools {
371
+ display: flex;
372
+ align-items: center;
373
+ gap: 6px;
374
+ border: 1px solid #d1dbe5;
375
+ border-radius: 11px;
376
+ padding: 5px 9px;
377
+ box-shadow: 0 1px 2px #122c4110;
378
+ position: relative;
379
+ font-size: 11px;
380
+ }
381
+ .section-tools::before {
382
+ content: "⌕";
383
+ font-size: 20px;
384
+ line-height: 1;
385
+ color: #7e8a96;
386
+ }
387
+ .section-tools:focus-within {
388
+ border-color: #acd3f0;
389
+ box-shadow: 0 0 0 2px #acd3f0, 0 4px 10px #62b5ed24;
390
+ }
391
+ .section-tools input:focus-visible {
392
+ outline: none;
393
+ }
394
+ .section-tools label {
395
+ position: absolute;
396
+ width: 1px;
397
+ height: 1px;
398
+ overflow: hidden;
399
+ clip-path: inset(50%);
400
+ }
401
+ .section-tools input {
402
+ flex: 1;
403
+ width: 100%;
404
+ border: 0;
405
+ box-shadow: none;
406
+ padding: 2px 3px;
407
+ border-radius: 3px;
408
+ font-size: 12px;
409
+ }
410
+ .section-tools button {
411
+ padding: 0 6px;
412
+ border: 0;
413
+ }
414
+ .section-tools button:disabled {
415
+ display: none;
416
+ }
417
+ .match-count {
418
+ white-space: nowrap;
419
+ color: #8794a1;
420
+ }
421
+ .section-content > :first-child {
422
+ margin-top: 12px;
423
+ }
424
+ .toc {
425
+ position: sticky;
426
+ top: 0;
427
+ height: 100vh;
428
+ padding: 30px 0;
429
+ overflow: auto;
430
+ }
431
+ .toc .eyebrow {
432
+ font-size: 11px;
433
+ }
434
+ #toc a {
435
+ display: block;
436
+ color: #858c96;
437
+ font-size: 12px;
438
+ margin: 15px 0;
439
+ line-height: 1.8;
440
+ }
441
+ #toc a:hover {
442
+ color: var(--blue);
443
+ }
444
+ #pagination {
445
+ display: flex;
446
+ gap: 16px;
447
+ border-top: 1px solid var(--line);
448
+ padding-top: 25px;
449
+ margin-top: 42px;
450
+ }
451
+ #pagination > a,
452
+ #pagination > span {
453
+ flex: 1;
454
+ }
455
+ #pagination a {
456
+ border: 1px solid var(--line);
457
+ border-radius: 8px;
458
+ padding: 12px 16px;
459
+ }
460
+ #pagination a:last-child {
461
+ text-align: right;
462
+ }
463
+ #pagination small {
464
+ display: block;
465
+ color: #959da6;
466
+ font-size: 11px;
467
+ }
468
+ #pagination strong {
469
+ display: block;
470
+ font-size: 13px;
471
+ font-weight: 500;
472
+ }
473
+ mark {
474
+ background: #fff1ad;
475
+ color: inherit;
476
+ border-radius: 2px;
477
+ }
478
+ mark.active-hit {
479
+ background: #ffe17c;
480
+ outline: 1px solid #d5ad39;
481
+ }
482
+ .skip-link {
483
+ position: absolute;
484
+ left: -999px;
485
+ z-index: 5;
486
+ background: white;
487
+ padding: 8px;
488
+ }
489
+ .skip-link:focus {
490
+ left: 8px;
491
+ }
492
+ dialog {
493
+ width: min(680px, calc(100% - 32px));
494
+ max-height: 80vh;
495
+ margin: 10vh auto;
496
+ padding: 24px;
497
+ border: 1px solid var(--line);
498
+ border-radius: 14px;
499
+ box-shadow: 0 24px 90px #10203030;
500
+ color: #343e48;
501
+ }
502
+ dialog::backdrop {
503
+ background: #26354455;
504
+ backdrop-filter: blur(3px);
505
+ }
506
+ .dialog-head {
507
+ display: flex;
508
+ justify-content: space-between;
509
+ align-items: center;
510
+ margin-bottom: 18px;
511
+ }
512
+ .dialog-head button {
513
+ border: 0;
514
+ font-size: 11px;
515
+ }
516
+ #global-search {
517
+ width: 100%;
518
+ font-size: 14px;
519
+ padding: 12px;
520
+ }
521
+ #search-count {
522
+ font-size: 12px;
523
+ color: #929ba5;
524
+ }
525
+ .result {
526
+ display: block;
527
+ padding: 15px 10px;
528
+ border-top: 1px solid var(--line);
529
+ }
530
+ .result:hover {
531
+ background: #f5f9fc;
532
+ text-decoration: none;
533
+ }
534
+ .result small {
535
+ display: block;
536
+ color: #96a2ad;
537
+ font-size: 10px;
538
+ }
539
+ .result strong {
540
+ font-size: 15px;
541
+ }
542
+ .result p {
543
+ font-size: 12px;
544
+ color: #7e8a96;
545
+ margin: 4px 0;
546
+ }
547
+ .result mark {
548
+ background: #dcf0ff;
549
+ }
550
+ @media (max-width: 1200px) {
551
+ header,
552
+ .layout {
553
+ grid-template-columns: 230px minmax(0, 1fr);
554
+ gap: 30px;
555
+ }
556
+ .toc,
557
+ .header-label {
558
+ display: none;
559
+ }
560
+ }
561
+ @media (max-width: 700px) {
562
+ header {
563
+ height: 64px;
564
+ display: flex;
565
+ padding: 0 20px;
566
+ gap: 20px;
567
+ }
568
+ .brand {
569
+ font-size: 16px;
570
+ }
571
+ .search-trigger {
572
+ margin-left: auto;
573
+ width: 150px;
574
+ font-size: 12px;
575
+ }
576
+ .search-trigger kbd {
577
+ display: none;
578
+ }
579
+ #tabs {
580
+ padding: 0 20px;
581
+ gap: 25px;
582
+ }
583
+ .layout {
584
+ display: block;
585
+ padding: 0 20px;
586
+ }
587
+ .sidebar {
588
+ position: static;
589
+ height: auto;
590
+ max-height: 240px;
591
+ border-bottom: 1px solid var(--line);
592
+ padding: 18px 0;
593
+ }
594
+ .sidebar .eyebrow,
595
+ .powered {
596
+ display: none;
597
+ }
598
+ main {
599
+ padding-top: 25px;
600
+ }
601
+ .document-find {
602
+ top: 22px;
603
+ }
604
+ article h1 {
605
+ font-size: 27px;
606
+ }
607
+ article h2 {
608
+ font-size: 23px;
609
+ }
610
+ article table {
611
+ font-size: 12px;
612
+ }
613
+ article td,
614
+ article th {
615
+ padding: 8px;
616
+ }
617
+ #breadcrumb {
618
+ font-size: 10px;
619
+ }
620
+ .document-tools {
621
+ width: min(330px, calc(100vw - 40px));
622
+ }
623
+ .section-tools {
624
+ padding: 6px 9px;
625
+ }
626
+ }
627
+ @media (prefers-reduced-motion: reduce) {
628
+ * {
629
+ scroll-behavior: auto !important;
630
+ }
631
+ }
package/package.json CHANGED
@@ -1,6 +1,57 @@
1
1
  {
2
2
  "name": "@unana_dev/doxen",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Config-first Markdown documentation sites with Korean and section search",
5
+ "type": "module",
6
+ "bin": {
7
+ "docs": "bin/docs.js",
8
+ "doxen": "bin/docs.js"
9
+ },
10
+ "exports": {
11
+ ".": {
12
+ "types": "./src/index.d.ts",
13
+ "default": "./src/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "bin",
18
+ "src",
19
+ "client",
20
+ "README.md",
21
+ "LICENSE"
22
+ ],
23
+ "engines": {
24
+ "node": ">=22"
25
+ },
26
+ "scripts": {
27
+ "test": "node --test test/*.test.js",
28
+ "dev": "node bin/docs.js dev --config examples/docs.config.ts",
29
+ "build": "node bin/docs.js build --config examples/docs.config.ts",
30
+ "check": "node --check bin/docs.js && node --check client/app.js && npm test",
31
+ "test:browser": "playwright test",
32
+ "test:package": "node e2e/package-smoke.js"
33
+ },
34
+ "dependencies": {
35
+ "@inquirer/prompts": "7.10.1",
36
+ "chokidar": "^4.0.3",
37
+ "esbuild": "^0.28.2",
38
+ "github-slugger": "^2.0.0",
39
+ "jiti": "^2.6.1",
40
+ "jose": "^6.2.12",
41
+ "markdown-it": "^14.1.0",
42
+ "markdown-it-container": "^4.0.0",
43
+ "sanitize-html": "^2.17.0",
44
+ "wrangler": "4.149.0"
45
+ },
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/ph-1dnjs/doxen.git"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "license": "MIT",
54
+ "devDependencies": {
55
+ "@playwright/test": "^1.64.0"
56
+ }
57
+ }
@@ -0,0 +1,33 @@
1
+ import { createRemoteJWKSet, jwtVerify } from "jose";
2
+
3
+ export function accessWorker(access, keys = createRemoteJWKSet(
4
+ new URL(`${access.teamDomain}/cdn-cgi/access/certs`),
5
+ )) {
6
+ const emails = new Set(access.emails.map((email) => email.toLowerCase()));
7
+ return {
8
+ async fetch(request, env) {
9
+ const denied = () => new Response("업무 사용자 인증이 필요합니다.", {
10
+ status: 403,
11
+ headers: { "Cache-Control": "private, no-store" },
12
+ });
13
+ const token = request.headers.get("cf-access-jwt-assertion");
14
+ if (!token) return denied();
15
+ try {
16
+ const { payload } = await jwtVerify(token, keys, {
17
+ issuer: access.teamDomain,
18
+ audience: access.audiences,
19
+ algorithms: ["RS256"],
20
+ requiredClaims: ["exp", "iat", "email"],
21
+ });
22
+ if (typeof payload.email !== "string" || !emails.has(payload.email.toLowerCase()))
23
+ return denied();
24
+ } catch {
25
+ return denied();
26
+ }
27
+ const asset = await env.ASSETS.fetch(request);
28
+ const response = new Response(asset.body, asset);
29
+ response.headers.set("Cache-Control", "private, no-store");
30
+ return response;
31
+ },
32
+ };
33
+ }