@heroiclands/package-build 22.15.0 → 22.16.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 +103 -0
- package/README.md +39 -678
- package/bin/{content-build.mjs → content-commands.mjs} +197 -118
- package/bin/package-build.mjs +303 -42
- package/bin/report.mjs +1 -1
- package/ci/ci-docker.mjs +6 -3
- package/ci/ci-steps.mjs +6 -4
- package/ci/content-format-reference.mjs +106 -0
- package/config.mjs +22 -2
- package/content-config.mjs +74 -134
- package/docs/api.md +294 -234
- package/docs/authoring/assets.md +31 -0
- package/docs/authoring/dates-and-calendars.md +33 -0
- package/docs/authoring/first-note.md +48 -0
- package/docs/authoring/frontmatter.md +40 -0
- package/docs/authoring/links-and-markup.md +137 -0
- package/docs/commands.md +631 -162
- package/docs/configuration.md +176 -140
- package/docs/content-format.md +50 -4229
- package/docs/design.md +32 -0
- package/docs/diagnostics.md +29 -22
- package/docs/getting-started.md +21 -877
- package/docs/guides/book.md +153 -0
- package/docs/guides/e2e.md +143 -0
- package/docs/guides/icons.md +126 -0
- package/docs/guides/localization.md +120 -0
- package/docs/guides/module-project.md +915 -0
- package/docs/guides/packs.md +167 -0
- package/docs/guides/reference-pages.md +148 -0
- package/docs/guides/release-and-deploy.md +114 -0
- package/docs/guides/site.md +152 -0
- package/docs/guides/system-project.md +45 -0
- package/docs/index.md +16 -0
- package/docs/project-setup.md +54 -35
- package/docs/reference/format-details.md +4420 -0
- package/docs/reference/note-types.md +531 -0
- package/engine/address-render.mjs +26 -0
- package/engine/address.mjs +3 -20
- package/engine/anchors.mjs +15 -6
- package/engine/asset-bindings.mjs +6 -2
- package/engine/base-compiler.mjs +47 -11
- package/engine/being-measurements.mjs +70 -0
- package/engine/calendar-artifacts.mjs +1 -1
- package/engine/calendar-choice.mjs +32 -0
- package/engine/calendar-human.mjs +71 -0
- package/engine/calendar-notes.mjs +41 -3
- package/engine/calendars.mjs +8 -1
- package/engine/changelog-lint.mjs +2 -2
- package/engine/code-fences.mjs +23 -97
- package/engine/compile-corpus.mjs +6 -7
- package/engine/content-admonitions.mjs +114 -0
- package/engine/content-captions.mjs +181 -0
- package/engine/content-embeds.mjs +2 -2
- package/engine/content-footnotes.mjs +34 -0
- package/engine/content-format-check.mjs +2 -2
- package/engine/content-format.mjs +127 -73
- package/engine/content-format.yaml +745 -0
- package/engine/content-html.mjs +1 -1
- package/engine/content-icons.mjs +45 -92
- package/engine/content-images.mjs +22 -74
- package/engine/content-index.mjs +12 -3
- package/engine/content-links.mjs +21 -26
- package/engine/content-lint.mjs +1 -5
- package/engine/content-secrets.mjs +3 -1
- package/engine/content-tables.mjs +47 -1257
- package/engine/culture-choice.mjs +32 -0
- package/engine/date-conversion.mjs +47 -0
- package/engine/declaration-check.mjs +87 -0
- package/engine/docs-checks.mjs +140 -0
- package/engine/documentation-links.mjs +31 -0
- package/engine/exported-scene.mjs +1 -1
- package/engine/extension-attributes.mjs +74 -0
- package/engine/field-reference.mjs +1 -1
- package/engine/field-spec.mjs +4 -0
- package/engine/foreign-catalog.mjs +5 -5
- package/engine/format-generated.mjs +15 -0
- package/engine/foundry-entries.mjs +3 -1
- package/engine/frontmatter-lint.mjs +5 -1
- package/engine/frontmatter.mjs +10 -0
- package/engine/generate.mjs +2 -2
- package/engine/helpers.mjs +71 -117
- package/engine/homepage.mjs +2 -3
- package/engine/index-records.mjs +1 -0
- package/engine/index.mjs +18 -3
- package/engine/infobox-registry.mjs +3 -1
- package/engine/infobox.mjs +38 -20
- package/engine/item-compiler.mjs +10 -8
- package/engine/item-docs.mjs +7 -6
- package/engine/itinerary-scenes.mjs +4 -2
- package/engine/journals.mjs +51 -10
- package/engine/macros.mjs +1 -1
- package/engine/map-build.mjs +1 -1
- package/engine/map-dot.mjs +1 -1
- package/engine/map-raster.mjs +4 -2
- package/engine/markdown-expressions.mjs +117 -0
- package/engine/metadata-index.mjs +7 -3
- package/engine/note-addresses.mjs +1 -0
- package/engine/note-dates.mjs +283 -61
- package/engine/note-package.mjs +5 -25
- package/engine/note-state.mjs +6 -2
- package/engine/note-vocabulary.mjs +74 -19
- package/engine/number-words.mjs +75 -0
- package/engine/office-holders.mjs +188 -0
- package/engine/pack-config.mjs +2 -15
- package/engine/pack-router.mjs +24 -5
- package/engine/packages.mjs +3 -2
- package/engine/pathnames.mjs +21 -24
- package/engine/pdf-build.mjs +217 -55
- package/engine/pdf-fonts.mjs +2 -2
- package/engine/pdf-images.mjs +82 -0
- package/engine/pdf-render.mjs +174 -22
- package/engine/populations.mjs +3 -2
- package/engine/project-init.mjs +499 -0
- package/engine/prose-config.mjs +1 -1
- package/engine/prose-lint.mjs +7 -6
- package/engine/readability-lint.mjs +86 -0
- package/engine/reckoning-markers.mjs +205 -93
- package/engine/scenes.mjs +5 -2
- package/engine/schema-check.mjs +3 -3
- package/engine/site-build.mjs +87 -37
- package/engine/site-config.mjs +8 -8
- package/engine/site-index.mjs +4 -0
- package/engine/site-maps.mjs +1 -1
- package/engine/site-preview.mjs +19 -8
- package/engine/social-ties.mjs +5 -1
- package/engine/sql-tables.mjs +92 -22
- package/engine/web-wikilinks.mjs +15 -31
- package/engine/wikilink-syntax.mjs +4 -1
- package/engine/wikilinks.mjs +12 -14
- package/hm3/item-fields.mjs +1 -1
- package/hm3/items.mjs +12 -45
- package/index.mjs +2 -14
- package/manifest.mjs +31 -4
- package/markdownlint-config.mjs +1 -1
- package/package.json +32 -11
- package/prettier-config.mjs +1 -1
- package/sohl/being-info.mjs +3 -145
- package/sohl/index.mjs +1 -1
- package/sohl/infobox.mjs +2 -1
- package/sohl/item-builders.mjs +3 -27
- package/sohl/item-fields.mjs +61 -22
- package/sohl/kb-passes.mjs +2 -2
- package/sohl/note-schemas.mjs +0 -8
- package/stage.mjs +19 -0
- package/types/config.d.mts +12 -3
- package/types/content-config.d.mts +15 -81
- package/types/engine/address-render.d.mts +13 -0
- package/types/engine/address.d.mts +2 -11
- package/types/engine/anchors.d.mts +3 -4
- package/types/engine/asset-bindings.d.mts +9 -2
- package/types/engine/base-compiler.d.mts +1 -2
- package/types/engine/being-measurements.d.mts +16 -0
- package/types/engine/calendar-choice.d.mts +14 -0
- package/types/engine/calendar-human.d.mts +4 -0
- package/types/engine/calendar-notes.d.mts +2 -0
- package/types/engine/calendars.d.mts +5 -3
- package/types/engine/code-fences.d.mts +6 -72
- package/types/engine/compile-corpus.d.mts +1 -3
- package/types/engine/content-admonitions.d.mts +24 -0
- package/types/engine/content-captions.d.mts +45 -0
- package/types/engine/content-footnotes.d.mts +10 -0
- package/types/engine/content-format-check.d.mts +17 -4
- package/types/engine/content-format.d.mts +24 -11
- package/types/engine/content-icons.d.mts +14 -23
- package/types/engine/content-images.d.mts +2 -2
- package/types/engine/content-index.d.mts +9 -2
- package/types/engine/content-links.d.mts +3 -5
- package/types/engine/content-tables.d.mts +11 -140
- package/types/engine/culture-choice.d.mts +14 -0
- package/types/engine/date-conversion.d.mts +4 -0
- package/types/engine/declaration-check.d.mts +24 -0
- package/types/engine/docs-checks.d.mts +28 -0
- package/types/engine/documentation-links.d.mts +7 -0
- package/types/engine/exported-scene.d.mts +6 -2
- package/types/engine/extension-attributes.d.mts +14 -0
- package/types/engine/field-spec.d.mts +9 -0
- package/types/engine/format-generated.d.mts +7 -0
- package/types/engine/frontmatter.d.mts +14 -4
- package/types/engine/generate.d.mts +1 -1
- package/types/engine/helpers.d.mts +37 -92
- package/types/engine/homepage.d.mts +2 -3
- package/types/engine/index.d.mts +5 -0
- package/types/engine/infobox-registry.d.mts +3 -1
- package/types/engine/infobox.d.mts +17 -6
- package/types/engine/item-compiler.d.mts +4 -4
- package/types/engine/item-docs.d.mts +4 -3
- package/types/engine/journals.d.mts +10 -7
- package/types/engine/map-graphviz.d.mts +1 -1
- package/types/engine/markdown-expressions.d.mts +17 -0
- package/types/engine/note-dates.d.mts +47 -1
- package/types/engine/note-package.d.mts +3 -19
- package/types/engine/note-state.d.mts +2 -1
- package/types/engine/note-vocabulary.d.mts +9 -0
- package/types/engine/number-words.d.mts +4 -0
- package/types/engine/office-holders.d.mts +14 -0
- package/types/engine/pack-config.d.mts +1 -1
- package/types/engine/packages.d.mts +3 -2
- package/types/engine/pdf-images.d.mts +38 -0
- package/types/engine/populations.d.mts +2 -2
- package/types/engine/project-init.d.mts +17 -0
- package/types/engine/prose-config.d.mts +1 -1
- package/types/engine/prose-lint.d.mts +3 -2
- package/types/engine/readability-lint.d.mts +22 -0
- package/types/engine/reckoning-markers.d.mts +4 -2
- package/types/engine/schema-check.d.mts +3 -3
- package/types/engine/site-build.d.mts +38 -28
- package/types/engine/site-config.d.mts +2 -2
- package/types/engine/site-index.d.mts +4 -0
- package/types/engine/site-preview.d.mts +1 -1
- package/types/engine/social-ties.d.mts +8 -2
- package/types/engine/sql-tables.d.mts +13 -2
- package/types/engine/web-wikilinks.d.mts +2 -1
- package/types/engine/wikilinks.d.mts +7 -1
- package/types/hm3/items.d.mts +5 -6
- package/types/labels.d.mts +40 -0
- package/types/manifest.d.mts +3 -3
- package/types/sohl/actors.d.mts +2 -2
- package/types/sohl/being-info.d.mts +3 -43
- package/types/sohl/index.d.mts +1 -1
- package/types/sohl/infobox.d.mts +5 -2
- package/types/sohl/item-fields.d.mts +4 -13
- package/types/stage.d.mts +9 -0
- package/CONTENT.md +0 -3239
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
shortcode: authoringassets
|
|
3
|
+
name: { full: "Images, icons, audio, and provenance" }
|
|
4
|
+
type: doc
|
|
5
|
+
subType: howto
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Images, icons, audio, and provenance
|
|
9
|
+
|
|
10
|
+
An addressable file lives under one of three roots. Subdirectories beneath each root are for author organization and can change without changing the asset Address.
|
|
11
|
+
|
|
12
|
+
| Root | Address type | Typical use |
|
|
13
|
+
| --------------- | ------------ | ------------------------------------ |
|
|
14
|
+
| `assets/images` | `image` | Maps, portraits, and illustrations. |
|
|
15
|
+
| `assets/icons` | `icon` | Item and being icons. |
|
|
16
|
+
| `assets/audio` | `audio` | Sound attached to content or scenes. |
|
|
17
|
+
|
|
18
|
+
The file's name without its extension is its shortcode; the root determines the type. Asset Addresses use system `none`. A regular link defaults to `note`, but `![[icon-harbor|Harbor emblem]]` defaults to `none`. Image and icon addresses used by `data.icon`, `data.banner`, and other art fields also default to `none`. Those fields name the asset as a bare Address, without wikilink brackets.
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
![[image-harbor-map|Map of the harbor]]{size=large}
|
|
22
|
+
![[icon-harbor|Harbor emblem]]{float=top-left size=medium}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The embed's label is alternative text. `![[icon-harbor|]]` is decorative. `size=auto` follows the file's natural size; named sizes let web, Foundry, and book choose suitable dimensions. Use `.full-width` for an image intended to span the available measure. The [image reference](../reference/format-details.md#images) lists the closed directive values.
|
|
26
|
+
|
|
27
|
+
## Ownership and source records
|
|
28
|
+
|
|
29
|
+
Record provenance for the assets you ship. Put `provenance.yaml` in an asset directory to describe files there and below, or put a YAML sidecar beside one asset to give that file its own record. A sidecar takes precedence over a directory record for that asset. An asset with no record still enters the index with blank provenance fields. Keep attribution with the authored asset so movement through the tree does not lose its source or license. See the [asset record reference](../reference/format-details.md#the-asset-record) for the accepted keys, inheritance, and examples.
|
|
30
|
+
|
|
31
|
+
The build writes transformed or optimized copies under `build/`; the authored file remains the input for the next build. Output paths are derived from the owning package, asset type, and build target. The [icon guide](../guides/icons.md) covers generated icon variants and placement in Foundry.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
shortcode: authoringdatesandcalendars
|
|
3
|
+
name: { full: "Dates, calendars, and eras" }
|
|
4
|
+
type: doc
|
|
5
|
+
subType: howto
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Dates, calendars, and eras
|
|
9
|
+
|
|
10
|
+
A canonical date names a day without assuming how a culture divides a year. Write `<year>.<day>[:HHMMSS]`: `720.136` is day 136 of year 720, and `720.136:143005` adds a 24-hour time. A negative year is valid. The day must fit the world's declared year length. The dot separates year from **day of year**, not month from day.
|
|
11
|
+
|
|
12
|
+
Authors can instead write a named calendar date in frontmatter:
|
|
13
|
+
|
|
14
|
+
```yaml
|
|
15
|
+
data:
|
|
16
|
+
born: datefrom vrcal 23 Taranis 326 VR
|
|
17
|
+
died: ~326.114
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`datefrom` takes a calendar shortcode or Address, then the date in that calendar. The calendar defines month names and eras. A date can have day, month, or year precision. Prefix either spelling with `~` for an approximate date. `unknown` means an occurrence is known but its date is not recorded, in fields that accept it. These are the frontmatter date forms; do not put a Handlebars expression there.
|
|
21
|
+
|
|
22
|
+
A calendar defines the order and length of months. An era defines where a year count begins. One calendar can have several eras; a multi-era date names its era. Era starts increase on the canonical timeline, with gaps allowed. Dates before the first era use a negative year in that first era; later eras count forward from their own year 1. There is no year zero. A date in a gap has no named era in that calendar.
|
|
23
|
+
|
|
24
|
+
Use the CLI to inspect a conversion:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
package-build datefrom vrcal '23 Taranis 326 VR'
|
|
28
|
+
package-build dateto vrcal 326.114
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`datefrom` prints the canonical value; `dateto` prints a named date in the era covering it. The [detailed calendar rules](../reference/format-details.md#dates-and-calendars) explain precision, era markers, bounds, and resolution errors.
|
|
32
|
+
|
|
33
|
+
In prose, `{{dateformat "vrcal" data.born}}` renders a date in the chosen calendar. `{{dateformat data.calendar data.born}}` uses the note's own calendar Address. A being or place can set `data.calendar`; a being's infobox displays its dates in that calendar, and a place's infobox displays its `present` there.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
shortcode: authoringfirstnote
|
|
3
|
+
name: { full: "Your first content note" }
|
|
4
|
+
type: doc
|
|
5
|
+
subType: howto
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Your first content note
|
|
9
|
+
|
|
10
|
+
A HeroicLands content tree lives under `assets/content/`. Put notes in whatever subfolders help you work: the build discovers them recursively and identifies each by frontmatter, not by its directory. This example works in a project made by [`package-build init`](../commands.md#package-build-init-directory).
|
|
11
|
+
|
|
12
|
+
Create `assets/content/Places/Harbor.md`:
|
|
13
|
+
|
|
14
|
+
```markdown
|
|
15
|
+
---
|
|
16
|
+
shortcode: harbor
|
|
17
|
+
name: { full: Harbor }
|
|
18
|
+
type: lore
|
|
19
|
+
subType: concept
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Harbor
|
|
23
|
+
|
|
24
|
+
A sheltered place where ships load and unload.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`shortcode` and `type` identify a HeroicLands note; `name.full` gives readers its name. The YAML ends at the second `---`. Everything after it is the shared Markdown body. Run `npm run lint` to check the note, then `npm run build:site` to build its web page. `npm run serve:site` serves the site locally; `npm run build:book` builds the book. A Foundry package's `npm run build:db` also compiles its configured packs. The generated project supplies these scripts and their configuration.
|
|
28
|
+
|
|
29
|
+
For optional writing suggestions, run `npx package-build prose lint assets/content/Places/Harbor.md`. This reports difficult sentences and simpler word choices with line and column numbers. It does not change the note or run as part of `npm run lint`. The [prose analysis command](../commands.md#package-build-prose-lint-path) explains the settings and how to read each suggestion.
|
|
30
|
+
|
|
31
|
+
## What the note becomes
|
|
32
|
+
|
|
33
|
+
| Output | What it contains |
|
|
34
|
+
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
35
|
+
| Content index | The note Address, frontmatter, anchors, and links, for search and queries. |
|
|
36
|
+
| JournalEntry | The shared prose, independent of a game system. |
|
|
37
|
+
| JournalEntryPage | One page per H1, plus an introduction page if prose comes before the first H1. An explicitly anchored lower heading also starts a page. |
|
|
38
|
+
| Website | A page at the note's Address when the package publishes content. |
|
|
39
|
+
| Book | The same content when selected by the book's document tree. |
|
|
40
|
+
| Actor, Item, Scene, or Macro | A game document when the type and a system block request one. |
|
|
41
|
+
|
|
42
|
+
The full Address is `<package>-note-lore-harbor`; `<package>` comes from `contentPackage` in `package-build.config.yaml`. In another note, `[[lore-harbor|Harbor]]` links to it. `[[lore-harbor|]]` asks the renderer to use the target's current name. The pipe is required.
|
|
43
|
+
|
|
44
|
+
## Grow the note only when needed
|
|
45
|
+
|
|
46
|
+
Add `description` for a short page summary, `tags: [draft]` to mark unfinished prose, or `data` for fields the note's type permits. A system block such as `sohl:` or `hm3:` adds mechanics and can produce a Foundry Actor or Item. It does not replace the shared prose or make another JournalEntry. [Frontmatter](frontmatter.md) explains the allowed keys, and the [note-type reference](../reference/note-types.md) lists every type-specific field.
|
|
47
|
+
|
|
48
|
+
A note with an empty body is a stub. It remains addressable as data, while a document that would have no content is omitted. See [note states](../reference/format-details.md#three-states-of-a-note) for the precise emission rules.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
shortcode: authoringfrontmatter
|
|
3
|
+
name: { full: "Frontmatter and system blocks" }
|
|
4
|
+
type: doc
|
|
5
|
+
subType: howto
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Frontmatter and system blocks
|
|
9
|
+
|
|
10
|
+
HeroicLands notes begin with YAML frontmatter. A file is recognized as a note when its opening frontmatter has nonempty `shortcode` and `type` values. Ordinary Markdown files need neither. Keep top-level keys in this order, omitting keys that do not apply: `shortcode`, `name`, `type`, `subType`, `description`, `tags`, `data`, `hm3`, `sohl`. Any other top-level key is an error.
|
|
11
|
+
|
|
12
|
+
```yaml
|
|
13
|
+
---
|
|
14
|
+
shortcode: harbor
|
|
15
|
+
name: { full: Harbor, aliases: [The Harbor] }
|
|
16
|
+
type: lore
|
|
17
|
+
subType: concept
|
|
18
|
+
description: A sheltered trading port.
|
|
19
|
+
tags: [draft]
|
|
20
|
+
data: {}
|
|
21
|
+
---
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`name.full` is the displayed name; `name.aliases` helps search. `description` is the short page summary. `tags` hold draft state and classification. `data` holds facts about the subject shared by systems. A YAML comment is the place for an author-only note: commented values remain valid YAML but do not enter the content index or generated documents.
|
|
25
|
+
|
|
26
|
+
Use `tags: [gm]` for a note intended only for the GM. It is absent from the public website and book. Foundry includes it only when its document routes to a pack with `private: true`. A note with `gm` that also creates a prose JournalEntry needs a private JournalEntry pack. Links from untagged notes to GM notes are errors; GM notes may link to one another.
|
|
27
|
+
|
|
28
|
+
The formatter keeps a collection on one line when the full line is under 100 characters. Longer collections use full YAML block form. Run `package-build format --write` to apply key order and collection formatting.
|
|
29
|
+
|
|
30
|
+
## Shared facts and game mechanics
|
|
31
|
+
|
|
32
|
+
The [note-type reference](../reference/note-types.md) lists every field accepted under `data`, including the shared `id`, `pack`, `packFolder`, `harnworld`, `icon`, and `banner` fields. A type such as `being` also has its own fields, including `culture`, `homes`, and `affiliations`. A field absent from a type's vocabulary is a lint error; an unrelated field is not silently repurposed.
|
|
33
|
+
|
|
34
|
+
A `sohl:` or `hm3:` block holds values for that Foundry system. Its `system:` child contains values sent to the system's DataModel. The system block can override shared routing and art where the declared field permits it. `data.pack` and `data.packFolder` are shared routes; a system-specific route belongs in that system block. The [detailed mapping reference](../reference/format-details.md#mappings-every-type-shares) and [system-block explanation](../reference/format-details.md#frontmatter-has-three-regions) cover precedence and emitted fields.
|
|
35
|
+
|
|
36
|
+
One body describes the subject for both systems. A being's `{#appearance}` and `{#dossier}` sections feed SoHL Actor `system.appearance` and `system.dossier`, and HM3 Actor `system.description` and `system.biography`. An Item's `{#description}` page becomes a shared JournalEntryPage. Its resolved `@UUID[...]` pointer is stored in SoHL Item `system.docHtml` and HM3 Item `system.description`. An Item with no `{#description}` anchor uses its first page. Other H1 pages remain linkable.
|
|
37
|
+
|
|
38
|
+
## Publication and summaries
|
|
39
|
+
|
|
40
|
+
A note infobox draws from shared `data`. A system infobox draws from the system's fields, and a mapped system with no document says “Not available.” The same authored body appears in Foundry, on the website, and in the book; presentation adapts to each medium. [Infobox details](../reference/format-details.md#the-infobox) describe field order and empty values.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
shortcode: authoringlinksandmarkup
|
|
3
|
+
name: { full: "Addresses, links, and body markup" }
|
|
4
|
+
type: doc
|
|
5
|
+
subType: howto
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Addresses, links, and body markup
|
|
9
|
+
|
|
10
|
+
An Address names content independently of its filename or folder. Its full form is `<package>-<system>-<type>-<shortcode>`. A regular prose link defaults to system `note`, and an asset embed defaults to system `none`. Omitted segments take their defaults from the writing context; a short form must still resolve unambiguously. Frontmatter fields that declare an Address contain the bare Address, without brackets.
|
|
11
|
+
|
|
12
|
+
```markdown
|
|
13
|
+
[[lore-harbor|Harbor]]
|
|
14
|
+
[[thalorna-note-lore-harbor|]]
|
|
15
|
+
![[icon-harbor|Harbor emblem]]{float=top-left size=medium}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The part after `|` is the displayed link text or an embed's alternative text. An empty label uses the target's current name in a regular link and marks an embed decorative. A missing pipe is an error. Search may use `name.full` and aliases; authored links use Addresses. The [Address reference](../reference/format-details.md#addresses) explains short forms, package qualification, and ambiguity diagnostics.
|
|
19
|
+
|
|
20
|
+
A link to a note tagged `draft` retains its target and carries a visible draft cue. In a book, the cue reads `(draft)` after the link. A link that resolves nowhere produces a diagnostic and reads `(unresolved link)` after its label in the book.
|
|
21
|
+
|
|
22
|
+
## Journal pages and anchors
|
|
23
|
+
|
|
24
|
+
Every H1 starts a JournalEntryPage. A lower-level heading with an explicit anchor starts a page too. Use `{#slug}` to make a stable target:
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
# The Harbor {#harbor}
|
|
28
|
+
|
|
29
|
+
The harbor faces west.
|
|
30
|
+
|
|
31
|
+
## Customs House {#customs-house}
|
|
32
|
+
|
|
33
|
+
Travelers present their papers here. See [[#harbor|the harbor]].
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Another note can link to `[[lore-harbor#customs-house|Customs House]]`. The special Actor anchors `{#appearance}` and `{#dossier}` feed the same authored sections to each system's Actor fields. For Items, `{#description}` selects the JournalEntryPage both systems reference. A map note can use an anchored heading for a scene pin; the compiler replaces the pin's exported JournalEntry and page IDs with the built note's IDs and uses the heading text as its label. See [map notes](../reference/format-details.md#type-map) for scene fields.
|
|
37
|
+
|
|
38
|
+
## Captions and numbered references
|
|
39
|
+
|
|
40
|
+
A caption fence labels the next Markdown block. Give it an ID so prose can refer to the block without hard-coding its number:
|
|
41
|
+
|
|
42
|
+
````markdown
|
|
43
|
+
Refer to [[#trade|]] for the market routes.
|
|
44
|
+
|
|
45
|
+
:::caption {#trade}
|
|
46
|
+
Regional trade routes
|
|
47
|
+
:::
|
|
48
|
+
|
|
49
|
+
```sql
|
|
50
|
+
SELECT name.full AS "Market" FROM notes WHERE type = 'place'
|
|
51
|
+
```
|
|
52
|
+
````
|
|
53
|
+
|
|
54
|
+
The table displays **Table 1: Regional trade routes**, and the reference displays **Table 1**. The number is assigned by the output. An explicit link label, such as `[[#trade|the trade table]]`, displays the written label. A caption can precede a code fence, table, image, or any prose block. An ordinary code fence is code; an SQL result is a table; an image is a figure; every other block is prose. Web pages and Foundry journals number each kind within the note. Books number each kind across the book in reading order. A caption needs a unique ID, nonempty text, a closing `:::`, and a following block.
|
|
55
|
+
|
|
56
|
+
## Images and protected content
|
|
57
|
+
|
|
58
|
+
An image or icon embed stands on its own line. `size` accepts `auto`, `small`, `medium`, `large`, and `xlarge`; the medium maps those names to suitable dimensions. `float` controls placement. The asset remains an Address, so moving the file within its asset root does not change the link. See [assets](assets.md) and [image directives](../reference/format-details.md#images).
|
|
59
|
+
|
|
60
|
+
A `:::secret` block marks GM material while keeping it in the same authored note:
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
:::secret
|
|
64
|
+
The harbor master is working for the smugglers.
|
|
65
|
+
:::
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Players who deliberately inspect source or generated output may see it; the block is a presentation distinction, not access control. The [detailed reference](../reference/format-details.md#what-a-note-produces) describes each medium's handling.
|
|
69
|
+
|
|
70
|
+
Use `:::info` for a neutral note and `:::warn` for a caution. Both render as
|
|
71
|
+
labelled, colored boxes on the web and in Foundry, and as print boxes in a book:
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
:::warn
|
|
75
|
+
The bridge closes during the spring flood.
|
|
76
|
+
:::
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
An optional `{#id}` gives the box an HTML anchor. These blocks need a closing
|
|
80
|
+
`:::` and cannot be nested.
|
|
81
|
+
|
|
82
|
+
## Footnotes and definition lists
|
|
83
|
+
|
|
84
|
+
Write a footnote reference as `[^id]` and its definition as `[^id]: text`.
|
|
85
|
+
The ID can be a number or word without spaces or tabs. It connects the
|
|
86
|
+
reference to its definition within one Markdown note; another note can reuse
|
|
87
|
+
the same ID for a different footnote. Rendered markers are numbers assigned in
|
|
88
|
+
the order of first reference, including when the authored ID is a word.
|
|
89
|
+
|
|
90
|
+
```markdown
|
|
91
|
+
The road is passable in summer.[^season] The bridge has a toll.[^2]
|
|
92
|
+
|
|
93
|
+
[^season]: Spring flooding closes it for several weeks.
|
|
94
|
+
|
|
95
|
+
[^2]: The toll is collected at the eastern gate.
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Definitions can appear anywhere at the top level of the note. Indent a
|
|
99
|
+
following paragraph or code block by four spaces to include it in the same
|
|
100
|
+
footnote. Keep definitions outside lists, block quotes, and tables. On the web,
|
|
101
|
+
linked footnotes appear in a Footnotes section at the bottom of the HTML page.
|
|
102
|
+
In Foundry, each JournalEntryPage places its referenced footnotes in a Footnotes
|
|
103
|
+
section at the bottom of that page; definitions remain available across pages
|
|
104
|
+
of the same note. In a book, footnotes appear in smaller type at the bottom of
|
|
105
|
+
the page that contains their reference.
|
|
106
|
+
|
|
107
|
+
A definition list gives a term one or more definitions:
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
Janapada
|
|
111
|
+
: A territorial community with its own institutions.
|
|
112
|
+
: Also the land associated with that community.
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The web and Foundry render a definition list with HTML `<dl>`, `<dt>`, and
|
|
116
|
+
`<dd>` elements. The book renders it as a term list.
|
|
117
|
+
|
|
118
|
+
## Tables and expressions
|
|
119
|
+
|
|
120
|
+
Use a SQL fence to render a table from the content index. The table reads frontmatter from indexed notes. A zero-row result is an error unless the fence explicitly permits an empty result.
|
|
121
|
+
|
|
122
|
+
````markdown
|
|
123
|
+
```sql
|
|
124
|
+
SELECT name.full AS "Name" FROM notes WHERE type = 'lore' ORDER BY name.full
|
|
125
|
+
```
|
|
126
|
+
````
|
|
127
|
+
|
|
128
|
+
Inline expressions can read the note, format dates, combine values, or run scalar SQL:
|
|
129
|
+
|
|
130
|
+
```markdown
|
|
131
|
+
{{name.full}} was born on {{dateformat "vrcal" data.born}}.
|
|
132
|
+
There are {{words (sql "SELECT COUNT(*) FROM notes WHERE type = 'being'")}} beings.
|
|
133
|
+
The index contains {{digits (sql "SELECT COUNT(*) FROM entries")}} entries.
|
|
134
|
+
{{and (gt 3 5) (lt 4 2)}}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Use `{{dateformat data.calendar data.born}}` when the note supplies a calendar Address. SQL fences produce tables; the `sql` helper returns one value for an inline expression. Wrap a numeric result in `words` for running prose or `digits` for a grouped numeral. See [date rules](dates-and-calendars.md) and [SQL details](../reference/format-details.md#content-tables) for query options.
|