hyperbook 0.76.2 → 0.77.1
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/dist/assets/content.css +23 -8
- package/dist/assets/dark.css +13 -0
- package/dist/assets/directive-alert/style.css +14 -11
- package/dist/assets/directive-archive/style.css +0 -1
- package/dist/assets/directive-audio/style.css +0 -4
- package/dist/assets/directive-collapsible/style.css +3 -3
- package/dist/assets/directive-download/style.css +0 -1
- package/dist/assets/directive-embed/style.css +0 -1
- package/dist/assets/directive-excalidraw/style.css +0 -1
- package/dist/assets/directive-h5p/style.css +0 -4
- package/dist/assets/directive-jsxgraph/style.css +1 -2
- package/dist/assets/directive-onlineide/style.css +0 -1
- package/dist/assets/directive-p5/style.css +0 -1
- package/dist/assets/directive-pyide/style.css +0 -1
- package/dist/assets/directive-qr/style.css +0 -1
- package/dist/assets/directive-slideshow/style.css +0 -1
- package/dist/assets/directive-sqlide/style.css +0 -1
- package/dist/assets/directive-struktog/style.css +0 -2
- package/dist/assets/directive-tabs/style.css +1 -1
- package/dist/assets/directive-tiles/style.css +2 -0
- package/dist/assets/directive-typst/style.css +0 -1
- package/dist/assets/directive-video/style.css +0 -4
- package/dist/assets/directive-webide/style.css +0 -1
- package/dist/assets/shell.css +50 -6
- package/dist/index.js +249 -13
- package/dist/locales/de.json +2 -0
- package/dist/locales/en.json +2 -0
- package/package.json +5 -5
package/dist/assets/content.css
CHANGED
|
@@ -100,8 +100,8 @@ figure {
|
|
|
100
100
|
clear: both;
|
|
101
101
|
justify-items: center;
|
|
102
102
|
align-content: center;
|
|
103
|
-
margin-top:
|
|
104
|
-
margin-bottom:
|
|
103
|
+
margin-top: 0;
|
|
104
|
+
margin-bottom: var(--element-gap);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
.hyperbook-markdown figure.normal img {
|
|
@@ -177,7 +177,7 @@ figure {
|
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
.hyperbook-markdown li>p {
|
|
180
|
-
margin
|
|
180
|
+
margin: 0;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
.hyperbook-markdown p,
|
|
@@ -188,12 +188,23 @@ figure {
|
|
|
188
188
|
.hyperbook-markdown pre,
|
|
189
189
|
.hyperbook-markdown details {
|
|
190
190
|
margin-top: 0;
|
|
191
|
-
margin-bottom:
|
|
191
|
+
margin-bottom: var(--element-gap);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.hyperbook-markdown figure[data-rehype-pretty-code-figure] {
|
|
195
|
+
margin-top: 0;
|
|
196
|
+
margin-bottom: var(--element-gap);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.hyperbook-markdown [class^="directive-"],
|
|
200
|
+
.hyperbook-markdown [class*=" directive-"] {
|
|
201
|
+
margin-top: 0;
|
|
202
|
+
margin-bottom: var(--element-gap);
|
|
192
203
|
}
|
|
193
204
|
|
|
194
205
|
.hyperbook-markdown blockquote {
|
|
195
206
|
width: 90%;
|
|
196
|
-
margin:
|
|
207
|
+
margin: 0 auto var(--element-gap) auto;
|
|
197
208
|
font-style: italic;
|
|
198
209
|
padding: 1.2em 30px 1.2em 75px;
|
|
199
210
|
border-left: 8px solid var(--color-brand);
|
|
@@ -215,6 +226,10 @@ figure {
|
|
|
215
226
|
content: "";
|
|
216
227
|
}
|
|
217
228
|
|
|
229
|
+
.hyperbook-markdown blockquote p:last-child {
|
|
230
|
+
margin-bottom: 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
218
233
|
.hyperbook-markdown table {
|
|
219
234
|
display: block;
|
|
220
235
|
border-collapse: collapse;
|
|
@@ -252,8 +267,8 @@ figure {
|
|
|
252
267
|
.hyperbook-markdown h6 {
|
|
253
268
|
clear: both;
|
|
254
269
|
font-family: hyperbook-heading, sans-serif;
|
|
255
|
-
margin-top:
|
|
256
|
-
margin-bottom:
|
|
270
|
+
margin-top: 0;
|
|
271
|
+
margin-bottom: var(--element-gap);
|
|
257
272
|
font-weight: 600;
|
|
258
273
|
line-height: 1.25;
|
|
259
274
|
}
|
|
@@ -293,7 +308,7 @@ figure {
|
|
|
293
308
|
|
|
294
309
|
.hyperbook-markdown p {
|
|
295
310
|
margin-top: 0;
|
|
296
|
-
margin-bottom:
|
|
311
|
+
margin-bottom: var(--element-gap);
|
|
297
312
|
}
|
|
298
313
|
|
|
299
314
|
.hyperbook-markdown h1,
|
package/dist/assets/dark.css
CHANGED
|
@@ -24,6 +24,18 @@ header {
|
|
|
24
24
|
background-color: var(--color-brand) !important;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
nav.breadcrumb {
|
|
28
|
+
color: color-mix(in srgb, var(--color-text), black 35%) !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
nav.breadcrumb a {
|
|
32
|
+
color: color-mix(in srgb, var(--color-text), black 35%) !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
nav.breadcrumb a:hover {
|
|
36
|
+
color: var(--color-brand) !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
27
39
|
figure[data-rehype-pretty-code-figure] pre,
|
|
28
40
|
code[data-theme*=" "],
|
|
29
41
|
code[data-theme*=" "] span {
|
|
@@ -63,3 +75,4 @@ color: rgb(253, 224, 71) !important;
|
|
|
63
75
|
background-color: #6b21a880 !important;
|
|
64
76
|
color: rgb(233, 213, 255) !important;
|
|
65
77
|
}
|
|
78
|
+
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.directive-alert>p {
|
|
7
|
-
margin-bottom:
|
|
7
|
+
margin-bottom: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.directive-alert>p:last-child {
|
|
11
|
+
margin-bottom: 0;
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
.directive-alert {
|
|
@@ -14,17 +18,16 @@
|
|
|
14
18
|
font-size: inherit;
|
|
15
19
|
line-height: 1.6rem;
|
|
16
20
|
word-spacing: 0.05rem;
|
|
17
|
-
border-bottom-right-radius:
|
|
18
|
-
border-top-right-radius:
|
|
19
|
-
padding:
|
|
20
|
-
margin-bottom: 16px;
|
|
21
|
+
border-bottom-right-radius: 0.16rem;
|
|
22
|
+
border-top-right-radius: 0.16rem;
|
|
23
|
+
padding: 0.5rem 0.7rem 0.5rem 1.2rem;
|
|
21
24
|
position: relative;
|
|
22
|
-
border-left-width:
|
|
25
|
+
border-left-width: 0.25rem;
|
|
23
26
|
border-left-style: solid;
|
|
24
27
|
background-color: var(--color-nav);
|
|
25
28
|
border-left-color: var(--alert-color);
|
|
26
29
|
border-left-style: solid;
|
|
27
|
-
border-left-width:
|
|
30
|
+
border-left-width: 0.25rem;
|
|
28
31
|
|
|
29
32
|
a,
|
|
30
33
|
strong {
|
|
@@ -44,14 +47,14 @@
|
|
|
44
47
|
border-radius: 100%;
|
|
45
48
|
font-size: 0.875rem;
|
|
46
49
|
font-weight: 700;
|
|
47
|
-
left: -
|
|
50
|
+
left: -0.9rem;
|
|
48
51
|
display: flex;
|
|
49
52
|
align-items: center;
|
|
50
53
|
justify-content: center;
|
|
51
54
|
position: absolute;
|
|
52
|
-
height:
|
|
53
|
-
width:
|
|
54
|
-
top:
|
|
55
|
+
height: 1.5rem;
|
|
56
|
+
width: 1.5rem;
|
|
57
|
+
top: 0.5rem;
|
|
55
58
|
color: #fff;
|
|
56
59
|
content: var(--alert-content);
|
|
57
60
|
background-color: var(--alert-color);
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
font-size: 100%;
|
|
13
13
|
padding: 8px 16px;
|
|
14
14
|
border-radius: 4px;
|
|
15
|
-
margin-bottom:
|
|
15
|
+
margin-bottom: 0;
|
|
16
16
|
list-style: none;
|
|
17
17
|
color: var(--color-text);
|
|
18
18
|
border-color: var(--color-spacer);
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
|
|
50
50
|
.directive-collapsible .content {
|
|
51
51
|
border-top: none;
|
|
52
|
-
margin-bottom:
|
|
52
|
+
margin-bottom: 0;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.directive-collapsible[open] .content {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
border-top: none;
|
|
60
60
|
padding: 6px 12px;
|
|
61
61
|
padding-top: 12px;
|
|
62
|
-
margin-bottom:
|
|
62
|
+
margin-bottom: 0;
|
|
63
63
|
border-bottom-left-radius: 4px;
|
|
64
64
|
border-bottom-right-radius: 4px;
|
|
65
65
|
border-color: var(--color-spacer);
|
package/dist/assets/shell.css
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
.main-grid * {
|
|
6
6
|
box-sizing: border-box;
|
|
7
|
-
line-height: 1.
|
|
7
|
+
line-height: 1.5rem;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.main-grid {
|
|
@@ -356,11 +356,51 @@ main {
|
|
|
356
356
|
overflow-y: auto;
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
+
/* Breadcrumb Navigation */
|
|
360
|
+
nav.breadcrumb {
|
|
361
|
+
max-width: var(--main-width);
|
|
362
|
+
color: color-mix(in srgb, var(--color-text), white 35%);
|
|
363
|
+
margin: 0 auto;
|
|
364
|
+
margin-bottom: var(--element-gap);
|
|
365
|
+
display: flex;
|
|
366
|
+
flex-wrap: wrap;
|
|
367
|
+
align-items: center;
|
|
368
|
+
gap: 0.25rem;
|
|
369
|
+
font-size: 0.9rem;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
nav.breadcrumb a {
|
|
373
|
+
color: color-mix(in srgb, var(--color-text), white 35%);
|
|
374
|
+
text-decoration: none;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
nav.breadcrumb a:hover {
|
|
378
|
+
color: var(--color-brand);
|
|
379
|
+
text-decoration: underline;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
nav.breadcrumb .breadcrumb-separator {
|
|
383
|
+
margin: 0 4px;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
nav.breadcrumb .breadcrumb-empty {
|
|
387
|
+
font-style: italic;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
nav.breadcrumb .breadcrumb-current {
|
|
391
|
+
font-weight: 500;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
nav.breadcrumb .breadcrumb-home,
|
|
395
|
+
nav.breadcrumb .breadcrumb-current {
|
|
396
|
+
text-decoration: none;
|
|
397
|
+
}
|
|
398
|
+
|
|
359
399
|
article {
|
|
360
400
|
max-width: var(--main-width);
|
|
361
401
|
margin: 0 auto;
|
|
362
402
|
grid-area: article;
|
|
363
|
-
line-height: 1.
|
|
403
|
+
line-height: 1.5rem;
|
|
364
404
|
}
|
|
365
405
|
|
|
366
406
|
header {
|
|
@@ -544,10 +584,10 @@ header {
|
|
|
544
584
|
display: flex;
|
|
545
585
|
align-items: center;
|
|
546
586
|
justify-content: center;
|
|
547
|
-
margin-right:
|
|
548
|
-
height:
|
|
587
|
+
margin-right: 0.625rem;
|
|
588
|
+
height: 2.5rem;
|
|
549
589
|
width: auto;
|
|
550
|
-
min-width:
|
|
590
|
+
min-width: 2.5rem;
|
|
551
591
|
}
|
|
552
592
|
|
|
553
593
|
.branding .logo img {
|
|
@@ -565,7 +605,7 @@ header {
|
|
|
565
605
|
display: flex;
|
|
566
606
|
max-width: var(--main-width);
|
|
567
607
|
margin: 0 auto;
|
|
568
|
-
margin-top:
|
|
608
|
+
margin-top: 2.5rem;
|
|
569
609
|
clear: both;
|
|
570
610
|
}
|
|
571
611
|
|
|
@@ -899,3 +939,7 @@ nav.toc li.level-3 {
|
|
|
899
939
|
.main-grid.layout-standalone #custom-links-footer {
|
|
900
940
|
display: none;
|
|
901
941
|
}
|
|
942
|
+
|
|
943
|
+
.main-grid.layout-standalone .breadcrumb {
|
|
944
|
+
display: none;
|
|
945
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -56005,6 +56005,7 @@ const fs_2 = __importDefault(__nccwpck_require__(79896));
|
|
|
56005
56005
|
const mime_1 = __importDefault(__nccwpck_require__(94931));
|
|
56006
56006
|
const ws_1 = __nccwpck_require__(55999);
|
|
56007
56007
|
const chalk_1 = __importDefault(__nccwpck_require__(2434));
|
|
56008
|
+
const rimraf_1 = __nccwpck_require__(52114);
|
|
56008
56009
|
async function runDev({ port = 8080 }) {
|
|
56009
56010
|
const root = process.cwd();
|
|
56010
56011
|
const rootProject = await fs_1.hyperproject.get(root);
|
|
@@ -56113,12 +56114,18 @@ window.onload = () => {
|
|
|
56113
56114
|
});
|
|
56114
56115
|
});
|
|
56115
56116
|
let rebuilding = false;
|
|
56116
|
-
const rebuild = (status) => async (file) => {
|
|
56117
|
+
const rebuild = (status, shouldClean = false) => async (file) => {
|
|
56117
56118
|
if (!rebuilding) {
|
|
56118
56119
|
console.log(`${chalk_1.default.yellow(`[Rebuilding ${status}]`)}: ${file}.`);
|
|
56119
56120
|
rebuilding = true;
|
|
56120
56121
|
try {
|
|
56121
56122
|
const rootProject = await fs_1.hyperproject.get(process.cwd());
|
|
56123
|
+
// Clean output folder when files are deleted or renamed to avoid stale files
|
|
56124
|
+
if (shouldClean) {
|
|
56125
|
+
const cleanOutDir = path_1.default.join(rootProject.src, ".hyperbook", "out");
|
|
56126
|
+
console.log(`${chalk_1.default.yellow(`[Cleaning]`)}: ${cleanOutDir}`);
|
|
56127
|
+
await (0, rimraf_1.rimraf)(cleanOutDir);
|
|
56128
|
+
}
|
|
56122
56129
|
await (0, build_1.runBuildProject)(rootProject, rootProject);
|
|
56123
56130
|
console.log(`${chalk_1.default.yellow(`[Reloading]`)}: Website`);
|
|
56124
56131
|
reloadServer.emit("reload");
|
|
@@ -56151,7 +56158,7 @@ window.onload = () => {
|
|
|
56151
56158
|
})
|
|
56152
56159
|
.on("add", rebuild("(Added)"))
|
|
56153
56160
|
.on("change", rebuild("(Changed)"))
|
|
56154
|
-
.on("unlink", rebuild("(Deleted)"));
|
|
56161
|
+
.on("unlink", rebuild("(Deleted)", true));
|
|
56155
56162
|
}
|
|
56156
56163
|
|
|
56157
56164
|
|
|
@@ -93398,7 +93405,7 @@ var getNavigationForFile = async (pageList, currentFile) => {
|
|
|
93398
93405
|
current = pageList[i] || null;
|
|
93399
93406
|
const allPages = pageList;
|
|
93400
93407
|
const filteredPageList = pageList.filter(
|
|
93401
|
-
(p) => (!p.isEmpty || p.href === currentFile.path.href) && !p.hide
|
|
93408
|
+
(p) => (!p.isEmpty || p.href === currentFile.path.href) && !p.hide && p.navigation !== "hidden"
|
|
93402
93409
|
);
|
|
93403
93410
|
i = filteredPageList.findIndex((p) => p.href === currentFile.path.href);
|
|
93404
93411
|
const resolveLink = (link) => {
|
|
@@ -93484,8 +93491,10 @@ var getPagesAndSections = async (root) => {
|
|
|
93484
93491
|
if (!data.name) {
|
|
93485
93492
|
data.name = data.title || file.name;
|
|
93486
93493
|
}
|
|
93494
|
+
const pageNavigation = data.navigation === "default" || data.navigation === "hidden" ? data.navigation : void 0;
|
|
93487
93495
|
const page = {
|
|
93488
93496
|
...data,
|
|
93497
|
+
navigation: pageNavigation,
|
|
93489
93498
|
path: file.path
|
|
93490
93499
|
};
|
|
93491
93500
|
const repo = makeRepoLink(hyperbook.repo, file);
|
|
@@ -178151,6 +178160,8 @@ var en_default = {
|
|
|
178151
178160
|
"shell-reset-hyperbook": "Reset Hyperbook",
|
|
178152
178161
|
"shell-import-hyperbook": "Import Hyperbook from a file",
|
|
178153
178162
|
"shell-export-hyperbook": "Export Hyperbook to a file",
|
|
178163
|
+
"breadcrumb-navigation": "Breadcrumb",
|
|
178164
|
+
"breadcrumb-home": "Home",
|
|
178154
178165
|
"qr-code": "QR Code",
|
|
178155
178166
|
"p5-update": "Update",
|
|
178156
178167
|
"p5-code-preview": "Code Preview",
|
|
@@ -178230,6 +178241,8 @@ var de_default = {
|
|
|
178230
178241
|
"shell-reset-hyperbook": "Das Hyperbook zur\xFCcksetzen",
|
|
178231
178242
|
"shell-import-hyperbook": "Das Hyperbook aus einer Datei importieren",
|
|
178232
178243
|
"shell-export-hyperbook": "Das Hyperbook in eine Datei exportieren",
|
|
178244
|
+
"breadcrumb-navigation": "Brotkr\xFCmelnavigation",
|
|
178245
|
+
"breadcrumb-home": "Startseite",
|
|
178233
178246
|
"qr-code": "QR-Code",
|
|
178234
178247
|
"p5-update": "Aktualisieren",
|
|
178235
178248
|
"p5-code-preview": "Code-Vorschau",
|
|
@@ -179158,9 +179171,10 @@ body::-webkit-scrollbar {
|
|
|
179158
179171
|
--color-brand-dark: ${colors?.brandDark || colors?.brand || "#b5e3d8"};
|
|
179159
179172
|
--color-brand-text: ${colors?.brandText || "white"};
|
|
179160
179173
|
--main-width: 980px;
|
|
179161
|
-
--header-height:
|
|
179174
|
+
--header-height: 3.75rem;
|
|
179162
179175
|
--nav-width: minmax(300px, 0.33fr);
|
|
179163
179176
|
--nav-font-size: 0.9rem;
|
|
179177
|
+
--element-gap: 1.5rem;
|
|
179164
179178
|
}`;
|
|
179165
179179
|
if (font) {
|
|
179166
179180
|
rootCss += `
|
|
@@ -179720,6 +179734,154 @@ HYPERBOOK_ASSETS = "${makeUrl("/", "assets")}"
|
|
|
179720
179734
|
};
|
|
179721
179735
|
|
|
179722
179736
|
// src/rehypeShell.ts
|
|
179737
|
+
var resolveEmoji = (text9) => {
|
|
179738
|
+
return text9.replace(/:([+\w-]+):/g, (_, name) => {
|
|
179739
|
+
return github_emojis_default[name] ?? `:${name}:`;
|
|
179740
|
+
});
|
|
179741
|
+
};
|
|
179742
|
+
var buildBreadcrumbPath = (ctx) => {
|
|
179743
|
+
const currentHref = ctx.navigation.current?.href;
|
|
179744
|
+
if (!currentHref) return [];
|
|
179745
|
+
const path9 = [];
|
|
179746
|
+
const findPath = (sections, pages, currentPath) => {
|
|
179747
|
+
for (const page of pages) {
|
|
179748
|
+
if (page.href === currentHref) {
|
|
179749
|
+
return [...currentPath, {
|
|
179750
|
+
name: page.name,
|
|
179751
|
+
href: page.href || null,
|
|
179752
|
+
isEmpty: page.isEmpty || false,
|
|
179753
|
+
hide: page.hide
|
|
179754
|
+
}];
|
|
179755
|
+
}
|
|
179756
|
+
}
|
|
179757
|
+
for (const section of sections) {
|
|
179758
|
+
const sectionItem = {
|
|
179759
|
+
name: section.name,
|
|
179760
|
+
href: section.href || null,
|
|
179761
|
+
isEmpty: section.isEmpty || false,
|
|
179762
|
+
hide: section.hide
|
|
179763
|
+
};
|
|
179764
|
+
if (section.href === currentHref) {
|
|
179765
|
+
return [...currentPath, sectionItem];
|
|
179766
|
+
}
|
|
179767
|
+
const result2 = findPath(
|
|
179768
|
+
section.sections,
|
|
179769
|
+
section.pages,
|
|
179770
|
+
[...currentPath, sectionItem]
|
|
179771
|
+
);
|
|
179772
|
+
if (result2) return result2;
|
|
179773
|
+
}
|
|
179774
|
+
return null;
|
|
179775
|
+
};
|
|
179776
|
+
const result = findPath(
|
|
179777
|
+
ctx.navigation.sections,
|
|
179778
|
+
ctx.navigation.pages,
|
|
179779
|
+
[]
|
|
179780
|
+
);
|
|
179781
|
+
return result || [];
|
|
179782
|
+
};
|
|
179783
|
+
var makeBreadcrumbElements = (ctx) => {
|
|
179784
|
+
const currentHref = ctx.navigation.current?.href;
|
|
179785
|
+
if (!currentHref || currentHref === "/") return [];
|
|
179786
|
+
const pageBreadcrumb = ctx.navigation.current?.breadcrumb;
|
|
179787
|
+
const globalBreadcrumb = ctx.config.breadcrumb;
|
|
179788
|
+
let breadcrumbEnabled;
|
|
179789
|
+
if (pageBreadcrumb !== void 0) {
|
|
179790
|
+
breadcrumbEnabled = pageBreadcrumb;
|
|
179791
|
+
} else {
|
|
179792
|
+
breadcrumbEnabled = globalBreadcrumb;
|
|
179793
|
+
}
|
|
179794
|
+
if (!breadcrumbEnabled) return [];
|
|
179795
|
+
let home = "\u{1F3E0}";
|
|
179796
|
+
let separator = ">";
|
|
179797
|
+
if (typeof breadcrumbEnabled === "object") {
|
|
179798
|
+
if (breadcrumbEnabled.home !== void 0) {
|
|
179799
|
+
home = resolveEmoji(breadcrumbEnabled.home);
|
|
179800
|
+
}
|
|
179801
|
+
if (breadcrumbEnabled.separator !== void 0) {
|
|
179802
|
+
separator = resolveEmoji(breadcrumbEnabled.separator);
|
|
179803
|
+
}
|
|
179804
|
+
}
|
|
179805
|
+
const breadcrumbPath = buildBreadcrumbPath(ctx);
|
|
179806
|
+
if (breadcrumbPath.length === 0) return [];
|
|
179807
|
+
const elements = [];
|
|
179808
|
+
elements.push({
|
|
179809
|
+
type: "element",
|
|
179810
|
+
tagName: "a",
|
|
179811
|
+
properties: {
|
|
179812
|
+
class: "breadcrumb-home",
|
|
179813
|
+
href: ctx.makeUrl("/", "book"),
|
|
179814
|
+
"aria-label": i18n.get("breadcrumb-home")
|
|
179815
|
+
},
|
|
179816
|
+
children: [
|
|
179817
|
+
{
|
|
179818
|
+
type: "text",
|
|
179819
|
+
value: home
|
|
179820
|
+
}
|
|
179821
|
+
]
|
|
179822
|
+
});
|
|
179823
|
+
for (let i = 0; i < breadcrumbPath.length; i++) {
|
|
179824
|
+
const item = breadcrumbPath[i];
|
|
179825
|
+
const isLast = i === breadcrumbPath.length - 1;
|
|
179826
|
+
elements.push({
|
|
179827
|
+
type: "element",
|
|
179828
|
+
tagName: "span",
|
|
179829
|
+
properties: {
|
|
179830
|
+
class: "breadcrumb-separator",
|
|
179831
|
+
"aria-hidden": "true"
|
|
179832
|
+
},
|
|
179833
|
+
children: [
|
|
179834
|
+
{
|
|
179835
|
+
type: "text",
|
|
179836
|
+
value: separator
|
|
179837
|
+
}
|
|
179838
|
+
]
|
|
179839
|
+
});
|
|
179840
|
+
if (item.isEmpty || item.hide || !item.href) {
|
|
179841
|
+
elements.push({
|
|
179842
|
+
type: "element",
|
|
179843
|
+
tagName: "span",
|
|
179844
|
+
properties: {
|
|
179845
|
+
class: isLast ? "breadcrumb-item breadcrumb-current" : "breadcrumb-item breadcrumb-empty",
|
|
179846
|
+
"aria-current": isLast ? "page" : void 0
|
|
179847
|
+
},
|
|
179848
|
+
children: [
|
|
179849
|
+
{
|
|
179850
|
+
type: "text",
|
|
179851
|
+
value: item.name
|
|
179852
|
+
}
|
|
179853
|
+
]
|
|
179854
|
+
});
|
|
179855
|
+
} else {
|
|
179856
|
+
elements.push({
|
|
179857
|
+
type: "element",
|
|
179858
|
+
tagName: "a",
|
|
179859
|
+
properties: {
|
|
179860
|
+
class: isLast ? "breadcrumb-item breadcrumb-current" : "breadcrumb-item",
|
|
179861
|
+
href: ctx.makeUrl(item.href, "book"),
|
|
179862
|
+
"aria-current": isLast ? "page" : void 0
|
|
179863
|
+
},
|
|
179864
|
+
children: [
|
|
179865
|
+
{
|
|
179866
|
+
type: "text",
|
|
179867
|
+
value: item.name
|
|
179868
|
+
}
|
|
179869
|
+
]
|
|
179870
|
+
});
|
|
179871
|
+
}
|
|
179872
|
+
}
|
|
179873
|
+
return [
|
|
179874
|
+
{
|
|
179875
|
+
type: "element",
|
|
179876
|
+
tagName: "nav",
|
|
179877
|
+
properties: {
|
|
179878
|
+
class: "breadcrumb",
|
|
179879
|
+
"aria-label": i18n.get("breadcrumb-navigation")
|
|
179880
|
+
},
|
|
179881
|
+
children: elements
|
|
179882
|
+
}
|
|
179883
|
+
];
|
|
179884
|
+
};
|
|
179723
179885
|
var makeNavigationPageElement = (ctx, page) => {
|
|
179724
179886
|
return {
|
|
179725
179887
|
type: "element",
|
|
@@ -179743,10 +179905,35 @@ var makeNavigationPageElement = (ctx, page) => {
|
|
|
179743
179905
|
]
|
|
179744
179906
|
};
|
|
179745
179907
|
};
|
|
179908
|
+
var makeNavigationSectionAsPageElement = (ctx, section) => {
|
|
179909
|
+
const { href, name } = section;
|
|
179910
|
+
return {
|
|
179911
|
+
type: "element",
|
|
179912
|
+
tagName: "li",
|
|
179913
|
+
properties: {},
|
|
179914
|
+
children: [
|
|
179915
|
+
{
|
|
179916
|
+
type: "element",
|
|
179917
|
+
tagName: "a",
|
|
179918
|
+
properties: {
|
|
179919
|
+
class: ctx.navigation.current?.href === href ? "page active" : "page",
|
|
179920
|
+
href: ctx.makeUrl(href || "", "book")
|
|
179921
|
+
},
|
|
179922
|
+
children: [
|
|
179923
|
+
{
|
|
179924
|
+
type: "text",
|
|
179925
|
+
value: name
|
|
179926
|
+
}
|
|
179927
|
+
]
|
|
179928
|
+
}
|
|
179929
|
+
]
|
|
179930
|
+
};
|
|
179931
|
+
};
|
|
179746
179932
|
var makeNavigationSectionElement = (ctx, section) => {
|
|
179747
|
-
const { virtual, isEmpty, href, name, pages, sections, expanded } = section;
|
|
179748
|
-
|
|
179749
|
-
const
|
|
179933
|
+
const { virtual, isEmpty, href, name, pages, sections, expanded, navigation } = section;
|
|
179934
|
+
const isVirtual = navigation === "virtual" || navigation === void 0 && virtual;
|
|
179935
|
+
const isExpanded = navigation === "expanded" || navigation === void 0 && expanded || ctx.navigation.current?.href?.startsWith(href || "");
|
|
179936
|
+
const pagesElements = pages.filter((page) => !page.hide && page.navigation !== "hidden" && page.href !== href).map((page) => makeNavigationPageElement(ctx, page));
|
|
179750
179937
|
const linksElements = [];
|
|
179751
179938
|
if (pagesElements.length > 0) {
|
|
179752
179939
|
linksElements.push({
|
|
@@ -179758,9 +179945,40 @@ var makeNavigationSectionElement = (ctx, section) => {
|
|
|
179758
179945
|
children: pagesElements
|
|
179759
179946
|
});
|
|
179760
179947
|
}
|
|
179761
|
-
const
|
|
179948
|
+
const pageModeChildSections = sections.filter((s3) => !s3.hide && s3.navigation !== "hidden" && s3.navigation === "page" && !s3.isEmpty);
|
|
179949
|
+
if (pageModeChildSections.length > 0) {
|
|
179950
|
+
const combinedItems = [
|
|
179951
|
+
...pages.filter((page) => !page.hide && page.navigation !== "hidden" && page.href !== href).map((page) => ({
|
|
179952
|
+
index: page.index,
|
|
179953
|
+
name: page.name,
|
|
179954
|
+
element: makeNavigationPageElement(ctx, page)
|
|
179955
|
+
})),
|
|
179956
|
+
...pageModeChildSections.map((s3) => ({
|
|
179957
|
+
index: s3.index,
|
|
179958
|
+
name: s3.name,
|
|
179959
|
+
element: makeNavigationSectionAsPageElement(ctx, s3)
|
|
179960
|
+
}))
|
|
179961
|
+
].sort((a, b) => {
|
|
179962
|
+
const aIndex = a.index !== void 0 ? a.index : 9999;
|
|
179963
|
+
const bIndex = b.index !== void 0 ? b.index : 9999;
|
|
179964
|
+
if (aIndex !== bIndex) return aIndex - bIndex;
|
|
179965
|
+
return a.name > b.name ? 1 : -1;
|
|
179966
|
+
});
|
|
179967
|
+
linksElements.length = 0;
|
|
179968
|
+
if (combinedItems.length > 0) {
|
|
179969
|
+
linksElements.push({
|
|
179970
|
+
type: "element",
|
|
179971
|
+
tagName: "ul",
|
|
179972
|
+
properties: {
|
|
179973
|
+
class: "pages"
|
|
179974
|
+
},
|
|
179975
|
+
children: combinedItems.map((item) => item.element)
|
|
179976
|
+
});
|
|
179977
|
+
}
|
|
179978
|
+
}
|
|
179979
|
+
const sectionElements = sections.filter((s3) => !s3.hide && s3.navigation !== "hidden" && s3.navigation !== "page").map((s3) => makeNavigationSectionElement(ctx, s3));
|
|
179762
179980
|
linksElements.push(...sectionElements);
|
|
179763
|
-
if (
|
|
179981
|
+
if (isVirtual) {
|
|
179764
179982
|
return {
|
|
179765
179983
|
type: "element",
|
|
179766
179984
|
tagName: "div",
|
|
@@ -179843,6 +180061,15 @@ var makeNavigationSectionElement = (ctx, section) => {
|
|
|
179843
180061
|
};
|
|
179844
180062
|
};
|
|
179845
180063
|
var makeNavigationElements = (ctx) => {
|
|
180064
|
+
const pageItems = ctx.navigation.pages.filter((p4) => !p4.hide && p4.navigation !== "hidden").map((p4) => ({ type: "page", item: p4 }));
|
|
180065
|
+
const pageModeSecions = ctx.navigation.sections.filter((s3) => !s3.hide && s3.navigation !== "hidden" && s3.navigation === "page" && !s3.isEmpty).map((s3) => ({ type: "section", item: s3 }));
|
|
180066
|
+
const regularSections = ctx.navigation.sections.filter((s3) => !s3.hide && s3.navigation !== "hidden" && s3.navigation !== "page");
|
|
180067
|
+
const combinedItems = [...pageItems, ...pageModeSecions].sort((a, b) => {
|
|
180068
|
+
const aIndex = a.item.index !== void 0 ? a.item.index : 9999;
|
|
180069
|
+
const bIndex = b.item.index !== void 0 ? b.item.index : 9999;
|
|
180070
|
+
if (aIndex !== bIndex) return aIndex - bIndex;
|
|
180071
|
+
return a.item.name > b.item.name ? 1 : -1;
|
|
180072
|
+
});
|
|
179846
180073
|
return [
|
|
179847
180074
|
{
|
|
179848
180075
|
type: "element",
|
|
@@ -179853,9 +180080,15 @@ var makeNavigationElements = (ctx) => {
|
|
|
179853
180080
|
type: "element",
|
|
179854
180081
|
tagName: "ul",
|
|
179855
180082
|
properties: {},
|
|
179856
|
-
children:
|
|
180083
|
+
children: combinedItems.map((navItem) => {
|
|
180084
|
+
if (navItem.type === "page") {
|
|
180085
|
+
return makeNavigationPageElement(ctx, navItem.item);
|
|
180086
|
+
} else {
|
|
180087
|
+
return makeNavigationSectionAsPageElement(ctx, navItem.item);
|
|
180088
|
+
}
|
|
180089
|
+
})
|
|
179857
180090
|
},
|
|
179858
|
-
...
|
|
180091
|
+
...regularSections.map((s3) => makeNavigationSectionElement(ctx, s3))
|
|
179859
180092
|
]
|
|
179860
180093
|
}
|
|
179861
180094
|
];
|
|
@@ -180680,6 +180913,7 @@ var rehypeShell_default = (ctx) => () => {
|
|
|
180680
180913
|
tagName: "main",
|
|
180681
180914
|
properties: {},
|
|
180682
180915
|
children: [
|
|
180916
|
+
...makeBreadcrumbElements(ctx),
|
|
180683
180917
|
{
|
|
180684
180918
|
type: "element",
|
|
180685
180919
|
tagName: "article",
|
|
@@ -193367,7 +193601,7 @@ var getNavigationForFile = async (pageList, currentFile) => {
|
|
|
193367
193601
|
current = pageList[i] || null;
|
|
193368
193602
|
const allPages = pageList;
|
|
193369
193603
|
const filteredPageList = pageList.filter(
|
|
193370
|
-
(p4) => (!p4.isEmpty || p4.href === currentFile.path.href) && !p4.hide
|
|
193604
|
+
(p4) => (!p4.isEmpty || p4.href === currentFile.path.href) && !p4.hide && p4.navigation !== "hidden"
|
|
193371
193605
|
);
|
|
193372
193606
|
i = filteredPageList.findIndex((p4) => p4.href === currentFile.path.href);
|
|
193373
193607
|
const resolveLink = (link3) => {
|
|
@@ -193453,8 +193687,10 @@ var getPagesAndSections = async (root5) => {
|
|
|
193453
193687
|
if (!data.name) {
|
|
193454
193688
|
data.name = data.title || file.name;
|
|
193455
193689
|
}
|
|
193690
|
+
const pageNavigation = data.navigation === "default" || data.navigation === "hidden" ? data.navigation : void 0;
|
|
193456
193691
|
const page = {
|
|
193457
193692
|
...data,
|
|
193693
|
+
navigation: pageNavigation,
|
|
193458
193694
|
path: file.path
|
|
193459
193695
|
};
|
|
193460
193696
|
const repo = makeRepoLink(hyperbook.repo, file);
|
|
@@ -201543,7 +201779,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"application/1d-interleaved-parityfec
|
|
|
201543
201779
|
/***/ ((module) => {
|
|
201544
201780
|
|
|
201545
201781
|
"use strict";
|
|
201546
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.
|
|
201782
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.77.1","author":"Mike Barkmin","homepage":"https://github.com/openpatch/hyperbook#readme","license":"MIT","bin":{"hyperbook":"./dist/index.js"},"files":["dist"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/openpatch/hyperbook.git","directory":"packages/hyperbook"},"bugs":{"url":"https://github.com/openpatch/hyperbook/issues"},"engines":{"node":">=18"},"scripts":{"version":"pnpm build","lint":"tsc --noEmit","dev":"ncc build ./index.ts -w -o dist/","build":"rimraf dist && ncc build ./index.ts -o ./dist/ --no-cache --no-source-map-register --external favicons --external sharp && node postbuild.mjs"},"dependencies":{"favicons":"^7.2.0"},"devDependencies":{"create-hyperbook":"workspace:*","@hyperbook/fs":"workspace:*","@hyperbook/markdown":"workspace:*","@hyperbook/types":"workspace:*","@pnpm/exportable-manifest":"1000.0.6","@types/archiver":"6.0.3","@types/async-retry":"1.4.9","@types/cross-spawn":"6.0.6","@types/lunr":"^2.3.7","@types/prompts":"2.4.9","@types/tar":"6.1.13","@types/ws":"^8.5.14","@vercel/ncc":"0.38.3","archiver":"7.0.1","async-retry":"1.3.3","chalk":"5.4.1","chokidar":"4.0.3","commander":"12.1.0","cpy":"11.1.0","cross-spawn":"7.0.6","domutils":"^3.2.2","extract-zip":"^2.0.1","got":"12.6.0","htmlparser2":"^10.0.0","lunr":"^2.3.9","lunr-languages":"^1.14.0","mime":"^4.0.6","prompts":"2.4.2","rimraf":"6.0.1","tar":"7.4.3","update-check":"1.5.4","ws":"^8.18.0"}}');
|
|
201547
201783
|
|
|
201548
201784
|
/***/ })
|
|
201549
201785
|
|
package/dist/locales/de.json
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
"shell-reset-hyperbook": "Das Hyperbook zurücksetzen",
|
|
13
13
|
"shell-import-hyperbook": "Das Hyperbook aus einer Datei importieren",
|
|
14
14
|
"shell-export-hyperbook": "Das Hyperbook in eine Datei exportieren",
|
|
15
|
+
"breadcrumb-navigation": "Brotkrümelnavigation",
|
|
16
|
+
"breadcrumb-home": "Startseite",
|
|
15
17
|
"qr-code": "QR-Code",
|
|
16
18
|
"p5-update": "Aktualisieren",
|
|
17
19
|
"p5-code-preview": "Code-Vorschau",
|
package/dist/locales/en.json
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
"shell-reset-hyperbook": "Reset Hyperbook",
|
|
13
13
|
"shell-import-hyperbook": "Import Hyperbook from a file",
|
|
14
14
|
"shell-export-hyperbook": "Export Hyperbook to a file",
|
|
15
|
+
"breadcrumb-navigation": "Breadcrumb",
|
|
16
|
+
"breadcrumb-home": "Home",
|
|
15
17
|
"qr-code": "QR Code",
|
|
16
18
|
"p5-update": "Update",
|
|
17
19
|
"p5-code-preview": "Code Preview",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hyperbook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.77.1",
|
|
4
4
|
"author": "Mike Barkmin",
|
|
5
5
|
"homepage": "https://github.com/openpatch/hyperbook#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"tar": "7.4.3",
|
|
57
57
|
"update-check": "1.5.4",
|
|
58
58
|
"ws": "^8.18.0",
|
|
59
|
-
"create-hyperbook": "0.3.
|
|
60
|
-
"@hyperbook/fs": "0.
|
|
61
|
-
"@hyperbook/markdown": "0.
|
|
62
|
-
"@hyperbook/types": "0.
|
|
59
|
+
"create-hyperbook": "0.3.2",
|
|
60
|
+
"@hyperbook/fs": "0.24.0",
|
|
61
|
+
"@hyperbook/markdown": "0.48.1",
|
|
62
|
+
"@hyperbook/types": "0.20.0"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"version": "pnpm build",
|