@heroiclands/package-build 23.0.0 → 23.1.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.
Files changed (153) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +1 -1
  3. package/bin/content-commands.mjs +1 -1
  4. package/ci/content-format-reference.mjs +46 -0
  5. package/docs/api.md +124 -141
  6. package/docs/authoring/assets.md +1 -1
  7. package/docs/authoring/dates-and-calendars.md +12 -6
  8. package/docs/authoring/frontmatter.md +2 -2
  9. package/docs/authoring/links-and-markup.md +145 -29
  10. package/docs/commands.md +8 -10
  11. package/docs/configuration.md +13 -11
  12. package/docs/content-format.md +2 -2
  13. package/docs/guides/book.md +59 -4
  14. package/docs/guides/icons.md +4 -5
  15. package/docs/guides/packs.md +6 -0
  16. package/docs/guides/reference-pages.md +21 -1
  17. package/docs/guides/release-and-deploy.md +17 -1
  18. package/docs/guides/site.md +17 -18
  19. package/docs/reference/format-details.md +877 -276
  20. package/docs/reference/note-types.md +278 -91
  21. package/docs/reference/theme-pages.md +58 -97
  22. package/engine/address-values.mjs +124 -4
  23. package/engine/address.mjs +44 -3
  24. package/engine/anchors.mjs +103 -3
  25. package/engine/art-slots.mjs +2 -9
  26. package/engine/base-compiler.mjs +25 -6
  27. package/engine/calendar-artifacts.mjs +4 -1
  28. package/engine/calendar-notes.mjs +166 -102
  29. package/engine/content-format-check.mjs +2 -3
  30. package/engine/content-format.mjs +44 -1
  31. package/engine/content-format.yaml +79 -16
  32. package/engine/content-images.mjs +10 -1
  33. package/engine/content-index.mjs +37 -9
  34. package/engine/content-links.mjs +24 -5
  35. package/engine/content-tables.mjs +24 -3
  36. package/engine/data-keys.mjs +347 -0
  37. package/engine/derived-sections.mjs +322 -0
  38. package/engine/diagnostics.mjs +28 -0
  39. package/engine/event-fields.mjs +187 -0
  40. package/engine/event-rows.mjs +126 -0
  41. package/engine/event-views.mjs +305 -0
  42. package/engine/exported-scene.mjs +29 -53
  43. package/engine/frontmatter-lint.mjs +103 -77
  44. package/engine/frontmatter.mjs +7 -2
  45. package/engine/generate.mjs +53 -0
  46. package/engine/generated-sections.mjs +223 -0
  47. package/engine/heading-attributes.mjs +4 -2
  48. package/engine/helpers.mjs +12 -1
  49. package/engine/holdings.mjs +12 -33
  50. package/engine/ids.mjs +17 -11
  51. package/engine/index.mjs +4 -4
  52. package/engine/infobox-render.mjs +21 -6
  53. package/engine/infobox.mjs +217 -99
  54. package/engine/journals.mjs +104 -47
  55. package/engine/literature-notes.mjs +4 -1
  56. package/engine/literature-works.mjs +21 -13
  57. package/engine/map-graphviz.mjs +4 -18
  58. package/engine/markdown-expressions.mjs +116 -11
  59. package/engine/metadata-index.mjs +26 -0
  60. package/engine/near-miss.mjs +90 -0
  61. package/engine/note-addresses.mjs +75 -19
  62. package/engine/note-dates.mjs +5 -3
  63. package/engine/note-event-terms.mjs +364 -0
  64. package/engine/note-events.mjs +823 -0
  65. package/engine/note-vocabulary.mjs +184 -88
  66. package/engine/office-holders.mjs +20 -54
  67. package/engine/packagebuild-index.mjs +16 -1
  68. package/engine/pdf-build.mjs +97 -60
  69. package/engine/pdf-index.mjs +263 -0
  70. package/engine/pdf-render.mjs +47 -5
  71. package/engine/place-relation-terms.mjs +174 -0
  72. package/engine/place-relations.mjs +72 -160
  73. package/engine/rank-ladder.mjs +14 -41
  74. package/engine/reckoning-markers.mjs +2 -0
  75. package/engine/region-events.mjs +6 -12
  76. package/engine/scenes.mjs +73 -468
  77. package/engine/site-build.mjs +75 -101
  78. package/engine/site-index.mjs +3 -1
  79. package/engine/site-maps.mjs +43 -29
  80. package/engine/site-preview.mjs +40 -31
  81. package/engine/social-ties.mjs +2 -1
  82. package/engine/sql-tables.mjs +212 -9
  83. package/engine/standing-terms.mjs +145 -6
  84. package/engine/standings.mjs +37 -49
  85. package/engine/web-wikilinks.mjs +21 -1
  86. package/engine/wikilink-syntax.mjs +34 -4
  87. package/engine/wikilinks.mjs +27 -2
  88. package/hugo-theme/layouts/partials/infobox/entry.html +4 -1
  89. package/hugo-theme/layouts/partials/page-body.html +0 -3
  90. package/hugo-theme/static/css/style.css +25 -55
  91. package/package.json +1 -2
  92. package/packagebuild-metadata.jsonl +13 -13
  93. package/sohl/note-schemas.mjs +8 -73
  94. package/types/engine/address-values.d.mts +50 -3
  95. package/types/engine/address.d.mts +21 -0
  96. package/types/engine/anchors.d.mts +49 -2
  97. package/types/engine/art-slots.d.mts +1 -1
  98. package/types/engine/base-compiler.d.mts +13 -4
  99. package/types/engine/calendar-notes.d.mts +7 -0
  100. package/types/engine/content-format.d.mts +52 -0
  101. package/types/engine/content-images.d.mts +5 -1
  102. package/types/engine/content-tables.d.mts +9 -1
  103. package/types/engine/data-keys.d.mts +145 -0
  104. package/types/engine/derived-sections.d.mts +73 -0
  105. package/types/engine/diagnostics.d.mts +15 -0
  106. package/types/engine/event-fields.d.mts +99 -0
  107. package/types/engine/event-rows.d.mts +12 -0
  108. package/types/engine/event-views.d.mts +67 -0
  109. package/types/engine/exported-scene.d.mts +5 -2
  110. package/types/engine/frontmatter-lint.d.mts +3 -3
  111. package/types/engine/generated-sections.d.mts +143 -0
  112. package/types/engine/holdings.d.mts +6 -20
  113. package/types/engine/ids.d.mts +15 -12
  114. package/types/engine/index.d.mts +1 -1
  115. package/types/engine/infobox.d.mts +13 -3
  116. package/types/engine/journals.d.mts +24 -11
  117. package/types/engine/literature-works.d.mts +1 -2
  118. package/types/engine/map-graphviz.d.mts +2 -10
  119. package/types/engine/markdown-expressions.d.mts +12 -3
  120. package/types/engine/near-miss.d.mts +42 -0
  121. package/types/engine/note-addresses.d.mts +7 -1
  122. package/types/engine/note-event-terms.d.mts +68 -0
  123. package/types/engine/note-events.d.mts +71 -0
  124. package/types/engine/note-vocabulary.d.mts +37 -8
  125. package/types/engine/office-holders.d.mts +3 -0
  126. package/types/engine/pdf-index.d.mts +35 -0
  127. package/types/engine/pdf-render.d.mts +8 -2
  128. package/types/engine/place-relation-terms.d.mts +83 -0
  129. package/types/engine/place-relations.d.mts +11 -66
  130. package/types/engine/rank-ladder.d.mts +2 -0
  131. package/types/engine/region-events.d.mts +6 -12
  132. package/types/engine/scenes.d.mts +6 -32
  133. package/types/engine/site-build.d.mts +8 -22
  134. package/types/engine/site-maps.d.mts +15 -7
  135. package/types/engine/sql-tables.d.mts +77 -2
  136. package/types/engine/standing-terms.d.mts +37 -4
  137. package/types/engine/standings.d.mts +14 -9
  138. package/types/engine/wikilink-syntax.d.mts +20 -0
  139. package/types/engine/wikilinks.d.mts +3 -2
  140. package/docs/guides/government-migration.md +0 -52
  141. package/engine/itinerary-scenes.mjs +0 -166
  142. package/engine/lore-events.mjs +0 -197
  143. package/engine/map-notes.mjs +0 -1309
  144. package/engine/map-raster.mjs +0 -51
  145. package/hugo-theme/layouts/partials/holdings/entry.html +0 -21
  146. package/hugo-theme/layouts/partials/holdings/kind-groups.html +0 -71
  147. package/hugo-theme/layouts/partials/holdings.html +0 -61
  148. package/hugo-theme/layouts/partials/literature-works.html +0 -29
  149. package/hugo-theme/layouts/partials/place-map.html +0 -9
  150. package/types/engine/itinerary-scenes.d.mts +0 -29
  151. package/types/engine/lore-events.d.mts +0 -14
  152. package/types/engine/map-notes.d.mts +0 -297
  153. package/types/engine/map-raster.d.mts +0 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,63 @@
1
1
  # @heroiclands/package-build
2
2
 
3
+ ## 23.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ **Before you upgrade**
8
+
9
+ - Every address in the published content index is an object of `address`, `anchor` and `anchorKind`, so build a package and every package it depends on with this version. SQL tables still show addresses as plain text.
10
+ - An affiliation's `data.domains` is an error; state government on each place as `data.government`.
11
+ - A being's `social` block is gone. Record a being's occupation as `data.occupation`; the block's other keys have no replacement.
12
+
13
+ **Notes and data fields**
14
+
15
+ - A `data:` field refuses keys it does not declare, however deeply nested, pointing at the misspelled key and suggesting the nearest real one.
16
+ - Lint catches a fraction in a month's length, a season or named day, an era's start or a rank, and an affiliation relation other than `aligned`, `unaligned`, `rival` or `nemesis`, each at the value.
17
+ - `harnworld` takes only `realm` and `ritual`.
18
+
19
+ **Events**
20
+
21
+ - Places, beings, peoples, affiliations and history notes can carry events — a battle, a settlement's raising, an order's founding — each checked in full, with any key, value or address the format does not admit reported at its line.
22
+ - Each address in an event names the kind of note it describes: a participant is a being, affiliation or lore note, and a place is a place.
23
+ - A note holding several events gives each an `id`; `follows` and `attributedTo` name one as `place-ironfells#sack`, and `follows` never points forward or loops. No other address field takes a `#` anchor, and a wikilink to an event's `id` is an error.
24
+ - Content tables read every note's events with `FROM events`, one row per event, ordered by date with `whenSort`; a note prints an event's date, kind, summary or name inline with `{{ref "place-ironfells#sack" field="when"}}`.
25
+ - Gear names the event of its making and loss with `made` and `lost`, and a work of literature names the event it concerns in `subjects`.
26
+
27
+ **Generated sections**
28
+
29
+ - Notes end with sections the build writes from the rest of the content, on the website, in Foundry journals and in the book: _Within_, _Governed by_, _Governed places_, _Chronology_, _Events_, _Accounts_, _What followed_, _In song and story_ and _From here_, the map from a place.
30
+ - Writing your own section with the same anchor, such as `{#chronology}`, replaces the generated one, and a section with nothing to list does not appear.
31
+
32
+ **The book**
33
+
34
+ - The book ends with an Index: every note under its name, with its entry page in bold and the pages that mention it, and aliases and event names pointing to the main name.
35
+ - In a generated section, a name the book prints shows the page its entry starts on, and a name the book leaves out is plain text.
36
+ - Each place's map prints once, inside its entry, and every map's picture comes from its exported Scene's level backgrounds with `data.fixup` applied.
37
+
38
+ **Maps**
39
+
40
+ - A map note carries a Scene exported from Foundry in `data.scene`, on every map subtype; draw walls, lights, sounds, regions and pins in Foundry's Scene editor.
41
+ - A map note's `data` takes only `scene`, `fixup` and `place`; any other map setting written in the note, or map geometry under the system block, is an error. Nothing inside the exported Scene is checked.
42
+ - Itinerary Scenes are no longer produced in Foundry.
43
+
44
+ **Infobox**
45
+
46
+ - A field whose value holds named keys shows each key as its row's label, with units exactly as written. HârnWorld details, compendium routing, calendar definitions and events stay out of it.
47
+ - Each of a being's affiliations is its own line under an _Affiliations_ heading, such as _War Chief, Hárár (5), of Vrystwald Tribes_.
48
+
49
+ **For site maintainers**
50
+
51
+ - The theme's government, literature and map cards are gone; these lists render as ordinary page sections, so a site that styled the cards restyles them as sections.
52
+
53
+ ### Patch Changes
54
+
55
+ **Fixes**
56
+
57
+ - A heading marked `.secret` withholds its section in any note with frontmatter, rather than being refused as opening no page.
58
+ - In Foundry, a captioned poem, table, quote or picture gets a journal page of its own, the text after it continues under its section's name, and a caption containing a link names its page by the words a reader sees.
59
+ - A captioned item inside a GM-only section is GM-only in Foundry too.
60
+
3
61
  ## 23.0.0
4
62
 
5
63
  ### Major Changes
package/README.md CHANGED
@@ -46,7 +46,7 @@ The documentation lives in the Markdown files in this repository. Start with [th
46
46
  | Error locations and severities | [Diagnostics](docs/diagnostics.md) |
47
47
  | Architectural rationale | [Design](docs/design.md) |
48
48
 
49
- Place notes may declare a governing affiliation with `data.government` (`Address`, default target type `affiliation`), or explicit `null` for complete anarchy. Positive population with an omitted government produces an advisory. See [place governments](docs/authoring/frontmatter.md#place-governments) and [government migration](docs/guides/government-migration.md).
49
+ Place notes may declare a governing affiliation with `data.government` (`Address`, default target type `affiliation`), or explicit `null` for complete anarchy. Positive population with an omitted government produces an advisory. See [place governments](docs/authoring/frontmatter.md#place-governments).
50
50
 
51
51
  Leading captions, generic fenced divs, inline spans, and poetry code fences are described in [links and markup](docs/authoring/links-and-markup.md).
52
52
 
@@ -1559,7 +1559,7 @@ function linksCommand() {
1559
1559
  ...positionOfLiteral(d.note.raw, d.text, d.occurrence),
1560
1560
  severity: "error",
1561
1561
  message: linkFindingMessage({
1562
- reason: "unknown-anchor",
1562
+ reason: d.reason,
1563
1563
  target: d.target,
1564
1564
  anchor: d.anchor,
1565
1565
  }),
@@ -28,6 +28,50 @@ const fields = (list) =>
28
28
  (field) =>
29
29
  `| \`data.${cell(field.name)}\` | ${cell(field.shape ?? field.kind ?? "value")} | ${cell(field.describe)} |`,
30
30
  );
31
+ /**
32
+ * Every inner key a list of field declarations states, at every depth, as
33
+ * table rows — the keys of a map value, of each entry of a list, and of each
34
+ * value of a keyed map.
35
+ *
36
+ * @param {readonly object[]} list - Field declarations.
37
+ * @returns {string[]} The rows, or none where no field holds maps.
38
+ */
39
+ const innerKeys = (list) => {
40
+ const out = [];
41
+ const walk = (spec, at) => {
42
+ for (const inner of spec.fields ?? []) {
43
+ const key = `${at}.${inner.name}`;
44
+ out.push(
45
+ `| \`${cell(key)}\` | ${cell(inner.shape ?? inner.kind ?? "value")} | ${
46
+ inner.required ? "yes" : "no"
47
+ } | ${cell(inner.describe)} |`,
48
+ );
49
+ walk(inner, key);
50
+ }
51
+ if (spec.entries) walk(spec.entries, `${at}[]`);
52
+ if (spec.values) {
53
+ const placeholder =
54
+ spec.keyKind === "address" ? "<Address>"
55
+ : spec.keyKind === "shortcode" ? "<Shortcode>"
56
+ : "<name>";
57
+ walk(spec.values, `${at}.${placeholder}`);
58
+ }
59
+ };
60
+ for (const field of list) walk(field, `data.${field.name}`);
61
+ return out;
62
+ };
63
+ const innerKeyTable = (list) => {
64
+ const keyRows = innerKeys(list);
65
+ if (!keyRows.length) return [];
66
+ return [
67
+ "**Inner keys** — a key a field's value does not declare is an error at its own line and column.",
68
+ "",
69
+ "| Key | Shape | Required | Meaning |",
70
+ "| --- | --- | --- | --- |",
71
+ ...keyRows,
72
+ "",
73
+ ];
74
+ };
31
75
  const rows = [
32
76
  "---",
33
77
  "shortcode: referencenotetypes",
@@ -60,6 +104,7 @@ const rows = [
60
104
  "| --- | --- | --- |",
61
105
  ...fields(SHARED_DATA_FIELDS),
62
106
  "",
107
+ ...innerKeyTable(SHARED_DATA_FIELDS),
63
108
  "## Type-specific fields",
64
109
  "",
65
110
  ];
@@ -88,6 +133,7 @@ for (const [type, spec] of contract.types) {
88
133
  : ["| — | — | No type-specific `data` fields. |"]),
89
134
  );
90
135
  rows.push("");
136
+ rows.push(...innerKeyTable(declared.data ?? []));
91
137
  const claims = contract.claims.filter((claim) => !claim.shared && claim.noteType === type);
92
138
  if (claims.length) {
93
139
  rows.push("**System mappings**", "", "| Source | System | Target |", "| --- | --- | --- |");