@unana_dev/doxen 0.2.2 → 0.2.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.md CHANGED
@@ -235,6 +235,7 @@ guide/
235
235
 
236
236
  - 표준 Markdown (제목, 목록, 강조 등)
237
237
  - 코드 블록, 표
238
+ - Mermaid 코드 블록(`mermaid`): 시퀀스·흐름도 등을 다이어그램으로 표시합니다. 언어 지정 없이 `sequenceDiagram`으로 시작하는 코드 블록도 지원합니다. 문법 오류가 있으면 안내와 원본 코드를 표시합니다.
238
239
  - 다른 문서로의 상대 링크 (`[설치 방법](./02-installation.md)`)
239
240
  - 한국어 제목 앵커 (`#설치-방법`)
240
241
  - 이미지·PDF 첨부: PNG / JPEG / GIF / WebP / AVIF / ICO / PDF
@@ -578,4 +579,4 @@ npm pack
578
579
 
579
580
  ---
580
581
 
581
- 궁금한 점이나 버그는 저장소 이슈로 남겨 주세요. 즐거운 문서 작성 되세요! 📚
582
+ 궁금한 점이나 버그는 저장소 이슈로 남겨 주세요. 즐거운 문서 작성 되세요! 📚
package/client/app.js CHANGED
@@ -25,7 +25,7 @@ function highlight(root, query) {
25
25
  clearMarks(root);
26
26
  const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, {
27
27
  acceptNode(node) {
28
- return node.parentElement.closest(".section-tools, script, style, [hidden]")
28
+ return node.parentElement.closest(".section-tools, pre, .diagram, script, style, [hidden]")
29
29
  ? NodeFilter.FILTER_REJECT
30
30
  : NodeFilter.FILTER_ACCEPT;
31
31
  },
@@ -95,7 +95,10 @@ function attachTableSearches() {
95
95
  }
96
96
  }
97
97
 
98
- function renderNavigation() {
98
+ function renderNavigation(folderPath) {
99
+ $(".sidebar .eyebrow").textContent = site.tabs.find(
100
+ (tab) => tab.slug === activeTab,
101
+ ).title;
99
102
  $("#tabs").replaceChildren();
100
103
  for (const tab of site.tabs) {
101
104
  const first = site.documents.find((doc) => doc.tab === tab.slug);
@@ -113,8 +116,13 @@ function renderNavigation() {
113
116
  key += `${part}/`;
114
117
  if (!folders.has(key)) {
115
118
  const group = el("details", undefined, "folder-group");
116
- group.open = current?.path.startsWith(key) || false;
117
- group.append(el("summary", part));
119
+ group.open = (current?.path || folderPath || "").startsWith(key);
120
+ const summary = el("summary");
121
+ const link = el("a", part, key === folderPath ? "selected" : "");
122
+ link.href = route(`${activeTab}/${key}`);
123
+ if (key === folderPath) link.setAttribute("aria-current", "page");
124
+ summary.append(link);
125
+ group.append(summary);
118
126
  const children = el("div", undefined, "folder-children");
119
127
  group.append(children);
120
128
  parent.append(group);
@@ -129,6 +137,58 @@ function renderNavigation() {
129
137
  }
130
138
  }
131
139
 
140
+ function renderBreadcrumb(parts = [], currentItem) {
141
+ const tab = site.tabs.find((item) => item.slug === activeTab);
142
+ const first = site.documents.find((doc) => doc.tab === activeTab);
143
+ const items = [
144
+ { title: tab.title, id: first?.id || `${activeTab}/` },
145
+ ...parts.map((title, index) => ({
146
+ title,
147
+ id: `${activeTab}/${parts.slice(0, index + 1).join("/")}/`,
148
+ })),
149
+ ];
150
+ if (currentItem) items.push(currentItem);
151
+ const list = el("ol");
152
+ for (const item of items) {
153
+ const entry = el("li");
154
+ const link = el("a", item.title);
155
+ link.href = route(item.id);
156
+ if (item === currentItem) link.setAttribute("aria-current", "page");
157
+ entry.append(link);
158
+ list.append(entry);
159
+ }
160
+ $("#breadcrumb").replaceChildren(list);
161
+ }
162
+
163
+ function renderFolder(folderPath) {
164
+ const title = folderPath.split("/").at(-2);
165
+ document.title = `${title} · ${site.title}`;
166
+ renderBreadcrumb(folderPath.split("/").slice(0, -2), {
167
+ title,
168
+ id: `${activeTab}/${folderPath}`,
169
+ });
170
+ const cards = el("nav", undefined, "folder-cards");
171
+ cards.setAttribute("aria-label", "하위 폴더 및 문서");
172
+ const children = new Map();
173
+ for (const doc of site.documents.filter(
174
+ (item) => item.tab === activeTab && item.path.startsWith(folderPath),
175
+ )) {
176
+ const relative = doc.path.slice(folderPath.length);
177
+ const nested = relative.includes("/");
178
+ const name = relative.split("/")[0];
179
+ const id = nested ? `${activeTab}/${folderPath}${name}/` : doc.id;
180
+ if (!children.has(id)) children.set(id, nested ? name : doc.title);
181
+ }
182
+ for (const [id, name] of children) {
183
+ const link = el("a", name);
184
+ link.href = route(id);
185
+ cards.append(link);
186
+ }
187
+ $("#article").replaceChildren(el("h1", title), cards);
188
+ pendingQuery = "";
189
+ window.scrollTo(0, 0);
190
+ }
191
+
132
192
  function render() {
133
193
  let id, anchor;
134
194
  try {
@@ -143,9 +203,21 @@ function render() {
143
203
  current?.tab ||
144
204
  site.tabs.find((tab) => id?.startsWith(`${tab.slug}/`))?.slug ||
145
205
  site.tabs[0].slug;
146
- renderNavigation();
206
+ const folderPath = !current && id?.startsWith(`${activeTab}/`) && id.endsWith("/")
207
+ ? id.slice(activeTab.length + 1)
208
+ : null;
209
+ const isFolder = folderPath && site.documents.some(
210
+ (doc) => doc.tab === activeTab && doc.path.startsWith(folderPath),
211
+ );
212
+ renderNavigation(isFolder ? folderPath : null);
147
213
  $("#toc").replaceChildren();
148
214
  $("#pagination").replaceChildren();
215
+ $(".toc").hidden = !current;
216
+ $("#pagination").hidden = !current;
217
+ if (isFolder) {
218
+ renderFolder(folderPath);
219
+ return;
220
+ }
149
221
  if (!current) {
150
222
  $("#article").replaceChildren(
151
223
  el(
@@ -159,16 +231,20 @@ function render() {
159
231
  "설정된 폴더에 Markdown 파일을 추가하거나 왼쪽 목록에서 문서를 선택하세요.",
160
232
  ),
161
233
  );
162
- $("#breadcrumb").textContent = site.tabs.find(
163
- (tab) => tab.slug === activeTab,
164
- ).title;
234
+ renderBreadcrumb();
165
235
  return;
166
236
  }
167
237
  document.title = `${current.title} · ${site.title}`;
168
- $("#breadcrumb").textContent =
169
- `${site.tabs.find((tab) => tab.slug === current.tab).title} / ${current.path}`;
238
+ renderBreadcrumb(current.path.split("/").slice(0, -1), {
239
+ title: current.path.split("/").at(-1).replace(/\.md$/i, ""),
240
+ id: current.id,
241
+ });
170
242
  $("#article").innerHTML = current.html;
171
243
  if (!$("#article h1")) $("#article").prepend(el("h1", current.title));
244
+ for (const heading of $("#article").querySelectorAll("h2, h3, h4, h5, h6")) {
245
+ if (/^version\s*:\s*\S+/i.test(heading.textContent.trim()))
246
+ heading.classList.add("document-version");
247
+ }
172
248
  // Existing containers with a leading heading also display the search below it.
173
249
  for (const section of document.querySelectorAll(".search-section")) {
174
250
  const heading =
@@ -197,6 +273,15 @@ function render() {
197
273
  $("#pagination").append(link);
198
274
  }
199
275
  attachTableSearches();
276
+ const diagrams = [...$("#article").querySelectorAll("pre > code")].filter(
277
+ (code) => code.classList.contains("language-mermaid") ||
278
+ (!code.className && /^\s*sequenceDiagram\b/.test(code.textContent)),
279
+ );
280
+ if (diagrams.length) {
281
+ import("./diagrams.js").then(({ renderDiagrams }) => renderDiagrams(diagrams)).catch(() => {
282
+ // Keep the original code readable if the renderer cannot be loaded.
283
+ });
284
+ }
200
285
  if (pendingQuery) {
201
286
  highlight($("#article"), pendingQuery);
202
287
  pendingQuery = "";
@@ -0,0 +1,35 @@
1
+ import mermaid from "mermaid";
2
+
3
+ mermaid.initialize({
4
+ startOnLoad: false,
5
+ securityLevel: "strict",
6
+ suppressErrorRendering: true,
7
+ theme: "default",
8
+ fontFamily: '"Noto Sans KR Variable", sans-serif',
9
+ });
10
+
11
+ let diagramId = 0;
12
+
13
+ export async function renderDiagrams(blocks) {
14
+ await document.fonts.ready;
15
+ for (const code of blocks) {
16
+ if (!code.isConnected) continue;
17
+ const source = code.textContent;
18
+ const pre = code.parentElement;
19
+ const figure = document.createElement("figure");
20
+ figure.className = "diagram";
21
+ figure.setAttribute("aria-label", "문서 다이어그램");
22
+ try {
23
+ const { svg } = await mermaid.render(`diagram-${++diagramId}`, source);
24
+ if (!pre.isConnected) continue;
25
+ figure.innerHTML = svg;
26
+ pre.replaceWith(figure);
27
+ } catch {
28
+ if (!pre.isConnected) continue;
29
+ const message = document.createElement("p");
30
+ message.className = "diagram-error";
31
+ message.textContent = "다이어그램 문법을 확인해주세요. 원본 코드를 표시합니다.";
32
+ pre.before(message);
33
+ }
34
+ }
35
+ }
@@ -0,0 +1 @@
1
+ @import "@fontsource-variable/noto-sans-kr";
package/client/index.html CHANGED
@@ -6,6 +6,7 @@
6
6
  <meta name="color-scheme" content="light" />
7
7
  <title>Doxen</title>
8
8
  <link rel="icon" type="image/svg+xml" href="./favicon.svg" />
9
+ <link rel="stylesheet" href="./fonts.css" />
9
10
  <link rel="stylesheet" href="./style.css" />
10
11
  </head>
11
12
  <body>
@@ -15,18 +16,18 @@
15
16
  ><span class="brand-icon">D</span
16
17
  ><span id="site-title">Doxen</span></a
17
18
  ><button id="open-search" class="search-trigger">
18
- <span>⌕ &nbsp; 검색...</span><kbd>⌘ / Ctrl K</kbd></button
19
+ <span class="search-label">검색...</span><kbd>⌘ / Ctrl K</kbd></button
19
20
  ><span class="header-label"></span>
20
21
  </header>
21
22
  <nav id="tabs" aria-label="문서 탭"></nav>
22
23
  <div class="layout">
23
24
  <aside class="sidebar">
24
- <div class="eyebrow">DOCUMENTATION</div>
25
+ <div class="eyebrow"></div>
25
26
  <nav id="documents" aria-label="문서 목록"></nav>
26
27
  <div class="powered">Made with <strong>Doxen</strong></div>
27
28
  </aside>
28
29
  <main id="content" tabindex="-1">
29
- <div id="breadcrumb"></div>
30
+ <nav id="breadcrumb" aria-label="문서 경로"></nav>
30
31
  <article id="article"></article>
31
32
  <nav id="pagination" aria-label="이전 다음 문서"></nav>
32
33
  </main>
package/client/style.css CHANGED
@@ -1,9 +1,9 @@
1
1
  :root {
2
2
  font-family:
3
- -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
4
- color: #26292d;
3
+ "Noto Sans KR Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
4
+ color: #242628;
5
5
  background: white;
6
- line-height: 1.7;
6
+ line-height: 1.5;
7
7
  --line: #e1e6eb;
8
8
  --muted: #818891;
9
9
  --blue: #009dff;
@@ -56,12 +56,12 @@ summary:focus-visible {
56
56
  outline-offset: 3px;
57
57
  }
58
58
  header {
59
- max-width: 1360px;
59
+ max-width: 1424px;
60
60
  margin: auto;
61
- height: 64px;
61
+ height: 68px;
62
62
  display: grid;
63
- grid-template-columns: 290px minmax(0, 768px) 224px;
64
- gap: 40px;
63
+ grid-template-columns: 288px minmax(0, 768px) 224px;
64
+ gap: 48px;
65
65
  align-items: center;
66
66
  padding: 0 24px;
67
67
  }
@@ -71,7 +71,7 @@ header {
71
71
  gap: 12px;
72
72
  color: #24272b;
73
73
  font-size: 19px;
74
- font-weight: 650;
74
+ font-weight: 600;
75
75
  }
76
76
  .brand-icon {
77
77
  display: grid;
@@ -86,20 +86,22 @@ header {
86
86
  line-height: 1;
87
87
  }
88
88
  .search-trigger {
89
- width: min(100%, 440px);
89
+ width: min(100%, 422px);
90
90
  display: flex;
91
91
  justify-content: space-between;
92
92
  align-items: center;
93
93
  border: 1px solid #d1dbe5;
94
- border-radius: 13px;
94
+ border-radius: 12px;
95
95
  padding: 8px 12px;
96
96
  box-shadow: 0 1px 3px #182b4010;
97
97
  color: #939ca6;
98
98
  text-align: left;
99
- font-size: 13px;
99
+ font-size: 14px;
100
100
  }
101
101
  kbd {
102
- font: 10px inherit;
102
+ font-family: inherit;
103
+ font-size: 11px;
104
+ line-height: 18px;
103
105
  border: 1px solid var(--line);
104
106
  border-radius: 4px;
105
107
  padding: 1px 4px;
@@ -109,13 +111,13 @@ kbd {
109
111
  display: flex;
110
112
  gap: 32px;
111
113
  height: 44px;
112
- padding: 0 max(24px, calc((100% - 1312px) / 2));
114
+ padding: 0 max(24px, calc((100% - 1376px) / 2));
113
115
  border-bottom: 1px solid #ebedf0;
114
116
  overflow: auto;
115
117
  }
116
118
  #tabs a {
117
119
  padding: 10px 0 9px;
118
- font-size: 13px;
120
+ font-size: 14px;
119
121
  color: #858b93;
120
122
  white-space: nowrap;
121
123
  border-bottom: 2px solid transparent;
@@ -126,9 +128,9 @@ kbd {
126
128
  }
127
129
  .layout {
128
130
  display: grid;
129
- grid-template-columns: 290px minmax(0, 768px) 224px;
130
- gap: 40px;
131
- max-width: 1360px;
131
+ grid-template-columns: 288px minmax(0, 768px) 224px;
132
+ gap: 48px;
133
+ max-width: 1424px;
132
134
  padding: 0 24px;
133
135
  margin: auto;
134
136
  }
@@ -140,9 +142,9 @@ kbd {
140
142
  padding: 34px 14px 30px 0;
141
143
  }
142
144
  .eyebrow {
143
- font-size: 12px;
145
+ font-size: 14px;
144
146
  color: #8a9098;
145
- margin-bottom: 18px;
147
+ margin-bottom: 12px;
146
148
  letter-spacing: 0;
147
149
  }
148
150
  .powered {
@@ -153,7 +155,7 @@ kbd {
153
155
  #documents a {
154
156
  display: block;
155
157
  padding: 6px 12px 6px 20px;
156
- font-size: 13px;
158
+ font-size: 14px;
157
159
  color: #7d8289;
158
160
  border-left: 1px solid var(--line);
159
161
  overflow-wrap: anywhere;
@@ -165,25 +167,34 @@ kbd {
165
167
  .folder-group summary {
166
168
  list-style: none;
167
169
  cursor: pointer;
168
- font-size: 13px;
170
+ font-size: 14px;
169
171
  color: #797f87;
170
- padding: 7px 14px 7px 20px;
172
+ padding: 7px 14px 7px 0;
171
173
  position: relative;
172
174
  }
173
175
  .folder-group summary::after {
174
176
  content: "›";
175
177
  position: absolute;
176
178
  right: 4px;
179
+ top: 50%;
180
+ transform: translateY(-50%);
177
181
  color: #b0b7bf;
178
182
  }
179
183
  .folder-group[open] > summary::after {
180
- transform: rotate(90deg);
184
+ transform: translateY(-50%) rotate(90deg);
181
185
  }
182
186
  .folder-group summary::-webkit-details-marker {
183
187
  display: none;
184
188
  }
189
+ #documents summary a {
190
+ padding: 0;
191
+ border: 0;
192
+ }
193
+ .folder-children > .folder-group > summary {
194
+ padding-left: 20px;
195
+ }
185
196
  .folder-children {
186
- margin-left: 20px;
197
+ margin-left: 8px;
187
198
  border-left: 1px solid var(--line);
188
199
  }
189
200
  .folder-children > a {
@@ -192,63 +203,152 @@ kbd {
192
203
  main {
193
204
  position: relative;
194
205
  min-width: 0;
195
- padding: 30px 0 64px;
206
+ padding: 26px 0 64px;
196
207
  }
197
208
  #breadcrumb {
198
- color: #46a5df;
199
- font-size: 11px;
209
+ font-size: 13px;
210
+ line-height: 20px;
200
211
  margin-bottom: 12px;
201
212
  overflow-wrap: anywhere;
202
213
  }
214
+ #breadcrumb ol {
215
+ display: flex;
216
+ flex-wrap: wrap;
217
+ align-items: center;
218
+ gap: 6px 12px;
219
+ list-style: none;
220
+ margin: 0;
221
+ padding: 0;
222
+ }
223
+ #breadcrumb li {
224
+ display: flex;
225
+ align-items: center;
226
+ gap: 12px;
227
+ min-width: 0;
228
+ }
229
+ #breadcrumb li + li::before {
230
+ content: "";
231
+ width: 5px;
232
+ height: 5px;
233
+ flex-shrink: 0;
234
+ border-top: 1px solid #8c959f;
235
+ border-right: 1px solid #8c959f;
236
+ transform: rotate(45deg);
237
+ }
238
+ #breadcrumb a {
239
+ min-width: 0;
240
+ color: #1890ff;
241
+ }
203
242
  article {
204
- font-size: 14px;
205
- line-height: 1.85;
243
+ font-size: 16px;
244
+ line-height: 1.6;
245
+ font-weight: 400;
246
+ letter-spacing: -0.2px;
206
247
  overflow-wrap: anywhere;
207
248
  }
208
249
  article h1 {
209
250
  font-size: 32px;
210
- letter-spacing: -1.1px;
251
+ letter-spacing: -0.8px;
211
252
  line-height: 1.4;
212
- margin: 10px 0 25px;
253
+ margin: 12px 0 24px;
213
254
  color: #1e2023;
214
- font-weight: 700;
255
+ font-weight: 650;
256
+ }
257
+ article strong {
258
+ font-weight: 600;
259
+ }
260
+ .folder-cards {
261
+ display: grid;
262
+ grid-template-columns: repeat(2, minmax(0, 1fr));
263
+ gap: 16px;
264
+ }
265
+ .folder-cards a {
266
+ display: flex;
267
+ align-items: center;
268
+ justify-content: space-between;
269
+ gap: 16px;
270
+ min-height: 54px;
271
+ padding: 12px 20px;
272
+ border: 1px solid var(--line);
273
+ border-radius: 5px;
274
+ color: inherit;
275
+ }
276
+ .folder-cards a::after {
277
+ content: "";
278
+ width: 7px;
279
+ height: 7px;
280
+ flex: 0 0 7px;
281
+ border-top: 1px solid #737d88;
282
+ border-right: 1px solid #737d88;
283
+ transform: rotate(45deg);
284
+ }
285
+ .folder-cards a:hover {
286
+ background: #f7f9fa;
287
+ border-color: #c6d1dc;
288
+ text-decoration: none;
289
+ }
290
+ .toc[hidden],
291
+ #pagination[hidden] {
292
+ display: none;
215
293
  }
216
294
  article h2 {
217
- font-size: 26px;
218
- letter-spacing: -0.7px;
219
- margin: 46px 0 18px;
295
+ font-size: 28px;
296
+ letter-spacing: -0.6px;
297
+ margin: 44px 0 20px;
220
298
  line-height: 1.5;
221
- font-weight: 650;
299
+ font-weight: 500;
222
300
  }
223
301
  article h3 {
224
- font-size: 19px;
225
- margin: 28px 0 14px;
302
+ font-size: 20px;
303
+ line-height: 1.5;
304
+ font-weight: 600;
305
+ margin: 28px 0 20px;
226
306
  }
227
307
  article :is(h1, h2, h3, h4, h5, h6) {
228
308
  scroll-margin-top: 24px;
229
309
  }
310
+ article .document-version {
311
+ margin: 0 0 20px;
312
+ padding: 10px 16px;
313
+ border: 1px solid var(--line);
314
+ border-radius: 12px;
315
+ background: #f7f9fa;
316
+ color: #b45309;
317
+ font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
318
+ font-size: 14px;
319
+ font-weight: 400;
320
+ line-height: 20px;
321
+ letter-spacing: 0;
322
+ }
323
+ article hr:has(+ .document-version) {
324
+ display: none;
325
+ }
230
326
  article p {
231
- color: #646c76;
327
+ color: #4b5055;
232
328
  margin: 16px 0;
233
329
  }
234
330
  article blockquote {
235
- margin: 24px 0 20px;
236
- padding: 1px 22px;
331
+ margin: 20px 0;
332
+ padding: 12px 24px;
237
333
  border-left: 2px solid #d6dfe6;
238
334
  color: #727b85;
239
335
  }
240
336
  article blockquote p {
337
+ margin: 0;
241
338
  color: #727b85;
242
339
  }
243
340
  article hr {
244
341
  border: 0;
245
342
  border-top: 1px solid var(--line);
246
- margin: 24px 0 42px;
343
+ margin: 20px 0 28px;
247
344
  }
248
345
  article ul,
249
346
  article ol {
250
347
  padding-left: 24px;
251
- color: #626b75;
348
+ color: #4b5055;
349
+ }
350
+ article li + li {
351
+ margin-top: 8px;
252
352
  }
253
353
  article pre {
254
354
  overflow: auto;
@@ -275,7 +375,7 @@ article table {
275
375
  width: 100%;
276
376
  border-collapse: separate;
277
377
  border-spacing: 0;
278
- font-size: 13px;
378
+ font-size: 14px;
279
379
  line-height: 1.6;
280
380
  margin: 12px 0 22px;
281
381
  table-layout: fixed;
@@ -283,26 +383,26 @@ article table {
283
383
  article th,
284
384
  article td {
285
385
  text-align: left;
286
- padding: 9px 12px;
287
- vertical-align: top;
386
+ padding: 8px 12px;
387
+ vertical-align: middle;
288
388
  overflow-wrap: anywhere;
289
389
  }
290
390
  article th {
291
391
  background: #f5f7f9;
292
392
  border-block: 1px solid var(--line);
293
- font-weight: 500;
393
+ font-weight: 600;
394
+ }
395
+ article td {
396
+ border-bottom: 1px solid var(--line);
397
+ color: #242628;
294
398
  }
295
399
  article th:first-child {
296
400
  border-left: 1px solid var(--line);
297
- border-radius: 9px 0 0 9px;
401
+ border-radius: 8px 0 0 8px;
298
402
  }
299
403
  article th:last-child {
300
404
  border-right: 1px solid var(--line);
301
- border-radius: 0 9px 9px 0;
302
- }
303
- article td {
304
- border-bottom: 1px solid var(--line);
305
- color: #4b5158;
405
+ border-radius: 0 8px 8px 0;
306
406
  }
307
407
  article td + td {
308
408
  border-left: 1px solid var(--line);
@@ -310,6 +410,21 @@ article td + td {
310
410
  article tr:last-child td {
311
411
  border-bottom: 0;
312
412
  }
413
+ .diagram {
414
+ margin: 24px 0;
415
+ overflow-x: auto;
416
+ text-align: center;
417
+ }
418
+ .diagram svg {
419
+ display: block;
420
+ max-width: 100%;
421
+ height: auto;
422
+ margin: auto;
423
+ }
424
+ .diagram-error {
425
+ font-size: 14px;
426
+ color: #b45309;
427
+ }
313
428
  article img {
314
429
  max-width: 100%;
315
430
  height: auto;
@@ -328,11 +443,18 @@ article img {
328
443
  position: relative;
329
444
  font-size: 11px;
330
445
  }
446
+ .search-label {
447
+ display: flex;
448
+ align-items: center;
449
+ gap: 8px;
450
+ }
451
+ .search-label::before,
331
452
  .section-tools::before {
332
- content: "⌕";
333
- font-size: 20px;
334
- line-height: 1;
335
- color: #7e8a96;
453
+ content: "";
454
+ width: 16px;
455
+ height: 16px;
456
+ flex: 0 0 16px;
457
+ background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23727b85' stroke-width='1.3'%3E%3Ccircle cx='6.8' cy='6.8' r='5.2'/%3E%3Cpath d='m10.7 10.7 3.8 3.8'/%3E%3C/svg%3E") center / contain no-repeat;
336
458
  }
337
459
  .section-tools:focus-within {
338
460
  border-color: #acd3f0;
@@ -355,7 +477,7 @@ article img {
355
477
  box-shadow: none;
356
478
  padding: 2px 3px;
357
479
  border-radius: 3px;
358
- font-size: 12px;
480
+ font-size: 14px;
359
481
  }
360
482
  .section-content > :first-child {
361
483
  margin-top: 12px;
@@ -368,12 +490,12 @@ article img {
368
490
  overflow: auto;
369
491
  }
370
492
  .toc .eyebrow {
371
- font-size: 11px;
493
+ font-size: 12px;
372
494
  }
373
495
  #toc a {
374
496
  display: block;
375
- color: #858c96;
376
- font-size: 12px;
497
+ color: #7d8289;
498
+ font-size: 14px;
377
499
  margin: 15px 0;
378
500
  line-height: 1.8;
379
501
  }
@@ -406,7 +528,7 @@ article img {
406
528
  }
407
529
  #pagination strong {
408
530
  display: block;
409
- font-size: 13px;
531
+ font-size: 14px;
410
532
  font-weight: 500;
411
533
  }
412
534
  mark {
@@ -536,8 +658,11 @@ dialog::backdrop {
536
658
  article h1 {
537
659
  font-size: 27px;
538
660
  }
661
+ .folder-cards {
662
+ grid-template-columns: minmax(0, 1fr);
663
+ }
539
664
  article h2 {
540
- font-size: 23px;
665
+ font-size: 21px;
541
666
  }
542
667
  article table {
543
668
  font-size: 12px;
@@ -546,9 +671,6 @@ dialog::backdrop {
546
671
  article th {
547
672
  padding: 8px;
548
673
  }
549
- #breadcrumb {
550
- font-size: 10px;
551
- }
552
674
  .section-tools {
553
675
  padding: 6px 9px;
554
676
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unana_dev/doxen",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Config-first Markdown documentation sites with Korean and section search",
5
5
  "type": "module",
6
6
  "bin": {
@@ -32,6 +32,7 @@
32
32
  "test:package": "node e2e/package-smoke.js"
33
33
  },
34
34
  "dependencies": {
35
+ "@fontsource-variable/noto-sans-kr": "^5.3.1",
35
36
  "@inquirer/prompts": "7.10.1",
36
37
  "chokidar": "^4.0.3",
37
38
  "esbuild": "^0.28.2",
@@ -40,6 +41,7 @@
40
41
  "jose": "^6.2.12",
41
42
  "markdown-it": "^14.1.0",
42
43
  "markdown-it-container": "^4.0.0",
44
+ "mermaid": "^12.1.0",
43
45
  "sanitize-html": "^2.17.0",
44
46
  "wrangler": "4.149.0"
45
47
  },
package/src/build.js CHANGED
@@ -12,9 +12,34 @@ import path from "node:path";
12
12
  import { fileURLToPath } from "node:url";
13
13
  import { collectSite } from "./content.js";
14
14
  import { inside } from "./config.js";
15
+ import { build as bundle } from "esbuild";
15
16
 
16
17
  const client = fileURLToPath(new URL("../client/", import.meta.url));
17
18
  const marker = ".doxen-output";
19
+ let presentationAssets;
20
+
21
+ function getPresentationAssets() {
22
+ return presentationAssets ||= bundle({
23
+ entryPoints: {
24
+ diagrams: path.join(client, "diagrams.js"),
25
+ fonts: path.join(client, "fonts.css"),
26
+ },
27
+ bundle: true,
28
+ splitting: true,
29
+ format: "esm",
30
+ platform: "browser",
31
+ target: "es2022",
32
+ minify: true,
33
+ outdir: path.join(client, "generated"),
34
+ assetNames: "fonts/[name]-[hash]",
35
+ chunkNames: "chunks/[name]-[hash]",
36
+ loader: { ".woff2": "file" },
37
+ write: false,
38
+ }).catch((error) => {
39
+ presentationAssets = undefined;
40
+ throw error;
41
+ });
42
+ }
18
43
 
19
44
  export async function siteFiles(config, dev = false) {
20
45
  const { data, assets } = await collectSite(config);
@@ -30,6 +55,10 @@ export async function siteFiles(config, dev = false) {
30
55
  );
31
56
  for (const name of ["index.html", "app.js", "style.css", "search.js"])
32
57
  files.set(`/${name}`, await readFile(path.join(client, name)));
58
+ for (const output of (await getPresentationAssets()).outputFiles) {
59
+ const name = path.relative(path.join(client, "generated"), output.path).split(path.sep).join("/");
60
+ files.set(`/${name}`, Buffer.from(output.contents));
61
+ }
33
62
  let html = files.get("/index.html").toString();
34
63
  html = html.replace(
35
64
  '<span class="brand-icon">D</span',
package/src/dev.js CHANGED
@@ -18,6 +18,7 @@ const types = {
18
18
  ".ico": "image/x-icon",
19
19
  ".svg": "image/svg+xml",
20
20
  ".pdf": "application/pdf",
21
+ ".woff2": "font/woff2",
21
22
  };
22
23
 
23
24
  export async function dev(cwd, configPath, port = 4173) {