@heroiclands/package-build 25.3.0 → 25.4.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 +15 -0
- package/README.md +1 -1
- package/assets/styles/content-base.css +32 -0
- package/docs/api.md +30 -6
- package/docs/authoring/links-and-markup.md +136 -53
- package/docs/commands.md +2 -2
- package/docs/content-format.md +14 -6
- package/docs/diagnostics.md +12 -11
- package/docs/guides/writing-in-invented-scripts.md +62 -35
- package/docs/reference/format-details.md +6 -6
- package/docs/reference/note-types.md +15 -15
- package/docs/reference/theme-pages.md +26 -18
- package/engine/anchors.mjs +14 -0
- package/engine/code-fences.mjs +15 -6
- package/engine/content-blocks.mjs +4 -2
- package/engine/content-figures.mjs +19 -5
- package/engine/content-footnotes.mjs +60 -1
- package/engine/content-index.mjs +1 -1
- package/engine/content-render.mjs +59 -43
- package/engine/content-scripts.mjs +204 -42
- package/engine/content-spans.mjs +73 -5
- package/engine/content-verse.mjs +320 -192
- package/engine/first-use.mjs +43 -12
- package/engine/heading-attributes.mjs +2 -1
- package/engine/journals.mjs +8 -1
- package/engine/markdown-blocks.mjs +3 -2
- package/engine/markup-validation.mjs +17 -0
- package/engine/name-markup.mjs +1 -0
- package/engine/note-vocabulary.mjs +2 -2
- package/engine/pdf-render.mjs +34 -23
- package/engine/prose-lint.mjs +14 -2
- package/engine/run-rows.mjs +1 -1
- package/engine/sql-tables.mjs +1 -1
- package/engine/verse-format.mjs +77 -0
- package/engine/verse-metre.mjs +18 -9
- package/engine/verse-regions.mjs +181 -0
- package/engine/wikilink-pattern.mjs +31 -0
- package/engine/wikilink-syntax.mjs +2 -16
- package/package.json +1 -1
- package/site-theme/static/css/style.css +24 -0
- package/types/engine/code-fences.d.mts +1 -3
- package/types/engine/content-footnotes.d.mts +23 -0
- package/types/engine/content-scripts.d.mts +4 -3
- package/types/engine/content-spans.d.mts +3 -1
- package/types/engine/content-verse.d.mts +69 -74
- package/types/engine/name-markup.d.mts +5 -0
- package/types/engine/verse-format.d.mts +9 -0
- package/types/engine/verse-metre.d.mts +4 -4
- package/types/engine/verse-regions.d.mts +78 -0
- package/types/engine/wikilink-pattern.d.mts +17 -0
- package/types/engine/wikilink-syntax.d.mts +1 -41
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install the opaque verse-div block rule. Tokens carry raw source regions.
|
|
3
|
+
* @param {import("markdown-it")} md - Markdown parser.
|
|
4
|
+
*/
|
|
5
|
+
export function verseDivPlugin(md: typeof import("markdown-it")): void;
|
|
6
|
+
/**
|
|
7
|
+
* Locate complete raw verse divs while leaving literal examples untouched.
|
|
8
|
+
* @param {string} source - Authored Markdown.
|
|
9
|
+
* @returns {VerseRegion[]} Regions in source order, including unclosed divs.
|
|
10
|
+
*/
|
|
11
|
+
export function verseRegions(source: string): VerseRegion[];
|
|
12
|
+
/**
|
|
13
|
+
* Source ranges belonging to inline syntax rather than visible verse text.
|
|
14
|
+
* @param {string} source - Inline Markdown.
|
|
15
|
+
* @returns {Array<[number,number]>} Protected UTF-16 ranges.
|
|
16
|
+
*/
|
|
17
|
+
export function inlineSyntaxRanges(source: string): Array<[number, number]>;
|
|
18
|
+
/**
|
|
19
|
+
* A raw verse div, opaque to ordinary Markdown block syntax.
|
|
20
|
+
*/
|
|
21
|
+
export type VerseRegion = {
|
|
22
|
+
/**
|
|
23
|
+
* - Opening line, zero based.
|
|
24
|
+
*/
|
|
25
|
+
start: number;
|
|
26
|
+
/**
|
|
27
|
+
* - Closing line, zero based and inclusive.
|
|
28
|
+
*/
|
|
29
|
+
end: number;
|
|
30
|
+
/**
|
|
31
|
+
* - First offset of the complete region.
|
|
32
|
+
*/
|
|
33
|
+
from: number;
|
|
34
|
+
/**
|
|
35
|
+
* - Offset past the complete region.
|
|
36
|
+
*/
|
|
37
|
+
to: number;
|
|
38
|
+
/**
|
|
39
|
+
* - First body offset.
|
|
40
|
+
*/
|
|
41
|
+
bodyStart: number;
|
|
42
|
+
/**
|
|
43
|
+
* - Offset past body text, excluding its final newline.
|
|
44
|
+
*/
|
|
45
|
+
bodyEnd: number;
|
|
46
|
+
/**
|
|
47
|
+
* - Authored body bytes.
|
|
48
|
+
*/
|
|
49
|
+
body: string;
|
|
50
|
+
/**
|
|
51
|
+
* - Authored values.
|
|
52
|
+
*/
|
|
53
|
+
attributes: Record<string, string>;
|
|
54
|
+
/**
|
|
55
|
+
* - Anchor or empty string.
|
|
56
|
+
*/
|
|
57
|
+
id: string;
|
|
58
|
+
/**
|
|
59
|
+
* - Authored classes including verse.
|
|
60
|
+
*/
|
|
61
|
+
classes: string[];
|
|
62
|
+
/**
|
|
63
|
+
* - Opening indentation.
|
|
64
|
+
*/
|
|
65
|
+
indent: string;
|
|
66
|
+
/**
|
|
67
|
+
* - Region kind.
|
|
68
|
+
*/
|
|
69
|
+
name: "verse";
|
|
70
|
+
/**
|
|
71
|
+
* - Whether a closing delimiter is present.
|
|
72
|
+
*/
|
|
73
|
+
closed: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* - Attribute syntax findings.
|
|
76
|
+
*/
|
|
77
|
+
problems: string[];
|
|
78
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** The dependency-free lexical wikilink pattern. @module */
|
|
2
|
+
/**
|
|
3
|
+
* A wikilink, as authored.
|
|
4
|
+
*
|
|
5
|
+
* **Newlines are excluded deliberately.** A link is written on one line; an
|
|
6
|
+
* unclosed `[[` is a typo, and the alternative is letting it swallow arbitrary
|
|
7
|
+
* prose in search of a closer. Erring towards "not a link" leaves the author's
|
|
8
|
+
* text as written, which is the safe direction for a rewriter.
|
|
9
|
+
*
|
|
10
|
+
* **A leading `!` makes it an embed, not a link**, and the lookbehind is what
|
|
11
|
+
* keeps every reader from seeing one as the other. Stated here rather than in
|
|
12
|
+
* each reader for the reason the rest of this module exists: the checker, the
|
|
13
|
+
* resolver and the embed reader all match on this pattern, and a copy of the
|
|
14
|
+
* exclusion in each is a place for it to be forgotten. An embed's
|
|
15
|
+
* own grammar is {@link module:engine/content-embeds}.
|
|
16
|
+
*/
|
|
17
|
+
export const WIKILINK: RegExp;
|
|
@@ -206,47 +206,7 @@ export function secretDestination(destination: object, anchor?: string): boolean
|
|
|
206
206
|
* @returns {string} Inline spoiler or visible reference.
|
|
207
207
|
*/
|
|
208
208
|
export function presentWikilink(reference: string, parsed: object, destination: object): string;
|
|
209
|
-
|
|
210
|
-
* What a `[[…]]` **is**, before anything decides where it points.
|
|
211
|
-
*
|
|
212
|
-
* One authored link is written three ways — a Foundry `@UUID` content link for
|
|
213
|
-
* the packs, a URL for the web, a cross-reference for the book — and those
|
|
214
|
-
* forms are the *only* thing that legitimately differs. The syntax is the
|
|
215
|
-
* author's, and it is the same syntax whichever build is reading it.
|
|
216
|
-
*
|
|
217
|
-
* So the parse lives here, once, and two readers take it: the link checker
|
|
218
|
-
* (`content-links.mjs`) and the resolver (`wikilinks.mjs`). Each receives the
|
|
219
|
-
* parts and decides only what it is for: which document the address names.
|
|
220
|
-
*
|
|
221
|
-
* The one rule about a link's *shape* also lives here — **a link carries a
|
|
222
|
-
* label** ({@link unlabelledLinkMessage}) — because every build states it
|
|
223
|
-
* through one message and the author reads the same words whichever ran
|
|
224
|
-
* first.
|
|
225
|
-
*
|
|
226
|
-
* For the same reason, so does the **vocabulary of link findings**
|
|
227
|
-
* ({@link LINK_FINDING_REASONS}) and the message each one reports through
|
|
228
|
-
* ({@link linkFindingMessage}). Every build reads one authored link; an author
|
|
229
|
-
* meets whichever ran first, and a consumer switching on a `reason` should not
|
|
230
|
-
* be switching on which build produced it.
|
|
231
|
-
*
|
|
232
|
-
* @module
|
|
233
|
-
*/
|
|
234
|
-
/**
|
|
235
|
-
* A wikilink, as authored.
|
|
236
|
-
*
|
|
237
|
-
* **Newlines are excluded deliberately.** A link is written on one line; an
|
|
238
|
-
* unclosed `[[` is a typo, and the alternative is letting it swallow arbitrary
|
|
239
|
-
* prose in search of a closer. Erring towards "not a link" leaves the author's
|
|
240
|
-
* text as written, which is the safe direction for a rewriter.
|
|
241
|
-
*
|
|
242
|
-
* **A leading `!` makes it an embed, not a link**, and the lookbehind is what
|
|
243
|
-
* keeps every reader from seeing one as the other. Stated here rather than in
|
|
244
|
-
* each reader for the reason the rest of this module exists: the checker, the
|
|
245
|
-
* resolver and the embed reader all match on this pattern, and a copy of the
|
|
246
|
-
* exclusion in each is a place for it to be forgotten. An embed's
|
|
247
|
-
* own grammar is {@link module:engine/content-embeds}.
|
|
248
|
-
*/
|
|
249
|
-
export const WIKILINK: RegExp;
|
|
209
|
+
export { WIKILINK } from "./wikilink-pattern.mjs";
|
|
250
210
|
/**
|
|
251
211
|
* Every way a link can fail, named once for every reader of a link.
|
|
252
212
|
*
|