@unana_dev/doxen 0.2.2 → 0.2.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 +2 -1
- package/client/app.js +95 -10
- package/client/diagrams.js +35 -0
- package/client/fonts.css +1 -0
- package/client/index.html +4 -3
- package/client/style.css +192 -67
- package/package.json +3 -1
- package/src/build.js +29 -0
- package/src/dev.js +1 -0
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)
|
|
117
|
-
|
|
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
|
-
|
|
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
|
-
|
|
163
|
-
(tab) => tab.slug === activeTab,
|
|
164
|
-
).title;
|
|
234
|
+
renderBreadcrumb();
|
|
165
235
|
return;
|
|
166
236
|
}
|
|
167
237
|
document.title = `${current.title} · ${site.title}`;
|
|
168
|
-
|
|
169
|
-
|
|
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
|
+
}
|
package/client/fonts.css
ADDED
|
@@ -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
|
|
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"
|
|
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
|
-
<
|
|
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",
|
|
4
|
-
color: #
|
|
3
|
+
"Noto Sans KR Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
4
|
+
color: #242628;
|
|
5
5
|
background: white;
|
|
6
|
-
line-height: 1.
|
|
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:
|
|
59
|
+
max-width: 1424px;
|
|
60
60
|
margin: auto;
|
|
61
|
-
height:
|
|
61
|
+
height: 68px;
|
|
62
62
|
display: grid;
|
|
63
|
-
grid-template-columns:
|
|
64
|
-
gap:
|
|
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:
|
|
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%,
|
|
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:
|
|
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:
|
|
99
|
+
font-size: 14px;
|
|
100
100
|
}
|
|
101
101
|
kbd {
|
|
102
|
-
font:
|
|
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% -
|
|
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:
|
|
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:
|
|
130
|
-
gap:
|
|
131
|
-
max-width:
|
|
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:
|
|
145
|
+
font-size: 14px;
|
|
144
146
|
color: #8a9098;
|
|
145
|
-
margin-bottom:
|
|
147
|
+
margin-bottom: 12px;
|
|
146
148
|
letter-spacing: 0;
|
|
147
149
|
}
|
|
148
150
|
.powered {
|
|
@@ -152,8 +154,8 @@ kbd {
|
|
|
152
154
|
}
|
|
153
155
|
#documents a {
|
|
154
156
|
display: block;
|
|
155
|
-
padding: 6px 12px 6px
|
|
156
|
-
font-size:
|
|
157
|
+
padding: 6px 12px 6px 23px;
|
|
158
|
+
font-size: 14px;
|
|
157
159
|
color: #7d8289;
|
|
158
160
|
border-left: 1px solid var(--line);
|
|
159
161
|
overflow-wrap: anywhere;
|
|
@@ -165,90 +167,191 @@ kbd {
|
|
|
165
167
|
.folder-group summary {
|
|
166
168
|
list-style: none;
|
|
167
169
|
cursor: pointer;
|
|
168
|
-
font-size:
|
|
170
|
+
font-size: 14px;
|
|
169
171
|
color: #797f87;
|
|
170
|
-
padding: 7px 14px 7px
|
|
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: 23px;
|
|
195
|
+
}
|
|
185
196
|
.folder-children {
|
|
186
|
-
margin-left:
|
|
197
|
+
margin-left: 8px;
|
|
187
198
|
border-left: 1px solid var(--line);
|
|
188
199
|
}
|
|
200
|
+
.folder-children > .folder-group > .folder-children {
|
|
201
|
+
margin-left: 23px;
|
|
202
|
+
}
|
|
189
203
|
.folder-children > a {
|
|
190
204
|
margin-left: -1px;
|
|
191
205
|
}
|
|
192
206
|
main {
|
|
193
207
|
position: relative;
|
|
194
208
|
min-width: 0;
|
|
195
|
-
padding:
|
|
209
|
+
padding: 26px 0 64px;
|
|
196
210
|
}
|
|
197
211
|
#breadcrumb {
|
|
198
|
-
|
|
199
|
-
|
|
212
|
+
font-size: 13px;
|
|
213
|
+
line-height: 20px;
|
|
200
214
|
margin-bottom: 12px;
|
|
201
215
|
overflow-wrap: anywhere;
|
|
202
216
|
}
|
|
217
|
+
#breadcrumb ol {
|
|
218
|
+
display: flex;
|
|
219
|
+
flex-wrap: wrap;
|
|
220
|
+
align-items: center;
|
|
221
|
+
gap: 6px 12px;
|
|
222
|
+
list-style: none;
|
|
223
|
+
margin: 0;
|
|
224
|
+
padding: 0;
|
|
225
|
+
}
|
|
226
|
+
#breadcrumb li {
|
|
227
|
+
display: flex;
|
|
228
|
+
align-items: center;
|
|
229
|
+
gap: 12px;
|
|
230
|
+
min-width: 0;
|
|
231
|
+
}
|
|
232
|
+
#breadcrumb li + li::before {
|
|
233
|
+
content: "";
|
|
234
|
+
width: 5px;
|
|
235
|
+
height: 5px;
|
|
236
|
+
flex-shrink: 0;
|
|
237
|
+
border-top: 1px solid #8c959f;
|
|
238
|
+
border-right: 1px solid #8c959f;
|
|
239
|
+
transform: rotate(45deg);
|
|
240
|
+
}
|
|
241
|
+
#breadcrumb a {
|
|
242
|
+
min-width: 0;
|
|
243
|
+
color: #1890ff;
|
|
244
|
+
}
|
|
203
245
|
article {
|
|
204
|
-
font-size:
|
|
205
|
-
line-height: 1.
|
|
246
|
+
font-size: 16px;
|
|
247
|
+
line-height: 1.6;
|
|
248
|
+
font-weight: 400;
|
|
249
|
+
letter-spacing: -0.2px;
|
|
206
250
|
overflow-wrap: anywhere;
|
|
207
251
|
}
|
|
208
252
|
article h1 {
|
|
209
253
|
font-size: 32px;
|
|
210
|
-
letter-spacing: -
|
|
254
|
+
letter-spacing: -0.8px;
|
|
211
255
|
line-height: 1.4;
|
|
212
|
-
margin:
|
|
256
|
+
margin: 12px 0 24px;
|
|
213
257
|
color: #1e2023;
|
|
214
|
-
font-weight:
|
|
258
|
+
font-weight: 650;
|
|
259
|
+
}
|
|
260
|
+
article strong {
|
|
261
|
+
font-weight: 600;
|
|
262
|
+
}
|
|
263
|
+
.folder-cards {
|
|
264
|
+
display: grid;
|
|
265
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
266
|
+
gap: 16px;
|
|
267
|
+
}
|
|
268
|
+
.folder-cards a {
|
|
269
|
+
display: flex;
|
|
270
|
+
align-items: center;
|
|
271
|
+
justify-content: space-between;
|
|
272
|
+
gap: 16px;
|
|
273
|
+
min-height: 54px;
|
|
274
|
+
padding: 12px 20px;
|
|
275
|
+
border: 1px solid var(--line);
|
|
276
|
+
border-radius: 5px;
|
|
277
|
+
color: inherit;
|
|
278
|
+
}
|
|
279
|
+
.folder-cards a::after {
|
|
280
|
+
content: "";
|
|
281
|
+
width: 7px;
|
|
282
|
+
height: 7px;
|
|
283
|
+
flex: 0 0 7px;
|
|
284
|
+
border-top: 1px solid #737d88;
|
|
285
|
+
border-right: 1px solid #737d88;
|
|
286
|
+
transform: rotate(45deg);
|
|
287
|
+
}
|
|
288
|
+
.folder-cards a:hover {
|
|
289
|
+
background: #f7f9fa;
|
|
290
|
+
border-color: #c6d1dc;
|
|
291
|
+
text-decoration: none;
|
|
292
|
+
}
|
|
293
|
+
.toc[hidden],
|
|
294
|
+
#pagination[hidden] {
|
|
295
|
+
display: none;
|
|
215
296
|
}
|
|
216
297
|
article h2 {
|
|
217
|
-
font-size:
|
|
218
|
-
letter-spacing: -0.
|
|
219
|
-
margin:
|
|
298
|
+
font-size: 28px;
|
|
299
|
+
letter-spacing: -0.6px;
|
|
300
|
+
margin: 44px 0 20px;
|
|
220
301
|
line-height: 1.5;
|
|
221
|
-
font-weight:
|
|
302
|
+
font-weight: 500;
|
|
222
303
|
}
|
|
223
304
|
article h3 {
|
|
224
|
-
font-size:
|
|
225
|
-
|
|
305
|
+
font-size: 20px;
|
|
306
|
+
line-height: 1.5;
|
|
307
|
+
font-weight: 600;
|
|
308
|
+
margin: 28px 0 20px;
|
|
226
309
|
}
|
|
227
310
|
article :is(h1, h2, h3, h4, h5, h6) {
|
|
228
311
|
scroll-margin-top: 24px;
|
|
229
312
|
}
|
|
313
|
+
article .document-version {
|
|
314
|
+
margin: 0 0 20px;
|
|
315
|
+
padding: 10px 16px;
|
|
316
|
+
border: 1px solid var(--line);
|
|
317
|
+
border-radius: 12px;
|
|
318
|
+
background: #f7f9fa;
|
|
319
|
+
color: #b45309;
|
|
320
|
+
font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
|
|
321
|
+
font-size: 14px;
|
|
322
|
+
font-weight: 400;
|
|
323
|
+
line-height: 20px;
|
|
324
|
+
letter-spacing: 0;
|
|
325
|
+
}
|
|
326
|
+
article hr:has(+ .document-version) {
|
|
327
|
+
display: none;
|
|
328
|
+
}
|
|
230
329
|
article p {
|
|
231
|
-
color: #
|
|
330
|
+
color: #4b5055;
|
|
232
331
|
margin: 16px 0;
|
|
233
332
|
}
|
|
234
333
|
article blockquote {
|
|
235
|
-
margin:
|
|
236
|
-
padding:
|
|
334
|
+
margin: 20px 0;
|
|
335
|
+
padding: 12px 24px;
|
|
237
336
|
border-left: 2px solid #d6dfe6;
|
|
238
337
|
color: #727b85;
|
|
239
338
|
}
|
|
240
339
|
article blockquote p {
|
|
340
|
+
margin: 0;
|
|
241
341
|
color: #727b85;
|
|
242
342
|
}
|
|
243
343
|
article hr {
|
|
244
344
|
border: 0;
|
|
245
345
|
border-top: 1px solid var(--line);
|
|
246
|
-
margin:
|
|
346
|
+
margin: 20px 0 28px;
|
|
247
347
|
}
|
|
248
348
|
article ul,
|
|
249
349
|
article ol {
|
|
250
350
|
padding-left: 24px;
|
|
251
|
-
color: #
|
|
351
|
+
color: #4b5055;
|
|
352
|
+
}
|
|
353
|
+
article li + li {
|
|
354
|
+
margin-top: 8px;
|
|
252
355
|
}
|
|
253
356
|
article pre {
|
|
254
357
|
overflow: auto;
|
|
@@ -275,7 +378,7 @@ article table {
|
|
|
275
378
|
width: 100%;
|
|
276
379
|
border-collapse: separate;
|
|
277
380
|
border-spacing: 0;
|
|
278
|
-
font-size:
|
|
381
|
+
font-size: 14px;
|
|
279
382
|
line-height: 1.6;
|
|
280
383
|
margin: 12px 0 22px;
|
|
281
384
|
table-layout: fixed;
|
|
@@ -283,26 +386,26 @@ article table {
|
|
|
283
386
|
article th,
|
|
284
387
|
article td {
|
|
285
388
|
text-align: left;
|
|
286
|
-
padding:
|
|
287
|
-
vertical-align:
|
|
389
|
+
padding: 8px 12px;
|
|
390
|
+
vertical-align: middle;
|
|
288
391
|
overflow-wrap: anywhere;
|
|
289
392
|
}
|
|
290
393
|
article th {
|
|
291
394
|
background: #f5f7f9;
|
|
292
395
|
border-block: 1px solid var(--line);
|
|
293
|
-
font-weight:
|
|
396
|
+
font-weight: 600;
|
|
397
|
+
}
|
|
398
|
+
article td {
|
|
399
|
+
border-bottom: 1px solid var(--line);
|
|
400
|
+
color: #242628;
|
|
294
401
|
}
|
|
295
402
|
article th:first-child {
|
|
296
403
|
border-left: 1px solid var(--line);
|
|
297
|
-
border-radius:
|
|
404
|
+
border-radius: 8px 0 0 8px;
|
|
298
405
|
}
|
|
299
406
|
article th:last-child {
|
|
300
407
|
border-right: 1px solid var(--line);
|
|
301
|
-
border-radius: 0
|
|
302
|
-
}
|
|
303
|
-
article td {
|
|
304
|
-
border-bottom: 1px solid var(--line);
|
|
305
|
-
color: #4b5158;
|
|
408
|
+
border-radius: 0 8px 8px 0;
|
|
306
409
|
}
|
|
307
410
|
article td + td {
|
|
308
411
|
border-left: 1px solid var(--line);
|
|
@@ -310,6 +413,21 @@ article td + td {
|
|
|
310
413
|
article tr:last-child td {
|
|
311
414
|
border-bottom: 0;
|
|
312
415
|
}
|
|
416
|
+
.diagram {
|
|
417
|
+
margin: 24px 0;
|
|
418
|
+
overflow-x: auto;
|
|
419
|
+
text-align: center;
|
|
420
|
+
}
|
|
421
|
+
.diagram svg {
|
|
422
|
+
display: block;
|
|
423
|
+
max-width: 100%;
|
|
424
|
+
height: auto;
|
|
425
|
+
margin: auto;
|
|
426
|
+
}
|
|
427
|
+
.diagram-error {
|
|
428
|
+
font-size: 14px;
|
|
429
|
+
color: #b45309;
|
|
430
|
+
}
|
|
313
431
|
article img {
|
|
314
432
|
max-width: 100%;
|
|
315
433
|
height: auto;
|
|
@@ -328,11 +446,18 @@ article img {
|
|
|
328
446
|
position: relative;
|
|
329
447
|
font-size: 11px;
|
|
330
448
|
}
|
|
449
|
+
.search-label {
|
|
450
|
+
display: flex;
|
|
451
|
+
align-items: center;
|
|
452
|
+
gap: 8px;
|
|
453
|
+
}
|
|
454
|
+
.search-label::before,
|
|
331
455
|
.section-tools::before {
|
|
332
|
-
content: "
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
456
|
+
content: "";
|
|
457
|
+
width: 16px;
|
|
458
|
+
height: 16px;
|
|
459
|
+
flex: 0 0 16px;
|
|
460
|
+
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
461
|
}
|
|
337
462
|
.section-tools:focus-within {
|
|
338
463
|
border-color: #acd3f0;
|
|
@@ -355,7 +480,7 @@ article img {
|
|
|
355
480
|
box-shadow: none;
|
|
356
481
|
padding: 2px 3px;
|
|
357
482
|
border-radius: 3px;
|
|
358
|
-
font-size:
|
|
483
|
+
font-size: 14px;
|
|
359
484
|
}
|
|
360
485
|
.section-content > :first-child {
|
|
361
486
|
margin-top: 12px;
|
|
@@ -368,12 +493,12 @@ article img {
|
|
|
368
493
|
overflow: auto;
|
|
369
494
|
}
|
|
370
495
|
.toc .eyebrow {
|
|
371
|
-
font-size:
|
|
496
|
+
font-size: 12px;
|
|
372
497
|
}
|
|
373
498
|
#toc a {
|
|
374
499
|
display: block;
|
|
375
|
-
color: #
|
|
376
|
-
font-size:
|
|
500
|
+
color: #7d8289;
|
|
501
|
+
font-size: 14px;
|
|
377
502
|
margin: 15px 0;
|
|
378
503
|
line-height: 1.8;
|
|
379
504
|
}
|
|
@@ -406,7 +531,7 @@ article img {
|
|
|
406
531
|
}
|
|
407
532
|
#pagination strong {
|
|
408
533
|
display: block;
|
|
409
|
-
font-size:
|
|
534
|
+
font-size: 14px;
|
|
410
535
|
font-weight: 500;
|
|
411
536
|
}
|
|
412
537
|
mark {
|
|
@@ -536,8 +661,11 @@ dialog::backdrop {
|
|
|
536
661
|
article h1 {
|
|
537
662
|
font-size: 27px;
|
|
538
663
|
}
|
|
664
|
+
.folder-cards {
|
|
665
|
+
grid-template-columns: minmax(0, 1fr);
|
|
666
|
+
}
|
|
539
667
|
article h2 {
|
|
540
|
-
font-size:
|
|
668
|
+
font-size: 21px;
|
|
541
669
|
}
|
|
542
670
|
article table {
|
|
543
671
|
font-size: 12px;
|
|
@@ -546,9 +674,6 @@ dialog::backdrop {
|
|
|
546
674
|
article th {
|
|
547
675
|
padding: 8px;
|
|
548
676
|
}
|
|
549
|
-
#breadcrumb {
|
|
550
|
-
font-size: 10px;
|
|
551
|
-
}
|
|
552
677
|
.section-tools {
|
|
553
678
|
padding: 6px 9px;
|
|
554
679
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unana_dev/doxen",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
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',
|