@heroiclands/package-build 23.12.8 → 24.0.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.
- package/CHANGELOG.md +84 -0
- package/README.md +3 -2
- package/assets/preview/gitea.ini +12 -7
- package/assets/styles/content-base.css +293 -24
- package/bin/content-commands.mjs +370 -213
- package/bin/package-build-preview.mjs +2 -2
- package/bin/package-build.mjs +3 -2
- package/ci/check-banners.mjs +7 -7
- package/config.mjs +21 -6
- package/content-config.mjs +199 -80
- package/docs/api.md +110 -89
- package/docs/authoring/links-and-markup.md +469 -97
- package/docs/commands.md +259 -78
- package/docs/configuration.md +211 -103
- package/docs/content-format.md +4 -4
- package/docs/diagnostics.md +44 -2
- package/docs/getting-started.md +1 -1
- package/docs/guides/icons.md +1 -1
- package/docs/guides/module-project.md +5 -8
- package/docs/guides/release-and-deploy.md +2 -2
- package/docs/guides/site.md +112 -23
- package/docs/guides/system-project.md +1 -1
- package/docs/guides/writing-in-invented-scripts.md +1247 -0
- package/docs/index.md +1 -0
- package/docs/project-setup.md +28 -30
- package/docs/reference/format-details.md +677 -319
- package/docs/reference/note-types.md +47 -10
- package/docs/reference/theme-pages.md +178 -108
- package/docs/source-preview.md +16 -2
- package/engine/anchors.mjs +2 -2
- package/engine/asset-shipping.mjs +22 -10
- package/engine/base-compiler.mjs +62 -104
- package/engine/changelog-lint.mjs +1 -1
- package/engine/code-fences.mjs +3 -3
- package/engine/content-address.mjs +1 -1
- package/engine/content-alerts.mjs +8 -4
- package/engine/content-blocks.mjs +29 -14
- package/engine/content-embeds.mjs +1 -1
- package/engine/content-expand.mjs +376 -0
- package/engine/content-figures.mjs +18 -11
- package/engine/content-format.yaml +8 -0
- package/engine/content-glyphs.mjs +213 -0
- package/engine/content-images.mjs +6 -7
- package/engine/content-index.mjs +1 -1
- package/engine/content-links.mjs +3 -3
- package/engine/content-lint.mjs +1 -1
- package/engine/content-render.mjs +453 -0
- package/engine/content-scripts.mjs +376 -43
- package/engine/content-spans.mjs +6 -3
- package/engine/content-styles.mjs +91 -0
- package/engine/content-symbols.mjs +186 -0
- package/engine/content-verse.mjs +738 -0
- package/engine/core-report.mjs +169 -0
- package/engine/core-vocabulary.mjs +208 -0
- package/engine/dictionary-html.mjs +119 -0
- package/engine/dictionary-rows.mjs +15 -4
- package/engine/field-reference.mjs +5 -5
- package/engine/first-use.mjs +17 -27
- package/engine/frontmatter-lint.mjs +1 -1
- package/engine/heading-attributes.mjs +89 -0
- package/engine/helpers.mjs +61 -101
- package/engine/homepage.mjs +17 -29
- package/engine/html-minify.mjs +70 -0
- package/engine/index.mjs +8 -5
- package/engine/key-case-collisions.mjs +136 -0
- package/engine/language-data.mjs +203 -6
- package/engine/language-rows.mjs +8 -2
- package/engine/language-terms.mjs +186 -16
- package/engine/language-words.mjs +12 -0
- package/engine/logographic.mjs +255 -0
- package/engine/map-lexicon.mjs +262 -47
- package/engine/map-places.mjs +5 -4
- package/engine/markdown-expressions.mjs +0 -2
- package/engine/markdownlint-run.mjs +9 -3
- package/engine/markup-validation.mjs +21 -0
- package/engine/metre-declaration.mjs +134 -0
- package/engine/names.mjs +36 -9
- package/engine/note-matter.mjs +66 -0
- package/engine/note-vocabulary.mjs +187 -3
- package/engine/pdf-build.mjs +69 -133
- package/engine/pdf-render.mjs +205 -58
- package/engine/post-fields.mjs +157 -0
- package/engine/preview-index.mjs +130 -0
- package/engine/preview-source.mjs +450 -0
- package/engine/project-init.mjs +5 -12
- package/engine/prose-config.mjs +3 -3
- package/engine/read-stdin.mjs +29 -0
- package/engine/run-rows.mjs +2 -2
- package/engine/run-words.mjs +6 -112
- package/engine/script-emphasis-terms.mjs +38 -0
- package/engine/script-emphasis.mjs +295 -0
- package/engine/script-font-delivery.mjs +4 -4
- package/engine/site-build.mjs +260 -315
- package/engine/site-config.mjs +26 -238
- package/engine/site-files.mjs +175 -0
- package/engine/site-index.mjs +9 -4
- package/engine/site-preview.mjs +52 -525
- package/engine/site-render.mjs +593 -0
- package/engine/site-root.mjs +22 -13
- package/engine/site-search.mjs +161 -0
- package/engine/site-serve.mjs +273 -0
- package/engine/site-theme-banner.mjs +154 -0
- package/engine/site-theme-urls.mjs +125 -0
- package/engine/site-theme.mjs +926 -0
- package/engine/sql-tables.mjs +20 -3
- package/engine/text-maps.mjs +57 -10
- package/engine/typographer.mjs +248 -0
- package/engine/verse-metre.mjs +357 -0
- package/engine/wikilink-syntax.mjs +29 -47
- package/engine/wikilinks.mjs +758 -279
- package/engine/word-forms.mjs +364 -0
- package/engine/word-rows.mjs +12 -2
- package/engine/word-terms.mjs +38 -4
- package/manifest.mjs +3 -4
- package/package.json +11 -8
- package/{hugo-theme → site-theme}/data/banners.yaml +6 -10
- package/site-theme/layouts/base.hbs +31 -0
- package/site-theme/layouts/blog-list.hbs +30 -0
- package/site-theme/layouts/blog-post.hbs +40 -0
- package/site-theme/layouts/home.hbs +35 -0
- package/site-theme/layouts/list.hbs +20 -0
- package/site-theme/layouts/not-found.hbs +31 -0
- package/site-theme/layouts/page.hbs +7 -0
- package/site-theme/partials/copy-buttons.hbs +37 -0
- package/site-theme/partials/draft-notice.hbs +5 -0
- package/site-theme/partials/exturl.hbs +2 -0
- package/{hugo-theme/layouts/partials/footer.html → site-theme/partials/footer.hbs} +10 -7
- package/site-theme/partials/header.hbs +44 -0
- package/site-theme/partials/hero-banner.hbs +11 -0
- package/site-theme/partials/infobox-entry.hbs +2 -0
- package/site-theme/partials/infobox-section.hbs +31 -0
- package/site-theme/partials/infobox-value.hbs +2 -0
- package/site-theme/partials/infobox.hbs +18 -0
- package/site-theme/partials/list-members.hbs +9 -0
- package/site-theme/partials/nav-links.hbs +5 -0
- package/site-theme/partials/page-body.hbs +48 -0
- package/site-theme/partials/page-list.hbs +14 -0
- package/site-theme/partials/related.hbs +24 -0
- package/site-theme/partials/search-meta.hbs +6 -0
- package/site-theme/partials/search-names.hbs +2 -0
- package/site-theme/partials/search.hbs +52 -0
- package/site-theme/partials/tags.hbs +4 -0
- package/site-theme/partials/toc.hbs +7 -0
- package/{hugo-theme → site-theme}/static/css/style.css +106 -14
- package/stage.mjs +1 -2
- package/types/config.d.mts +8 -4
- package/types/content-config.d.mts +15 -15
- package/types/engine/asset-shipping.d.mts +5 -2
- package/types/engine/base-compiler.d.mts +20 -2
- package/types/engine/code-fences.d.mts +3 -3
- package/types/engine/content-address.d.mts +1 -1
- package/types/engine/content-alerts.d.mts +8 -2
- package/types/engine/content-blocks.d.mts +11 -4
- package/types/engine/content-expand.d.mts +288 -0
- package/types/engine/content-figures.d.mts +11 -3
- package/types/engine/content-glyphs.d.mts +85 -0
- package/types/engine/content-images.d.mts +6 -7
- package/types/engine/content-links.d.mts +1 -1
- package/types/engine/content-render.d.mts +199 -0
- package/types/engine/content-scripts.d.mts +70 -4
- package/types/engine/content-spans.d.mts +1 -1
- package/types/engine/content-styles.d.mts +33 -0
- package/types/engine/content-symbols.d.mts +35 -0
- package/types/engine/content-verse.d.mts +240 -0
- package/types/engine/core-report.d.mts +45 -0
- package/types/engine/core-vocabulary.d.mts +53 -0
- package/types/engine/dictionary-html.d.mts +8 -0
- package/types/engine/dictionary-rows.d.mts +10 -0
- package/types/engine/field-reference.d.mts +2 -2
- package/types/engine/heading-attributes.d.mts +20 -0
- package/types/engine/helpers.d.mts +3 -10
- package/types/engine/homepage.d.mts +11 -24
- package/types/engine/html-minify.d.mts +9 -0
- package/types/engine/index.d.mts +2 -1
- package/types/engine/key-case-collisions.d.mts +28 -0
- package/types/engine/language-data.d.mts +0 -2
- package/types/engine/language-terms.d.mts +24 -2
- package/types/engine/logographic.d.mts +45 -0
- package/types/engine/map-lexicon.d.mts +66 -13
- package/types/engine/map-places.d.mts +8 -0
- package/types/engine/markdown-expressions.d.mts +0 -2
- package/types/engine/metre-declaration.d.mts +39 -0
- package/types/engine/names.d.mts +34 -3
- package/types/engine/note-matter.d.mts +48 -0
- package/types/engine/pdf-render.d.mts +6 -2
- package/types/engine/post-fields.d.mts +44 -0
- package/types/engine/preview-index.d.mts +72 -0
- package/types/engine/preview-source.d.mts +51 -0
- package/types/engine/read-stdin.d.mts +11 -0
- package/types/engine/run-rows.d.mts +2 -2
- package/types/engine/run-words.d.mts +0 -15
- package/types/engine/script-emphasis-terms.d.mts +21 -0
- package/types/engine/script-emphasis.d.mts +84 -0
- package/types/engine/script-font-delivery.d.mts +4 -4
- package/types/engine/site-build.d.mts +71 -113
- package/types/engine/site-config.d.mts +14 -134
- package/types/engine/site-files.d.mts +73 -0
- package/types/engine/site-index.d.mts +11 -3
- package/types/engine/site-preview.d.mts +15 -19
- package/types/engine/site-render.d.mts +171 -0
- package/types/engine/site-root.d.mts +12 -4
- package/types/engine/site-search.d.mts +54 -0
- package/types/engine/site-serve.d.mts +44 -0
- package/types/engine/site-theme-banner.d.mts +51 -0
- package/types/engine/site-theme-urls.d.mts +60 -0
- package/types/engine/site-theme.d.mts +127 -0
- package/types/engine/sql-tables.d.mts +4 -1
- package/types/engine/text-maps.d.mts +17 -3
- package/types/engine/typographer.d.mts +11 -0
- package/types/engine/verse-metre.d.mts +131 -0
- package/types/engine/wikilink-syntax.d.mts +30 -48
- package/types/engine/wikilinks.d.mts +330 -14
- package/types/engine/word-forms.d.mts +83 -0
- package/types/manifest.d.mts +3 -4
- package/types/stage.d.mts +1 -2
- package/types/vendor/markdownlint.d.mts +8 -0
- package/vendor/markdownlint.mjs +20388 -0
- package/engine/content-poetry.mjs +0 -240
- package/engine/web-wikilinks.mjs +0 -594
- package/hugo-theme/layouts/404.html +0 -85
- package/hugo-theme/layouts/_default/baseof.html +0 -67
- package/hugo-theme/layouts/_default/list.html +0 -139
- package/hugo-theme/layouts/_default/single.html +0 -4
- package/hugo-theme/layouts/blog/list.html +0 -54
- package/hugo-theme/layouts/blog-post/single.html +0 -36
- package/hugo-theme/layouts/index.html +0 -75
- package/hugo-theme/layouts/partials/banner-url.html +0 -141
- package/hugo-theme/layouts/partials/cdn-url.html +0 -36
- package/hugo-theme/layouts/partials/dictionary-lists.html +0 -58
- package/hugo-theme/layouts/partials/draft-notice.html +0 -41
- package/hugo-theme/layouts/partials/draft-state.html +0 -26
- package/hugo-theme/layouts/partials/header.html +0 -35
- package/hugo-theme/layouts/partials/hero-banner.html +0 -85
- package/hugo-theme/layouts/partials/infobox/entry.html +0 -18
- package/hugo-theme/layouts/partials/infobox/items.html +0 -26
- package/hugo-theme/layouts/partials/infobox/section.html +0 -56
- package/hugo-theme/layouts/partials/infobox/value.html +0 -43
- package/hugo-theme/layouts/partials/infobox.html +0 -57
- package/hugo-theme/layouts/partials/page-body.html +0 -152
- package/hugo-theme/layouts/partials/related.html +0 -138
- package/hugo-theme/layouts/partials/search.html +0 -84
- package/hugo-theme/layouts/partials/site-url.html +0 -32
- package/hugo-theme/layouts/partials/tags.html +0 -30
- package/hugo-theme/layouts/partials/toc.html +0 -28
- package/hugo-theme/layouts/partials/warn-missing-banner.html +0 -3
- package/hugo-theme/layouts/shortcodes/cartouche.html +0 -64
- package/hugo-theme/layouts/shortcodes/exturl.html +0 -12
- package/hugo-theme/layouts/shortcodes/glyph.html +0 -43
- package/hugo-theme/layouts/shortcodes/pagelist.html +0 -63
- package/hugo-theme/theme.toml +0 -11
- package/types/engine/content-poetry.d.mts +0 -58
- package/types/engine/web-wikilinks.d.mts +0 -107
- /package/{hugo-theme → site-theme}/data/banner-kinds.yaml +0 -0
- /package/{hugo-theme → site-theme}/static/css/sohl-icons.css +0 -0
- /package/{hugo-theme → site-theme}/static/fonts/game-icons-kb.woff2 +0 -0
- /package/{hugo-theme → site-theme}/static/img/banners/takheperu-hieroglyphs.svg +0 -0
- /package/{hugo-theme → site-theme}/static/img/cartouches/takheperu.svg +0 -0
- /package/{hugo-theme → site-theme}/static/js/inline-spoilers.js +0 -0
|
@@ -53,6 +53,13 @@
|
|
|
53
53
|
a footnote may be called from inside a blockquote or a named block. */
|
|
54
54
|
--footnote-marker: var(--accent-hover);
|
|
55
55
|
|
|
56
|
+
/* A rubric script's emphasis, which is carried by colour alone. Checked
|
|
57
|
+
against every surface text sits on, and against --text so the emphasis
|
|
58
|
+
survives without its hue: 5.62:1 on --bg, 5.21:1 on --bg-card, 4.57:1 on
|
|
59
|
+
--surface, and 2.13:1 against --text. A consuming site that overrides it
|
|
60
|
+
re-checks both. */
|
|
61
|
+
--rubric: #e0705f;
|
|
62
|
+
|
|
56
63
|
--font-display: 'Cinzel', 'Georgia', serif;
|
|
57
64
|
--font-body: 'Lora', 'Georgia', serif;
|
|
58
65
|
--font-mono: 'JetBrains Mono', monospace;
|
|
@@ -1378,33 +1385,109 @@ a.tag:hover {
|
|
|
1378
1385
|
}
|
|
1379
1386
|
|
|
1380
1387
|
/* Verse lines are hard breaks in the markup; paragraphs mark stanzas. */
|
|
1381
|
-
.single-content .
|
|
1388
|
+
.single-content .verse {
|
|
1382
1389
|
margin: 1.5rem 0;
|
|
1383
1390
|
line-height: 1.7;
|
|
1384
1391
|
}
|
|
1385
1392
|
|
|
1386
|
-
.single-content .
|
|
1393
|
+
.single-content .verse p {
|
|
1387
1394
|
margin: 0;
|
|
1388
1395
|
}
|
|
1389
1396
|
|
|
1390
|
-
.single-content .
|
|
1397
|
+
.single-content .verse p + p {
|
|
1391
1398
|
margin-top: 1em;
|
|
1392
1399
|
}
|
|
1393
1400
|
|
|
1394
|
-
.single-content .
|
|
1401
|
+
.single-content .verse .verse-line {
|
|
1395
1402
|
display: inline-block;
|
|
1396
|
-
margin-inline-start: var(--
|
|
1403
|
+
margin-inline-start: var(--verse-indent, 0em);
|
|
1397
1404
|
white-space: pre-wrap;
|
|
1398
1405
|
}
|
|
1399
1406
|
|
|
1400
|
-
.single-content .
|
|
1401
|
-
.single-content .
|
|
1402
|
-
.single-content .
|
|
1403
|
-
.single-content .
|
|
1404
|
-
.single-content .
|
|
1405
|
-
.single-content .
|
|
1406
|
-
.single-content .
|
|
1407
|
-
.single-content .
|
|
1407
|
+
.single-content .verse .verse-line.i1 { --verse-indent: 1.25em; }
|
|
1408
|
+
.single-content .verse .verse-line.i2 { --verse-indent: 2.5em; }
|
|
1409
|
+
.single-content .verse .verse-line.i3 { --verse-indent: 3.75em; }
|
|
1410
|
+
.single-content .verse .verse-line.i4 { --verse-indent: 5em; }
|
|
1411
|
+
.single-content .verse .verse-line.i5 { --verse-indent: 6.25em; }
|
|
1412
|
+
.single-content .verse .verse-line.i6 { --verse-indent: 7.5em; }
|
|
1413
|
+
.single-content .verse .verse-line.i7 { --verse-indent: 8.75em; }
|
|
1414
|
+
.single-content .verse .verse-line.i8 { --verse-indent: 10em; }
|
|
1415
|
+
|
|
1416
|
+
/* Numbered verse carries its numbers in a margin. A verse in columns is one
|
|
1417
|
+
grid per verse line: its number, then each column's parts stacked, the
|
|
1418
|
+
first in the normal tone and the rest muted, every part in the body serif
|
|
1419
|
+
unless its face sets it. A narrow verse stacks the columns of each line. */
|
|
1420
|
+
.single-content .verse.verse-numbered {
|
|
1421
|
+
position: relative;
|
|
1422
|
+
padding-inline-start: 3em;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
.single-content .verse .verse-number {
|
|
1426
|
+
color: var(--text-muted);
|
|
1427
|
+
font-size: 0.8em;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
.single-content .verse-numbered .verse-line .verse-number {
|
|
1431
|
+
position: absolute;
|
|
1432
|
+
inset-inline-start: 0;
|
|
1433
|
+
width: 2.2em;
|
|
1434
|
+
text-align: end;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
.single-content .verse.verse-columns {
|
|
1438
|
+
container-type: inline-size;
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
.single-content .verse-numbered.verse-columns {
|
|
1442
|
+
padding-inline-start: 0;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
.single-content .verse-columns .verse-row {
|
|
1446
|
+
display: grid;
|
|
1447
|
+
grid-auto-flow: column;
|
|
1448
|
+
grid-auto-columns: 1fr;
|
|
1449
|
+
column-gap: 1.5rem;
|
|
1450
|
+
margin-bottom: 0.5em;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
.single-content .verse-numbered.verse-columns .verse-row {
|
|
1454
|
+
grid-template-columns: 2.5em;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
.single-content .verse-columns .verse-number {
|
|
1458
|
+
text-align: end;
|
|
1459
|
+
padding-top: 0.2em;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
.single-content .verse-columns :is(.verse-column, .verse-part) {
|
|
1463
|
+
display: block;
|
|
1464
|
+
white-space: pre-wrap;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
.single-content .verse-columns .verse-part {
|
|
1468
|
+
font-family: var(--font-body);
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
.single-content .verse-columns .verse-secondary {
|
|
1472
|
+
color: var(--text-muted);
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
.single-content .verse-columns .verse-part[dir="rtl"] {
|
|
1476
|
+
text-align: start;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
@container (max-width: 32rem) {
|
|
1480
|
+
.single-content .verse-columns .verse-row {
|
|
1481
|
+
grid-auto-flow: row;
|
|
1482
|
+
grid-template-columns: 1fr;
|
|
1483
|
+
}
|
|
1484
|
+
.single-content .verse-numbered.verse-columns .verse-row {
|
|
1485
|
+
grid-template-columns: 2.5em 1fr;
|
|
1486
|
+
}
|
|
1487
|
+
.single-content .verse-numbered.verse-columns .verse-column {
|
|
1488
|
+
grid-column: 2;
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1408
1491
|
|
|
1409
1492
|
/* Ornamental horizontal rule: thin line flanking a centered gold
|
|
1410
1493
|
diamond. Uses gradients on ::before/::after to keep the markup
|
|
@@ -3021,6 +3104,8 @@ summary.info-sidebar-title::after {
|
|
|
3021
3104
|
.single-body .dictionary > div > dd { display:inline; margin:0; font-weight:normal; }
|
|
3022
3105
|
.single-body .dictionary > div > dd > :is(p, ul, ol, dl, blockquote, pre, table, div) { text-indent:0; }
|
|
3023
3106
|
.single-body .dictionary > div > dd > p:first-child { display:inline; }
|
|
3107
|
+
.single-body .dictionary > div > dd + dd { display:block; text-indent:0; }
|
|
3108
|
+
.single-body .dictionary > div > dd + dd > p:first-child { display:block; }
|
|
3024
3109
|
@media (max-width:600px) { .single-body .dictionary { --indent:100px; } }
|
|
3025
3110
|
|
|
3026
3111
|
/* ---- Text in one of the faces ----
|
|
@@ -3028,7 +3113,14 @@ summary.info-sidebar-title::after {
|
|
|
3028
3113
|
right-to-left block or verse reads from the right. `font=serif`, `sans`
|
|
3029
3114
|
and `mono` set the site's own serif and mono, and the reader's sans. */
|
|
3030
3115
|
.script-block { margin:1rem 0; line-height:1.7; }
|
|
3031
|
-
.script-block[dir="rtl"], .
|
|
3116
|
+
.script-block[dir="rtl"], .verse[dir="rtl"] { text-align:start; }
|
|
3032
3117
|
.font-serif { font-family:var(--font-body); }
|
|
3033
3118
|
.font-sans { font-family:sans-serif; }
|
|
3034
3119
|
.font-mono { font-family:var(--font-mono); }
|
|
3120
|
+
|
|
3121
|
+
/* Emphasis in a script follows the script's convention, never a weight or a
|
|
3122
|
+
slant the face does not have: the element keeps the face's Regular, and
|
|
3123
|
+
its class sets the convention. */
|
|
3124
|
+
.script :is(em, strong) { font-style:normal; font-weight:inherit; font-synthesis:none; }
|
|
3125
|
+
.emph-rubric { color:var(--rubric); }
|
|
3126
|
+
.emph-overline { text-decoration-line:overline; text-decoration-skip-ink:none; }
|
package/stage.mjs
CHANGED
|
@@ -44,8 +44,7 @@ import path from "node:path";
|
|
|
44
44
|
*
|
|
45
45
|
* A repository adds its own through `packageBuild.clean.extra`, but these four
|
|
46
46
|
* are common to all of them because they come from the shared toolchain rather
|
|
47
|
-
* than from any one package's layout. Everything the site build writes
|
|
48
|
-
* Hugo source tree, Hugo's cache and the rendered site — is under `build/`.
|
|
47
|
+
* than from any one package's layout. Everything the site build writes is under `build/`.
|
|
49
48
|
*/
|
|
50
49
|
export const BUILD_ARTIFACT_DIRS = Object.freeze(["build", ".vite", ".vitepress", ".rollup.cache"]);
|
|
51
50
|
|
package/types/config.d.mts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Exported so a sibling module composing a configuration value this module
|
|
9
9
|
* does not itself validate — {@link module:engine/site-config}'s
|
|
10
|
-
* `
|
|
10
|
+
* `siteSettings`, checking `site.assets` — reports through the one helper
|
|
11
11
|
* rather than a second copy.
|
|
12
12
|
*
|
|
13
13
|
* @param {string} where - Dotted path of the offending key.
|
|
@@ -32,8 +32,7 @@ export function resolveAssetTransform(declared: string, rootDir: string): string
|
|
|
32
32
|
*
|
|
33
33
|
* A package's Foundry manifest already derives its own `url` from
|
|
34
34
|
* `contentPackage` (`packageHomepage` in `manifest.mjs`); `homepage` states
|
|
35
|
-
* the same address a second time, in `package.json`, for the
|
|
36
|
-
* configuration to read a `baseURL` from without knowing where each
|
|
35
|
+
* the same address a second time, in `package.json`, for the site build to read a base URL from without knowing where each
|
|
37
36
|
* repository keeps its own site configuration.
|
|
38
37
|
*
|
|
39
38
|
* Required unconditionally: every package publishes a site, so there is no
|
|
@@ -45,12 +44,17 @@ export function resolveAssetTransform(declared: string, rootDir: string): string
|
|
|
45
44
|
* `packageHomepage(contentPackage)`, independent of it. The right caller is
|
|
46
45
|
* whatever reads `homepage` to write a site's `baseURL`.
|
|
47
46
|
*
|
|
47
|
+
* A site that states `site.base` is served at that path instead, and its
|
|
48
|
+
* `homepage` is that path on its origin: `/` makes it the origin's root.
|
|
49
|
+
*
|
|
48
50
|
* @param {string|null} homepage - The resolved `package.json` `homepage`, or
|
|
49
51
|
* `null` when none is declared.
|
|
50
52
|
* @param {string} contentPackage - The resolved `contentPackage`.
|
|
53
|
+
* @param {string} [base] - The resolved `site.base`; `""` or absent for a
|
|
54
|
+
* package site, served at `/<contentPackage>/`.
|
|
51
55
|
* @returns {void}
|
|
52
56
|
*/
|
|
53
|
-
export function checkHomepage(homepage: string | null, contentPackage: string): void;
|
|
57
|
+
export function checkHomepage(homepage: string | null, contentPackage: string, base?: string): void;
|
|
54
58
|
/**
|
|
55
59
|
* Resolve a package-build configuration from an already-loaded shared one.
|
|
56
60
|
*
|
|
@@ -11,6 +11,20 @@
|
|
|
11
11
|
export function compilesFoundryDocuments(config: {
|
|
12
12
|
packageKind: string;
|
|
13
13
|
}): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The path a package's site is served at: `site.base` where it states one,
|
|
16
|
+
* `/<contentPackage>/` otherwise.
|
|
17
|
+
*
|
|
18
|
+
* @param {{contentPackage: string, site: {base: string}}} config - The resolved
|
|
19
|
+
* configuration.
|
|
20
|
+
* @returns {string} The path, beginning and ending with `/`.
|
|
21
|
+
*/
|
|
22
|
+
export function siteBase(config: {
|
|
23
|
+
contentPackage: string;
|
|
24
|
+
site: {
|
|
25
|
+
base: string;
|
|
26
|
+
};
|
|
27
|
+
}): string;
|
|
14
28
|
/**
|
|
15
29
|
* Whether this package publishes the pages its content tree compiles to.
|
|
16
30
|
*
|
|
@@ -136,20 +150,6 @@ export const AUTHOR_ROLES: readonly string[];
|
|
|
136
150
|
* @type {symbol}
|
|
137
151
|
*/
|
|
138
152
|
export const DERIVED_SYSTEM_VERSION: symbol;
|
|
139
|
-
/**
|
|
140
|
-
* Hugo keys a repository may **not** declare under `site.hugo`, because the
|
|
141
|
-
* site build generates them and would only overwrite what was written.
|
|
142
|
-
*
|
|
143
|
-
* The same rule `DERIVED_MANIFEST_KEYS` states for the manifest, for the same
|
|
144
|
-
* reason: an authored `baseURL` would look authoritative, sit there unread,
|
|
145
|
-
* and disagree with the site forever. Each key names where its value comes
|
|
146
|
-
* from. A dotted key names a nested one, and covers everything beneath it —
|
|
147
|
-
* `params.brand` refuses `params.brand.logo` too — so `site.hugo` reaches only
|
|
148
|
-
* what the generator does not write.
|
|
149
|
-
*
|
|
150
|
-
* @type {Readonly<Record<string, string>>}
|
|
151
|
-
*/
|
|
152
|
-
export const DERIVED_HUGO_KEYS: Readonly<Record<string, string>>;
|
|
153
153
|
/**
|
|
154
154
|
* One declared book, resolved.
|
|
155
155
|
*/
|
|
@@ -328,7 +328,7 @@ export type PathsInput = {
|
|
|
328
328
|
metadataCache?: string | undefined;
|
|
329
329
|
/**
|
|
330
330
|
* Where the site navigation is fetched
|
|
331
|
-
* to, for the
|
|
331
|
+
* to, for the site's menu.
|
|
332
332
|
*/
|
|
333
333
|
navigationCache?: string | undefined;
|
|
334
334
|
};
|
|
@@ -112,8 +112,11 @@ export function assetsManifest(staged: readonly object[], stageDir: string): Ass
|
|
|
112
112
|
*
|
|
113
113
|
* The pictures are written beside whatever a `packageBuild.assets` row already
|
|
114
114
|
* put under `icons/` and `images/`; nothing there is removed. A picture whose
|
|
115
|
-
* deployed path
|
|
116
|
-
*
|
|
115
|
+
* deployed path already holds a file with the bytes it would stage — after the
|
|
116
|
+
* transform, when there is one — is its own earlier output and is skipped, so
|
|
117
|
+
* staging twice into one directory is quiet. A file there with other bytes is a
|
|
118
|
+
* finding, and no picture is written. Clearing an earlier run's pictures is the
|
|
119
|
+
* stage reset's work.
|
|
117
120
|
*
|
|
118
121
|
* @param {object} opts - Options.
|
|
119
122
|
* @param {string} opts.assetsBase - The package's asset directory, the roots'
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tallies one pass accumulates while walking the tree.
|
|
3
|
+
*
|
|
4
|
+
* `declined` and `skippedOther` are deliberately separate numbers. A declined
|
|
5
|
+
* note is one this build **refused** — it declares `package:` — and it is an
|
|
6
|
+
* error; a skipped one legitimately belongs to another pass, and
|
|
7
|
+
* there are thousands of those. Folding the first into the second is what let a
|
|
8
|
+
* whole tree be filtered out in silence.
|
|
9
|
+
*
|
|
10
|
+
* @typedef {object} PassStats
|
|
11
|
+
* @property {number} compiled - Notes that became a document.
|
|
12
|
+
* @property {number} skippedNoId - Notes with no `id`, where that is tolerated.
|
|
13
|
+
* @property {number} skippedOther - Notes this pass does not claim.
|
|
14
|
+
* @property {number} declined - Notes this pack **refused** — one declaring
|
|
15
|
+
* `package:`, or one routed to a system pack whose system it says nothing
|
|
16
|
+
* about. Counted as errors, never as skips.
|
|
17
|
+
*/
|
|
1
18
|
/**
|
|
2
19
|
* The shared walk → filter → expand → convert → build → write → count loop.
|
|
3
20
|
*
|
|
@@ -381,8 +398,9 @@ export class BasePackCompiler {
|
|
|
381
398
|
/**
|
|
382
399
|
* The body {@link BasePackCompiler#buildEntry} receives.
|
|
383
400
|
*
|
|
384
|
-
*
|
|
385
|
-
*
|
|
401
|
+
* The body is expanded by {@link module:engine/content-expand.expandContent}
|
|
402
|
+
* for Foundry: generated tables expand before wikilinks are converted, so
|
|
403
|
+
* a cell a table emits is resolved along with the authored links.
|
|
386
404
|
*
|
|
387
405
|
* @param {object} fm - The note's frontmatter.
|
|
388
406
|
* @param {string} body - The note body, as authored.
|
|
@@ -17,13 +17,13 @@ export function parseHeaderArgs(info: string): {
|
|
|
17
17
|
* @param {object} [options]
|
|
18
18
|
* @param {boolean} [options.spans=true] - Include inline code spans. Set false
|
|
19
19
|
* to consider only block-level code.
|
|
20
|
-
* @param {boolean} [options.
|
|
20
|
+
* @param {boolean} [options.verseAsProse=true] - Treat verse bodies as inline prose.
|
|
21
21
|
* @returns {Array<{start: number, end: number}>} Non-overlapping regions, in
|
|
22
22
|
* source order. `end` is exclusive.
|
|
23
23
|
*/
|
|
24
|
-
export function codeRegions(markdown: string | null | undefined, { spans,
|
|
24
|
+
export function codeRegions(markdown: string | null | undefined, { spans, verseAsProse }?: {
|
|
25
25
|
spans?: boolean | undefined;
|
|
26
|
-
|
|
26
|
+
verseAsProse?: boolean | undefined;
|
|
27
27
|
}): Array<{
|
|
28
28
|
start: number;
|
|
29
29
|
end: number;
|
|
@@ -41,7 +41,7 @@ export function addressSlug(fm: object): string;
|
|
|
41
41
|
* composing a URL prepends where the package is served (`/<package>/`); a
|
|
42
42
|
* consumer composing a manifest entry measures against that same base. Nothing
|
|
43
43
|
* else is prepended: `prefix` says where the content tree *mounts inside the
|
|
44
|
-
* package* —
|
|
44
|
+
* package* — where its pages sit in the source tree — and an address is
|
|
45
45
|
* `(type, shortcode)`, a package-wide identity that takes no mount, so `sohl`
|
|
46
46
|
* publishes `/sohl/affliction-aconite/` from a file written under `kb/`. The
|
|
47
47
|
* `type-` half is what keeps that flat namespace clear of the package's fixed
|
|
@@ -23,9 +23,15 @@ export function scanAlerts(source: string): {
|
|
|
23
23
|
};
|
|
24
24
|
/** Render alert wrappers while preserving ordinary Markdown and note footnotes.
|
|
25
25
|
* @param {string} source - Authored Markdown.
|
|
26
|
-
* @param {"web"|"foundry"} [target="web"] - Publishing surface
|
|
26
|
+
* @param {"web"|"foundry"|"preview"} [target="web"] - Publishing surface: the
|
|
27
|
+
* preview draws the icon as an inline drawing, since a buffer has no icon font.
|
|
28
|
+
* @param {object} [options]
|
|
29
|
+
* @param {(markdown: string) => string} [options.renderInline] - How a title
|
|
30
|
+
* is rendered; omitted, a title is plain inline Markdown.
|
|
27
31
|
*/
|
|
28
|
-
export function renderAlerts(source: string, target?: "web" | "foundry"
|
|
32
|
+
export function renderAlerts(source: string, target?: "web" | "foundry" | "preview", { renderInline }?: {
|
|
33
|
+
renderInline?: ((markdown: string) => string) | undefined;
|
|
34
|
+
}): {
|
|
29
35
|
markdown: string;
|
|
30
36
|
errors: {
|
|
31
37
|
line: number;
|
|
@@ -28,7 +28,8 @@ export function scanBlocks(source: string): {
|
|
|
28
28
|
* Render named blocks for one publishing surface.
|
|
29
29
|
*
|
|
30
30
|
* `foundry` emits a `<section>` whose heading is its first line; `web` emits a
|
|
31
|
-
* `<details>` the reader opens
|
|
31
|
+
* `<details>` the reader opens, and `preview` the same without the search
|
|
32
|
+
* marker. None carries an inline `style`.
|
|
32
33
|
*
|
|
33
34
|
* The body is left as Markdown between the wrapper's tags, each separated from
|
|
34
35
|
* its tag by a blank line — see the module docs for why that is what lets the
|
|
@@ -38,10 +39,15 @@ export function scanBlocks(source: string): {
|
|
|
38
39
|
* A finding does not stop the well-formed blocks around it from rendering.
|
|
39
40
|
*
|
|
40
41
|
* @param {string} source - Markdown containing named blocks.
|
|
41
|
-
* @param {"foundry"|"web"} target - Publishing surface.
|
|
42
|
+
* @param {"foundry"|"web"|"preview"} target - Publishing surface.
|
|
43
|
+
* @param {object} [options]
|
|
44
|
+
* @param {(markdown: string) => string} [options.renderInline] - How a title
|
|
45
|
+
* is rendered; omitted, a title is plain inline Markdown.
|
|
42
46
|
* @returns {{markdown: string, errors: Array<{line: number, column: number, message: string}>}}
|
|
43
47
|
*/
|
|
44
|
-
export function renderBlocks(source: string, target: "foundry" | "web"
|
|
48
|
+
export function renderBlocks(source: string, target: "foundry" | "web" | "preview", { renderInline }?: {
|
|
49
|
+
renderInline?: ((markdown: string) => string) | undefined;
|
|
50
|
+
}): {
|
|
45
51
|
markdown: string;
|
|
46
52
|
errors: Array<{
|
|
47
53
|
line: number;
|
|
@@ -58,7 +64,8 @@ export function renderBlocks(source: string, target: "foundry" | "web"): {
|
|
|
58
64
|
*
|
|
59
65
|
* **A spoiler, not access control.** The section is in the published page, so a
|
|
60
66
|
* reader who opens the element or reads the source reads it. Foundry is the one
|
|
61
|
-
* surface that withholds anything.
|
|
67
|
+
* surface that withholds anything. The disclosure is kept out of the site's
|
|
68
|
+
* search index, as a `secret` block is, so no result quotes it.
|
|
62
69
|
*
|
|
63
70
|
* @param {string} source - A page's Markdown, headings intact.
|
|
64
71
|
* @returns {string} The same Markdown, each withheld section inside a
|