@heroiclands/package-build 22.4.4 → 22.4.6
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 +24 -0
- package/CONTENT.md +30 -1
- package/README.md +9 -0
- package/bin/content-build.mjs +163 -0
- package/bin/package-build.mjs +18 -4
- package/content-config.mjs +7 -0
- package/docs/api.md +88 -0
- package/docs/commands.md +222 -2
- package/docs/configuration.md +19 -1
- package/docs/content-format.md +105 -6
- package/docs/diagnostics.md +1 -0
- package/docs/project-setup.md +7 -6
- package/engine/frontmatter-lint.mjs +11 -1
- package/engine/index.mjs +18 -0
- package/engine/map-build.mjs +270 -0
- package/engine/map-dot.mjs +745 -0
- package/engine/map-graphviz.mjs +138 -0
- package/engine/map-layout.mjs +894 -0
- package/engine/map-places.mjs +561 -0
- package/engine/metadata-index.mjs +7 -0
- package/engine/note-vocabulary.mjs +28 -0
- package/engine/place-relations.mjs +637 -0
- package/engine/site-config.mjs +1 -1
- package/engine/site-root.mjs +147 -6
- package/package.json +3 -2
- package/types/engine/index.d.mts +6 -0
- package/types/engine/map-build.d.mts +84 -0
- package/types/engine/map-dot.d.mts +143 -0
- package/types/engine/map-graphviz.d.mts +61 -0
- package/types/engine/map-layout.d.mts +427 -0
- package/types/engine/map-places.d.mts +259 -0
- package/types/engine/note-vocabulary.d.mts +12 -0
- package/types/engine/place-relations.d.mts +95 -0
- package/types/engine/site-config.d.mts +1 -1
- package/types/engine/site-root.d.mts +59 -7
package/docs/commands.md
CHANGED
|
@@ -261,7 +261,8 @@ package-build: `packageKind: documentation` ships no Foundry package, so there i
|
|
|
261
261
|
|
|
262
262
|
**NAME**
|
|
263
263
|
|
|
264
|
-
`package-build site-root` — write the deployment's `_headers
|
|
264
|
+
`package-build site-root` — write the deployment's `_headers`, and index the
|
|
265
|
+
site for search.
|
|
265
266
|
|
|
266
267
|
**SYNOPSIS**
|
|
267
268
|
|
|
@@ -294,6 +295,29 @@ it.
|
|
|
294
295
|
The rules are scoped to those hostnames, so a site deployed under a domain of
|
|
295
296
|
its own stays indexable.
|
|
296
297
|
|
|
298
|
+
With `_headers` written, the rendered site is indexed for search. Pagefind
|
|
299
|
+
reads every page under `<out>/<contentPackage>/` and writes the index into
|
|
300
|
+
`<out>/<contentPackage>/pagefind/`, so it is deployed with the pages and served
|
|
301
|
+
at `/<contentPackage>/pagefind/`; the theme loads `pagefind.js` from there,
|
|
302
|
+
relative to the site's base URL, and the browser bundle derives the prefix from
|
|
303
|
+
its own address, so nothing about the prefix is configured on either side. What
|
|
304
|
+
is indexed is the body of every page and the homepage; the theme marks its own
|
|
305
|
+
chrome — header, footer, breadcrumbs, infobox, the related-pages card —
|
|
306
|
+
`data-pagefind-ignore`, and carries `data-pagefind-filter` attributes for a
|
|
307
|
+
page's `type` and `package`, so a search can be narrowed to one kind of page.
|
|
308
|
+
This command's part is only to run the indexer over whatever the theme
|
|
309
|
+
rendered.
|
|
310
|
+
|
|
311
|
+
The indexer is the `pagefind` package this toolchain depends on, which installs
|
|
312
|
+
the binary for the platform as an optional dependency; nothing goes on a
|
|
313
|
+
`PATH`. Every failure of the step is an error located at the rendered site —
|
|
314
|
+
`build/site/<contentPackage>: error: search index: …` — and a binary that is
|
|
315
|
+
not installed names the platform package `npm ci` installs.
|
|
316
|
+
|
|
317
|
+
[`site.search: false`](configuration.md#site) skips the step, and removes a
|
|
318
|
+
`pagefind/` an earlier build left beside the pages, so a site that wants no
|
|
319
|
+
search deploys none.
|
|
320
|
+
|
|
297
321
|
**OPTIONS**
|
|
298
322
|
|
|
299
323
|
`--out <dir>` — the directory that is deployed. Defaults to `build/site`.
|
|
@@ -302,13 +326,20 @@ its own stays indexable.
|
|
|
302
326
|
|
|
303
327
|
1 when `<out>/<contentPackage>/` holds no rendered site, which means the site
|
|
304
328
|
build has not run and writing root files would publish a deployment with nothing
|
|
305
|
-
under the prefix. Otherwise 0.
|
|
329
|
+
under the prefix; 1 when the index cannot be built. Otherwise 0.
|
|
306
330
|
|
|
307
331
|
**EXAMPLES**
|
|
308
332
|
|
|
309
333
|
```
|
|
310
334
|
$ package-build site-root
|
|
311
335
|
✅ Wrote build/site/_headers.
|
|
336
|
+
✅ Indexed 412 pages for search into build/site/thalorna/pagefind/.
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
```
|
|
340
|
+
$ package-build site-root
|
|
341
|
+
✅ Wrote build/site/_headers.
|
|
342
|
+
Search is off (`site.search: false`), so no index was written.
|
|
312
343
|
```
|
|
313
344
|
|
|
314
345
|
**SEE ALSO**
|
|
@@ -1829,6 +1860,195 @@ demo-book: error: the document tree named by `pdf.document` cannot be read
|
|
|
1829
1860
|
`content-build site`, `content-build package <action> [pack] [entry]`,
|
|
1830
1861
|
[Diagnostics](diagnostics.md), [Configuration](configuration.md).
|
|
1831
1862
|
|
|
1863
|
+
### `content-build map`
|
|
1864
|
+
|
|
1865
|
+
**NAME**
|
|
1866
|
+
|
|
1867
|
+
Draw the containment tree, the map or the chart from a place, or the whole
|
|
1868
|
+
route graph.
|
|
1869
|
+
|
|
1870
|
+
**SYNOPSIS**
|
|
1871
|
+
|
|
1872
|
+
```
|
|
1873
|
+
content-build map --tree [--root <shortcode>] [--engine dot|twopi|neato] [--rankdir TB|LR|BT|RL]
|
|
1874
|
+
[--nodesep <inches>] [--ranksep <inches>] [--no-polities]
|
|
1875
|
+
content-build map --from <shortcode>.. | --from all
|
|
1876
|
+
content-build map --chart <shortcode>.. | --chart all [--horizon <days>]
|
|
1877
|
+
content-build map --travel
|
|
1878
|
+
content-build map [...] [--scale <factor>] [--base <url>] [--out <dir>]
|
|
1879
|
+
```
|
|
1880
|
+
|
|
1881
|
+
**DESCRIPTION**
|
|
1882
|
+
|
|
1883
|
+
Draws what the place notes state. Every drawing is read from the content
|
|
1884
|
+
index — this package's records and every declared dependency's fetched
|
|
1885
|
+
index — so a consumer's map draws its dependencies' places beside its own
|
|
1886
|
+
and no note is opened except to locate a finding. Everything lands under
|
|
1887
|
+
`build/map/`, always the `.dot` beside the `.svg`, so a drawing can be
|
|
1888
|
+
re-rendered, diffed or read without the index. GraphViz draws: `dot` (or
|
|
1889
|
+
`twopi`, `neato`) for the tree, `neato` for the others. It is a build-time
|
|
1890
|
+
tool of this command alone; when the engine a run needs is not installed
|
|
1891
|
+
the command says so, names what to install, and stops. A build that asks
|
|
1892
|
+
for maps as one step of a larger job — a site build — writes the `.dot`
|
|
1893
|
+
files, emits one warning and skips the renderings rather than failing.
|
|
1894
|
+
|
|
1895
|
+
The four drawings, any of which may be asked for in one run:
|
|
1896
|
+
|
|
1897
|
+
**`--tree`** — the author's check. The containment tree from `data.parents`,
|
|
1898
|
+
edges running child → parent, clustered by continent — a `region` parented
|
|
1899
|
+
directly on the `world` note — with the places reaching no continent
|
|
1900
|
+
floating outside every cluster. Node shape, colour and size are by
|
|
1901
|
+
`subType` (a gold double circle for the world, a blue box for a region, a
|
|
1902
|
+
small green ellipse for a settlement, a purple diamond for a site, a teal
|
|
1903
|
+
hexagon for a feature, an orange house for a structure), and a legend
|
|
1904
|
+
drawn from the same style table sits on every drawing. A `polity`
|
|
1905
|
+
affiliation is drawn as a grey dashed cylinder beside every region note in
|
|
1906
|
+
its own directory. Anomalies are highlighted and reported as findings: a
|
|
1907
|
+
place with **no parent** and a **placeholder for a parent shortcode no
|
|
1908
|
+
place declares** are filled red (errors); a place on a **cycle** is
|
|
1909
|
+
outlined red (an error); a place with **more than one parent**, a region
|
|
1910
|
+
with **no `packFolder`** and a polity whose directory holds **no region
|
|
1911
|
+
note** are warnings. The world note has no parent by nature and is not a
|
|
1912
|
+
finding. Writes `tree.svg` for the whole world and `tree-<shortcode>.svg`
|
|
1913
|
+
for each continent; with `--root`, the subtree beneath that one place as
|
|
1914
|
+
`tree-<shortcode>.svg` — every place whose `parents` chain reaches it by
|
|
1915
|
+
any path — and no findings.
|
|
1916
|
+
|
|
1917
|
+
**`--from <shortcode>`** — the map from a place, `from-<shortcode>.svg`.
|
|
1918
|
+
Pre-modern maps were itineraries: partial, centred on their maker, exact
|
|
1919
|
+
about the next stage and vague about the tenth. A place's `borders` and
|
|
1920
|
+
`routes` are exactly that, so the reader's map is one map per place, from
|
|
1921
|
+
that place. The place sits at the centre, **north up, east right**. Every
|
|
1922
|
+
neighbour it states — or that states it, since a border or a route is one
|
|
1923
|
+
fact stated from each end — sits at the angle of its bearing and on the
|
|
1924
|
+
ring of its days, with an edge labelled by the bearing and days; a border
|
|
1925
|
+
is a dashed edge, and where several modes reach one place the label lists
|
|
1926
|
+
each. Beyond each neighbour, every place a second hop reaches is drawn
|
|
1927
|
+
dimmer at the composed bearing where the two hops agree — the same bearing
|
|
1928
|
+
or adjacent ones, added as vectors weighted by their days — on the ring of
|
|
1929
|
+
their total; where the hops disagree the place is omitted rather than
|
|
1930
|
+
guessed at. Nodes sharing a ring and a bearing are fanned apart. `all`
|
|
1931
|
+
draws the map from every place that states or is named in a border or a
|
|
1932
|
+
route. Positions are computed by the command and pinned, so `neato` only
|
|
1933
|
+
draws; nothing on the page is a solver's decision.
|
|
1934
|
+
|
|
1935
|
+
_The rings._ One faint dashed circle per marker of the days scale up to
|
|
1936
|
+
the horizon of 90 days — `1 2 3 5 10 20 30 45 60 90` — each labelled at
|
|
1937
|
+
its top, spaced logarithmically so that equal ratios of days are equal
|
|
1938
|
+
steps of radius: a day to two days is the same step as five to ten, and a
|
|
1939
|
+
day's ride and a month's voyage both fit on one page. A neighbour with a
|
|
1940
|
+
route sits on the ring of its shortest route's days. A neighbour reached by
|
|
1941
|
+
a border alone sits on the innermost ring, because a frontier states no
|
|
1942
|
+
distance. One more circle, the rim, lies a log step beyond the horizon:
|
|
1943
|
+
a place farther than 90 days, and a second hop whose days are unknown
|
|
1944
|
+
because either hop was a border, are a name at the rim carrying its days
|
|
1945
|
+
or `?` — beyond what the notes state, the map states nothing more.
|
|
1946
|
+
|
|
1947
|
+
_Two scales._ The generated map from a place is the default regional map:
|
|
1948
|
+
every place gets one at build time, from its `borders` and `routes`. An
|
|
1949
|
+
authored `regionalmap` note is an artefact of the setting — a road book, a
|
|
1950
|
+
sailor's chart, a tax survey, partial and from somewhere, whose prose says
|
|
1951
|
+
whose it is — and never the survey. The two are two sources of the same
|
|
1952
|
+
thing on a place's page.
|
|
1953
|
+
|
|
1954
|
+
**`--chart <shortcode>`** — the chart from a place, `chart-<shortcode>.svg`:
|
|
1955
|
+
the world-scale drawing chosen by viewpoint rather than projection — the
|
|
1956
|
+
sea from a port, the eastern roads from a caravan city. It is the same
|
|
1957
|
+
graph from the same place with a larger horizon: the centre pinned, north
|
|
1958
|
+
up and east right, the neighbours exactly as `--from` draws them, and
|
|
1959
|
+
beyond them the hops chaining on. Hops compose as a running vector sum
|
|
1960
|
+
weighted by their days, and a hop is accepted when its bearing lies within
|
|
1961
|
+
one octant — 45° either way — of the **running composed direction** at
|
|
1962
|
+
that point, not of the previous hop; so a path may bend a little at every
|
|
1963
|
+
hop, but never turn back, and a place reached only through a hop that
|
|
1964
|
+
turns back is omitted. Where several chains reach one place, the one with
|
|
1965
|
+
the fewest total days is drawn. The total is the sum of the hops' days,
|
|
1966
|
+
placed on the ring of the smallest marker not less than it. A border
|
|
1967
|
+
carries no days: on the first hop it sits on the innermost ring, as on the
|
|
1968
|
+
map from a place; beyond the first hop it makes the total unknown, the
|
|
1969
|
+
place goes to the rim marked unknown, and the chart states nothing beyond
|
|
1970
|
+
it. `all` draws the chart from every place that states or is named in a
|
|
1971
|
+
border or a route.
|
|
1972
|
+
|
|
1973
|
+
_The horizon._ `--horizon <days>`, a marker of the scale, `360` by default:
|
|
1974
|
+
one ring per marker up to and including it, on the same log spacing as the
|
|
1975
|
+
map from a place, so a chart to a year's travel is simply a larger page
|
|
1976
|
+
with more rings. A place whose total exceeds the horizon is omitted — the
|
|
1977
|
+
chart is already the larger view, and there is no "beyond" rim, only the
|
|
1978
|
+
unknown one, a log step past the horizon. `--horizon` applies to charts
|
|
1979
|
+
alone; the map from a place keeps its horizon of 90 days and its rim.
|
|
1980
|
+
|
|
1981
|
+
_The dimming._ The neighbours are drawn full, the second hop as the map
|
|
1982
|
+
from a place draws it — grey border and label, pale fill, faint edge —
|
|
1983
|
+
and each hop beyond a step fainter, never below half opacity, so the
|
|
1984
|
+
farthest place still reads. An edge is dimmed with its far end, and
|
|
1985
|
+
labelled with its bearing and days like any other.
|
|
1986
|
+
|
|
1987
|
+
**`--travel`** — the whole route graph, `travel.svg`, for the author: one
|
|
1988
|
+
undirected edge per pair of places, a border dashed, each route asking
|
|
1989
|
+
`neato` for a length on the same log scale as the rings so the god's-eye
|
|
1990
|
+
view and the itinerary agree about what a day and a month look like; the
|
|
1991
|
+
engine solves the positions.
|
|
1992
|
+
|
|
1993
|
+
Every node's label is the place's `name.full` and its tooltip the canonical
|
|
1994
|
+
address. With `--base`, every name is also a link — GraphViz writes an
|
|
1995
|
+
`<a href>` around it — to the page at `<base><slug>/` for this package's
|
|
1996
|
+
places and to the URL the fetched index resolved for a dependency's, so a
|
|
1997
|
+
page can inline the SVG. Without it the names are plain text.
|
|
1998
|
+
|
|
1999
|
+
**OPTIONS**
|
|
2000
|
+
|
|
2001
|
+
| Option | Type | Default | Description |
|
|
2002
|
+
| ------------ | ------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
2003
|
+
| `--tree` | boolean | `false` | Draw the containment tree: `tree.svg`, one `tree-<shortcode>.svg` per continent, and the findings. |
|
|
2004
|
+
| `--root` | string | — | With `--tree`, draw the subtree beneath this place as `tree-<shortcode>.svg` and report nothing. |
|
|
2005
|
+
| `--from` | string | — | Draw the map from this place as `from-<shortcode>.svg`; repeatable, or `all` for every place with a border or a route. |
|
|
2006
|
+
| `--chart` | string | — | Draw the chart from this place as `chart-<shortcode>.svg` — the map from it at a larger horizon; repeatable, or `all`. |
|
|
2007
|
+
| `--horizon` | number | `360` | The charts' horizon in days, a marker of the scale: rings are drawn to it, and a place farther than it is left out. |
|
|
2008
|
+
| `--travel` | boolean | `false` | Draw the whole route graph as `travel.svg`. |
|
|
2009
|
+
| `--engine` | choice | `dot` | The tree's layout engine — `dot`, `twopi` (radial, rooted on the world or the `--root`) or `neato`. The other drawings are always `neato`. |
|
|
2010
|
+
| `--rankdir` | choice | `TB` | The tree's rank direction — `TB`, `LR`, `BT` or `RL`; `dot` engine only. |
|
|
2011
|
+
| `--nodesep` | number | by `--scale` | The tree's GraphViz `nodesep`, in inches. |
|
|
2012
|
+
| `--ranksep` | number | by engine | The tree's GraphViz `ranksep`, in inches. |
|
|
2013
|
+
| `--scale` | number | `1` | Multiply every node's width, height, font size and border weight, the legend's included. |
|
|
2014
|
+
| `--polities` | boolean | `true` | Draw polities beside their regions in the tree. `--no-polities` drops them. |
|
|
2015
|
+
| `--base` | string | — | The site base this package's pages are served under, ending in a slash; given, every name is a link to its page. |
|
|
2016
|
+
| `--out` | string | `build/map` | Directory to write into, relative to the working directory. |
|
|
2017
|
+
|
|
2018
|
+
**EXIT STATUS**
|
|
2019
|
+
|
|
2020
|
+
1 when no drawing is asked for, when a `--from`, `--chart` or `--root`
|
|
2021
|
+
names no place, when `--horizon` is not a marker of the days scale, when
|
|
2022
|
+
the GraphViz engine a drawing needs is not installed, when a
|
|
2023
|
+
dependency's index cannot be read, when a note the index cannot record is
|
|
2024
|
+
met, on any error finding from `--tree` (a place with no parent, a parent
|
|
2025
|
+
that does not resolve, a cycle), or on any other thrown error. Otherwise 0
|
|
2026
|
+
— the warnings are reported and never fail the command.
|
|
2027
|
+
|
|
2028
|
+
**EXAMPLES**
|
|
2029
|
+
|
|
2030
|
+
```
|
|
2031
|
+
$ content-build map --tree
|
|
2032
|
+
assets/content/Regions/Sea.md:16:5: warning: place "innersea" has more than one parent (northc, southc), which is legal for a sea between continents or a region split between two, and worth a look otherwise
|
|
2033
|
+
assets/content/Regions/Marches/Lost_Fort.md:9:14: error: place "lostfort" names parent "marchs", which does not resolve to any place in this package or a fetched index
|
|
2034
|
+
[…] 394 place(s) → 7 drawing(s) under build/map
|
|
2035
|
+
|
|
2036
|
+
$ content-build map --from dunharargn --base /thalorna/
|
|
2037
|
+
[…] 394 place(s) → 1 drawing(s) under build/map
|
|
2038
|
+
|
|
2039
|
+
$ content-build map --chart takheperurgn --horizon 90
|
|
2040
|
+
[…] 394 place(s) → 1 drawing(s) under build/map
|
|
2041
|
+
|
|
2042
|
+
$ content-build map --travel
|
|
2043
|
+
[…] GraphViz's `neato` is not installed, and `content-build map` draws with it; install GraphViz (`brew install graphviz` on macOS, `apt-get install graphviz` on Debian or Ubuntu) and run the command again
|
|
2044
|
+
```
|
|
2045
|
+
|
|
2046
|
+
**SEE ALSO**
|
|
2047
|
+
|
|
2048
|
+
`content-build lint [root]` (which checks `borders` and `routes` from both
|
|
2049
|
+
ends), `content-build deps fetch`, `content-build content-index [root]`,
|
|
2050
|
+
[Content format](content-format.md), [Diagnostics](diagnostics.md).
|
|
2051
|
+
|
|
1832
2052
|
### `content-build reachability <dir> [file]`
|
|
1833
2053
|
|
|
1834
2054
|
**NAME**
|
package/docs/configuration.md
CHANGED
|
@@ -769,6 +769,7 @@ Any other key under `docs.itemFields` is refused:
|
|
|
769
769
|
| `site.passOptions` | object | `{}` |
|
|
770
770
|
| `site.notfound` | object | `null` |
|
|
771
771
|
| `site.hugo` | object | `{}` |
|
|
772
|
+
| `site.search` | boolean | `true` |
|
|
772
773
|
|
|
773
774
|
How much of a package reaches the web at all is **not** here — it is
|
|
774
775
|
[`publish.site`](#publish). `site` is framing: which named pass bundle
|
|
@@ -818,7 +819,7 @@ published. A `site.out` is refused by name:
|
|
|
818
819
|
|
|
819
820
|
> ``package-build config: `site` must be a mapping.``
|
|
820
821
|
|
|
821
|
-
> ``package-build config: `site.<key>` is not a recognized option (expected one of: base, assets, description, packages, pass, passOptions, notfound, hugo).``
|
|
822
|
+
> ``package-build config: `site.<key>` is not a recognized option (expected one of: base, assets, description, packages, pass, passOptions, notfound, hugo, search).``
|
|
822
823
|
|
|
823
824
|
`site.assets` is the host every package's imagery is served from, and it is
|
|
824
825
|
the one address in this file that is not this repository's own. A note names
|
|
@@ -932,6 +933,23 @@ the block cannot grow into a second configuration file:
|
|
|
932
933
|
|
|
933
934
|
> ``package-build config: `site.hugo.baseURL` is derived from package.json `homepage` and must not be declared — it would be overwritten, and the two would disagree with nothing to say so.``
|
|
934
935
|
|
|
936
|
+
`site.search` is whether the rendered site carries a search index. On by
|
|
937
|
+
default: `package-build site-root` runs Pagefind over the rendered pages after
|
|
938
|
+
it writes `_headers`, and the index lands beside them as
|
|
939
|
+
`build/site/<contentPackage>/pagefind/`, served at `/<contentPackage>/pagefind/`
|
|
940
|
+
with the rest of the site. The theme loads it relative to the site's base URL
|
|
941
|
+
and renders the search box; what is indexed is the body of every page, with the
|
|
942
|
+
theme's own chrome marked out. `false` skips the step and removes an index an
|
|
943
|
+
earlier build left, so a site that wants no search deploys none. See
|
|
944
|
+
[`package-build site-root`](commands.md#package-build-site-root).
|
|
945
|
+
|
|
946
|
+
```yaml
|
|
947
|
+
site:
|
|
948
|
+
search: false
|
|
949
|
+
```
|
|
950
|
+
|
|
951
|
+
> ``package-build config: `site.search` must be a boolean.``
|
|
952
|
+
|
|
935
953
|
### The generated Hugo configuration
|
|
936
954
|
|
|
937
955
|
`content-build site` writes `build/hugo/hugo.toml` on every run. Every value
|
package/docs/content-format.md
CHANGED
|
@@ -3081,12 +3081,111 @@ three maps, and none of those maps needs to know it is a keep.
|
|
|
3081
3081
|
- structure: A single building or habitation — halls, keeps, temples, inns, towers.
|
|
3082
3082
|
- feature: A place significant by its terrain — forests, rivers, falls, passes, fords.
|
|
3083
3083
|
|
|
3084
|
-
| `data` property | Values
|
|
3085
|
-
| --------------- |
|
|
3086
|
-
| `demonym` | `string`
|
|
3087
|
-
| `lore` | `WikiLink[]`
|
|
3088
|
-
| `parents` | `WikiLink[]`
|
|
3089
|
-
| `population` | `number`
|
|
3084
|
+
| `data` property | Values | Description |
|
|
3085
|
+
| --------------- | --------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
3086
|
+
| `demonym` | `string` | What a person from this place is called — a Vylarian |
|
|
3087
|
+
| `lore` | `WikiLink[]` | Lore concerning this place — its peoples, its law, its calendar, its history |
|
|
3088
|
+
| `parents` | `WikiLink[]` | Enclosing places within which this place is located |
|
|
3089
|
+
| `population` | `number` | Approximate population (precision 2 significant digits) |
|
|
3090
|
+
| `borders` | `{ to, bearing }[]` | Places sharing a frontier with this one, and where each lies from here |
|
|
3091
|
+
| `routes` | `{ to, bearing, mode, days, terrain?, leagues? }[]` | Journeys from this place's centre to another place |
|
|
3092
|
+
|
|
3093
|
+
#### Where a place is, in relation to other places
|
|
3094
|
+
|
|
3095
|
+
`parents` states what a place is **within**. Two more properties state what
|
|
3096
|
+
it is **next to** and what it is **reachable from**, as data rather than as
|
|
3097
|
+
prose, so that two notes describing one frontier cannot quietly disagree about
|
|
3098
|
+
which side of it each is on:
|
|
3099
|
+
|
|
3100
|
+
```yaml
|
|
3101
|
+
data:
|
|
3102
|
+
borders: # places sharing a frontier
|
|
3103
|
+
- { to: dunharargn, bearing: NE } # both required
|
|
3104
|
+
- { to: bethuargn, bearing: W }
|
|
3105
|
+
routes: # journeys from this place's centre
|
|
3106
|
+
- { to: steinmark, bearing: SW, mode: land, days: 3, terrain: [road, mountains] }
|
|
3107
|
+
- { to: denizara, bearing: W, mode: ship, days: 5 }
|
|
3108
|
+
- { to: kethramir, bearing: E, mode: land, days: 30, terrain: [dunes], leagues: 90 }
|
|
3109
|
+
```
|
|
3110
|
+
|
|
3111
|
+
- `to` — required; the `shortcode` of a `place` note in this package or in a
|
|
3112
|
+
declared dependency's index. A shortcode, not an address.
|
|
3113
|
+
- `bearing` — required; where the neighbour or the destination lies from here.
|
|
3114
|
+
- `mode` — required on a route; how the journey is travelled.
|
|
3115
|
+
- `days` — required on a route; a marker meaning "about this, under normal
|
|
3116
|
+
conditions", from the scale below. Any other value is an error.
|
|
3117
|
+
- `terrain` — optional on a route; the terrains crossed, in travel order, from
|
|
3118
|
+
the registry below. Each terrain names the modes that cross it, so open sea
|
|
3119
|
+
on a land route — or a road on a ship route — is an error.
|
|
3120
|
+
- `leagues` — optional on a route; a distance, only where the note states one.
|
|
3121
|
+
|
|
3122
|
+
**Regions border; settlements are days apart.** A frontier is a fact about two
|
|
3123
|
+
regions, and a journey is a fact about two places a traveller sets out from and
|
|
3124
|
+
arrives at. A pair appears in `routes` once per `mode` — a port and its
|
|
3125
|
+
neighbour may be three days by land and one by ship — and in `borders` once.
|
|
3126
|
+
**A place never borders its own parent or child**: containment is `parents`,
|
|
3127
|
+
and restating it as adjacency makes the two contradict each other.
|
|
3128
|
+
|
|
3129
|
+
**Both ends state the relation, and `content-build lint` checks that they
|
|
3130
|
+
agree.** A border at `NE` from one side is a border at `SW` from the other; a
|
|
3131
|
+
route stated by land in three days from one side is stated by land in three
|
|
3132
|
+
days from the other, at the opposite bearing. A neighbour that states nothing
|
|
3133
|
+
back is a warning naming both notes — the pair is half-written, not wrong. A
|
|
3134
|
+
neighbour that states a different bearing, a different `days` or a different
|
|
3135
|
+
`mode` is an error, because one of the two notes is wrong and a reader cannot
|
|
3136
|
+
tell which. Every `to` must resolve to a place, every value must come from its
|
|
3137
|
+
closed set, and each finding is located at the entry that states it.
|
|
3138
|
+
|
|
3139
|
+
| `bearing` value | where the other place lies |
|
|
3140
|
+
| --------------- | -------------------------- |
|
|
3141
|
+
| `N` | north |
|
|
3142
|
+
| `NE` | north-east |
|
|
3143
|
+
| `E` | east |
|
|
3144
|
+
| `SE` | south-east |
|
|
3145
|
+
| `S` | south |
|
|
3146
|
+
| `SW` | south-west |
|
|
3147
|
+
| `W` | west |
|
|
3148
|
+
| `NW` | north-west |
|
|
3149
|
+
|
|
3150
|
+
| `mode` value | travelled |
|
|
3151
|
+
| ------------ | ---------------------------- |
|
|
3152
|
+
| `land` | on foot, mounted, or by cart |
|
|
3153
|
+
| `boat` | on a river or a lake |
|
|
3154
|
+
| `ship` | on open sea |
|
|
3155
|
+
|
|
3156
|
+
| `days` value | meaning |
|
|
3157
|
+
| ------------ | -------------------------------------------- |
|
|
3158
|
+
| `1` | a day |
|
|
3159
|
+
| `2` | two days |
|
|
3160
|
+
| `3` | three days |
|
|
3161
|
+
| `5` | about five days |
|
|
3162
|
+
| `10` | a ten-day week |
|
|
3163
|
+
| `20` | two ten-day weeks |
|
|
3164
|
+
| `30` | three ten-day weeks |
|
|
3165
|
+
| `45` | a month and a half |
|
|
3166
|
+
| `60` | two months |
|
|
3167
|
+
| `90` | a season |
|
|
3168
|
+
| `180` | many months |
|
|
3169
|
+
| `360` | who knows — a journey nobody reckons in days |
|
|
3170
|
+
|
|
3171
|
+
| `terrain` value | crossed by |
|
|
3172
|
+
| --------------- | ------------------ |
|
|
3173
|
+
| `road` | land |
|
|
3174
|
+
| `track` | land |
|
|
3175
|
+
| `plain` | land |
|
|
3176
|
+
| `steppe` | land |
|
|
3177
|
+
| `hills` | land |
|
|
3178
|
+
| `mountains` | land |
|
|
3179
|
+
| `forest` | land |
|
|
3180
|
+
| `jungle` | land |
|
|
3181
|
+
| `marsh` | land |
|
|
3182
|
+
| `dunes` | land |
|
|
3183
|
+
| `desert` | land |
|
|
3184
|
+
| `ice` | land |
|
|
3185
|
+
| `coast` | land, boat or ship |
|
|
3186
|
+
| `open-sea` | ship |
|
|
3187
|
+
| `river` | boat |
|
|
3188
|
+
| `lake` | boat |
|
|
3090
3189
|
|
|
3091
3190
|
**A place declares only what is true of ground.** Four properties were removed
|
|
3092
3191
|
because they were true of something else, and each removal has a home to go to.
|
package/docs/diagnostics.md
CHANGED
|
@@ -242,6 +242,7 @@ over one would teach people to stop reading the report.
|
|
|
242
242
|
| `content-build markdown [paths..]` | it reports any markdownlint finding |
|
|
243
243
|
| `content-build site` | any gate finding (no homepage, a wikilink in frontmatter, an address that cannot be derived, an unusable or unaddressable foreign manifest, a conflicting address) or any table or wikilink error while writing pages — the run stops at the first gate that fires |
|
|
244
244
|
| `content-build pdf` | it could not build the book for a reason other than a deliberate no-op — never on a reported finding by itself |
|
|
245
|
+
| `content-build map` | `--tree` reports an `error`-severity finding (a place with no parent, a parent that does not resolve, a cycle), a named place is not one, the GraphViz engine a drawing needs is not installed, or the corpus cannot be indexed — never on a warning |
|
|
245
246
|
| `content-build docs item-fields --check` | the generated page differs from what is committed |
|
|
246
247
|
| `content-build package compile` | pack JSON generation reported any `error`-severity finding (checked, and the compile refused, before any pack is written), or a compiled pack fails its Scene/Level integrity check |
|
|
247
248
|
| `content-build deps fetch` | the fetch itself throws — it emits no diagnostics |
|
package/docs/project-setup.md
CHANGED
|
@@ -263,12 +263,13 @@ package carries this group:
|
|
|
263
263
|
`build:site-content` writes the whole Hugo source tree under `build/hugo/` —
|
|
264
264
|
the generated `hugo.toml` and the content mount — with `content-build site`;
|
|
265
265
|
`build:site-html` runs Hugo over it, rendering into `build/site/<contentPackage>/`;
|
|
266
|
-
`build:site-root` writes the deployment's `_headers` beside
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
266
|
+
`build:site-root` writes the deployment's `_headers` beside that and indexes
|
|
267
|
+
the rendered pages for search into `build/site/<contentPackage>/pagefind/`;
|
|
268
|
+
and `serve:site` does the first and then `hugo server` for a live preview.
|
|
269
|
+
The repository carries no Hugo configuration of its own: `hugo.toml` is
|
|
270
|
+
generated on every run from `package.json`, `package-build.config.yaml`, the
|
|
271
|
+
installed `@heroiclands/hugo-theme` and the navigation `deps fetch` cached,
|
|
272
|
+
and the only file to add is `@heroiclands/hugo-theme` under
|
|
272
273
|
`devDependencies`. Hugo itself is a separate install — the extended edition,
|
|
273
274
|
on the developer's `PATH` and the runner's.
|
|
274
275
|
|
|
@@ -1403,17 +1403,27 @@ export function lintNote(
|
|
|
1403
1403
|
// to recognise it would be worse than not checking.
|
|
1404
1404
|
const entry = vocabulary?.[current];
|
|
1405
1405
|
if (entry) {
|
|
1406
|
+
const fields = dataFields(current, vocabulary) ?? [];
|
|
1406
1407
|
findings.push(
|
|
1407
1408
|
...checkDataContainer(note, {
|
|
1408
1409
|
type,
|
|
1409
1410
|
// Read through `dataFields`, so the keys **every** type accepts
|
|
1410
1411
|
// are part of what this type declares rather than a second list
|
|
1411
1412
|
// the container check would have to be told about.
|
|
1412
|
-
fields
|
|
1413
|
+
fields,
|
|
1413
1414
|
packs,
|
|
1414
1415
|
}),
|
|
1415
1416
|
);
|
|
1416
1417
|
findings.push(...checkSubType(note, { type, entry }));
|
|
1418
|
+
// A field that declares a check of its own, beyond its shape. Handed
|
|
1419
|
+
// the index the reference check resolves through, so a value naming
|
|
1420
|
+
// another note reads that note — local or in a fetched index — the
|
|
1421
|
+
// way a wikilink would. The linter names no such field itself; the
|
|
1422
|
+
// vocabulary does, beside the field.
|
|
1423
|
+
for (const field of fields) {
|
|
1424
|
+
if (typeof field.check !== "function") continue;
|
|
1425
|
+
findings.push(...field.check(note, { index }));
|
|
1426
|
+
}
|
|
1417
1427
|
}
|
|
1418
1428
|
|
|
1419
1429
|
const fields = authoredFields(schema);
|
package/engine/index.mjs
CHANGED
|
@@ -84,6 +84,24 @@ export * as noteSchemas from "./note-schemas.mjs";
|
|
|
84
84
|
/** The closed frontmatter regions: the `data:` container and each type's `subType`. */
|
|
85
85
|
export * as noteVocabulary from "./note-vocabulary.mjs";
|
|
86
86
|
|
|
87
|
+
/** What a place is next to and reachable from: the closed sets, and the checks. */
|
|
88
|
+
export * as placeRelations from "./place-relations.mjs";
|
|
89
|
+
|
|
90
|
+
/** The places a map is drawn from, read from the content index, and what `parents` says about them. */
|
|
91
|
+
export * as mapPlaces from "./map-places.mjs";
|
|
92
|
+
|
|
93
|
+
/** The geometry of the map from a place: bearings to angles, days to rings, hops composed. */
|
|
94
|
+
export * as mapLayout from "./map-layout.mjs";
|
|
95
|
+
|
|
96
|
+
/** The three drawings of `content-build map`, as DOT. */
|
|
97
|
+
export * as mapDot from "./map-dot.mjs";
|
|
98
|
+
|
|
99
|
+
/** GraphViz, as the map command finds and runs it. */
|
|
100
|
+
export * as mapGraphviz from "./map-graphviz.mjs";
|
|
101
|
+
|
|
102
|
+
/** `content-build map`: the drawings, written under `build/map/`. */
|
|
103
|
+
export * as mapBuild from "./map-build.mjs";
|
|
104
|
+
|
|
87
105
|
/** The closed registry of system ids, and the `none` that stands for no system. */
|
|
88
106
|
export * as systems from "./systems.mjs";
|
|
89
107
|
|