@heroiclands/package-build 24.0.4 → 24.1.1
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 +46 -0
- package/README.md +8 -0
- package/assets/styles/content-base.css +25 -10
- package/bin/content-commands.mjs +183 -15
- package/bin/package-build.mjs +5 -170
- package/docs/authoring/links-and-markup.md +215 -179
- package/docs/commands.md +88 -2
- package/docs/configuration.md +6 -3
- package/docs/content-format.md +4 -3
- package/docs/diagnostics.md +57 -29
- package/docs/guides/book.md +1 -1
- package/docs/guides/module-project.md +2 -2
- package/docs/guides/site.md +2 -2
- package/docs/guides/writing-in-invented-scripts.md +175 -125
- package/docs/reference/format-details.md +53 -35
- package/docs/reference/note-types.md +10 -10
- package/docs/reference/theme-pages.md +18 -9
- package/engine/build-assets.mjs +179 -0
- package/engine/calendar-artifacts.mjs +7 -3
- package/engine/compendiums.mjs +16 -11
- package/engine/content-render.mjs +23 -2
- package/engine/content-scripts.mjs +348 -140
- package/engine/content-session.mjs +62 -14
- package/engine/content-spans.mjs +13 -1
- package/engine/content-timings.mjs +67 -0
- package/engine/content-verse.mjs +158 -373
- package/engine/note-vocabulary.mjs +5 -5
- package/engine/pdf-render.mjs +63 -44
- package/engine/run-rows.mjs +18 -20
- package/engine/script-font-delivery.mjs +22 -15
- package/engine/verse-metre.mjs +36 -8
- package/engine/written-in.mjs +9 -13
- package/package.json +1 -1
- package/site-theme/static/css/style.css +19 -10
- package/types/engine/build-assets.d.mts +23 -0
- package/types/engine/calendar-artifacts.d.mts +5 -1
- package/types/engine/content-scripts.d.mts +18 -7
- package/types/engine/content-session.d.mts +19 -1
- package/types/engine/content-timings.d.mts +14 -0
- package/types/engine/content-verse.d.mts +37 -163
- package/types/engine/run-rows.d.mts +16 -9
- package/types/engine/script-font-delivery.d.mts +8 -4
- package/types/engine/verse-metre.d.mts +4 -3
|
@@ -46,10 +46,9 @@ export function scanRuns(source: string, ctx?: RunContext, syntax?: import("./co
|
|
|
46
46
|
* Rewrite text marked with `lang=`, `font=` and `map=` into the plain span,
|
|
47
47
|
* div and verse grammar the rest of each chain renders, one line for one line.
|
|
48
48
|
*
|
|
49
|
-
* - **
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* rewrite that changes the number of lines.
|
|
49
|
+
* - **Numbered verse prefixes and indentation markers** stay outside run text.
|
|
50
|
+
* Each authored run chooses its own language and presentation; physical
|
|
51
|
+
* lines and source positions remain unchanged.
|
|
53
52
|
* - **The map, if any, is applied first.** Characters Markdown would read are
|
|
54
53
|
* then backslash-escaped, so they reach every later pass as characters.
|
|
55
54
|
* - **Emphasis in a face** becomes an `<em>` or a `<strong>` carrying its
|
|
@@ -93,6 +92,8 @@ export function renderRuns(source: string, ctx?: RunContext, syntax?: import("./
|
|
|
93
92
|
};
|
|
94
93
|
/** The keys this module reads, which no construct passes through as written. */
|
|
95
94
|
export const RUN_KEYS: readonly string[];
|
|
95
|
+
/** Explicit opt-in to native-script presentation on this construct. */
|
|
96
|
+
export const NATIVEFONT_CLASS: "nativefont";
|
|
96
97
|
/** The generic families `font=` may name, each with the class that sets it. */
|
|
97
98
|
export const GENERIC_FONTS: Readonly<{
|
|
98
99
|
mono: "font-mono";
|
|
@@ -175,6 +176,11 @@ export type RunDetail = {
|
|
|
175
176
|
* - A span's offset of its closing `]`.
|
|
176
177
|
*/
|
|
177
178
|
contentEnd: number | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* - A resolved reference's
|
|
181
|
+
* visible label bounds, by absolute offset; its target stays untouched.
|
|
182
|
+
*/
|
|
183
|
+
reference: [number, number] | undefined;
|
|
178
184
|
/**
|
|
179
185
|
* -
|
|
180
186
|
* The convention its language's note states.
|
|
@@ -270,9 +276,9 @@ export type RunContext = {
|
|
|
270
276
|
/**
|
|
271
277
|
* One span, div, verse fence or scroll fence carrying `lang=`, `font=` or
|
|
272
278
|
* `map=`. Its `lang`, `font` and `map` are the ones it is set with: its own,
|
|
273
|
-
* else
|
|
274
|
-
*
|
|
275
|
-
*
|
|
279
|
+
* else inherited language or an ordinary prose family. Native map/face
|
|
280
|
+
* defaults are selected only by this construct's explicit `.nativefont`
|
|
281
|
+
* opt-in; marked children make their own presentation choice.
|
|
276
282
|
*/
|
|
277
283
|
export type Run = {
|
|
278
284
|
/**
|
|
@@ -314,4 +320,9 @@ export type Run = {
|
|
|
314
320
|
* fence's 0-based closing line.
|
|
315
321
|
*/
|
|
316
322
|
end: number;
|
|
323
|
+
/**
|
|
324
|
+
* - True only for an explicit native opt-in
|
|
325
|
+
* with its own language; retained by index records for deferred defaults.
|
|
326
|
+
*/
|
|
327
|
+
nativefont?: boolean | undefined;
|
|
317
328
|
};
|
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
* @param {string} [options.assetsBase] - Assets root, defaulting to configuration.
|
|
9
9
|
* @param {readonly string[]} [options.skipDirectories] - Resolved content scope.
|
|
10
10
|
* @param {ReturnType<typeof routerFor>} [options.router] - One router shared by this session's compile.
|
|
11
|
+
* @param {boolean} [options.trackChanges] - Snapshot physical input metadata for build phase guards.
|
|
12
|
+
* @param {ReturnType<typeof createContentTimings>} [options.timings] - Invocation stage accounting.
|
|
11
13
|
* @returns {Promise<ContentSession>} Captured sources and lazy prepared views; dispose after use.
|
|
12
14
|
*/
|
|
13
|
-
export function createContentSession({ config, contentBase, assetsBase, skipDirectories, router, }?: {
|
|
15
|
+
export function createContentSession({ config, contentBase, assetsBase, skipDirectories, router, timings, trackChanges, }?: {
|
|
14
16
|
config?: import("../content-config.mjs").ContentBuildConfig | undefined;
|
|
15
17
|
contentBase?: string | undefined;
|
|
16
18
|
assetsBase?: string | undefined;
|
|
@@ -21,6 +23,17 @@ export function createContentSession({ config, contentBase, assetsBase, skipDire
|
|
|
21
23
|
packsOfType: (docType: string) => string[];
|
|
22
24
|
defaultOf: (docType: string) => string | undefined;
|
|
23
25
|
} | undefined;
|
|
26
|
+
trackChanges?: boolean | undefined;
|
|
27
|
+
timings?: {
|
|
28
|
+
sync<T>(name: string, work: () => T): T;
|
|
29
|
+
measure<T>(name: string, work: () => Promise<T> | T): Promise<T>;
|
|
30
|
+
hit(name: string): void;
|
|
31
|
+
snapshot(): {
|
|
32
|
+
totalMs: number;
|
|
33
|
+
stages: any;
|
|
34
|
+
hits: any;
|
|
35
|
+
};
|
|
36
|
+
} | undefined;
|
|
24
37
|
}): Promise<ContentSession>;
|
|
25
38
|
/**
|
|
26
39
|
* @typedef {"index"|"lint"|"links"|"compile"} ContentTarget
|
|
@@ -47,6 +60,8 @@ export function createContentSession({ config, contentBase, assetsBase, skipDire
|
|
|
47
60
|
* @property {() => Promise<import("./content-index.mjs").PreparedContentIndex>} publication
|
|
48
61
|
* @property {() => ReturnType<import("./compile-corpus.mjs").buildCompileCorpus>} compileCorpus
|
|
49
62
|
* @property {(targets: readonly ContentTarget[]) => Promise<ContentSession>} prepare
|
|
63
|
+
* @property {ReturnType<typeof createContentTimings>} timings
|
|
64
|
+
* @property {() => void} assertUnchanged
|
|
50
65
|
* @property {() => void} dispose
|
|
51
66
|
*/
|
|
52
67
|
/**
|
|
@@ -96,6 +111,8 @@ export type ContentSession = {
|
|
|
96
111
|
publication: () => Promise<import("./content-index.mjs").PreparedContentIndex>;
|
|
97
112
|
compileCorpus: () => ReturnType<typeof import("./compile-corpus.mjs").buildCompileCorpus>;
|
|
98
113
|
prepare: (targets: readonly ContentTarget[]) => Promise<ContentSession>;
|
|
114
|
+
timings: ReturnType<typeof createContentTimings>;
|
|
115
|
+
assertUnchanged: () => void;
|
|
99
116
|
dispose: () => void;
|
|
100
117
|
};
|
|
101
118
|
import * as blocks from "./content-blocks.mjs";
|
|
@@ -106,3 +123,4 @@ import { captureContentSources } from "./content-sources.mjs";
|
|
|
106
123
|
import { loadForeignIndexes } from "./metadata-index.mjs";
|
|
107
124
|
import * as sql from "./sql-tables.mjs";
|
|
108
125
|
import { buildLinkIndex } from "./content-links.mjs";
|
|
126
|
+
import { createContentTimings } from "./content-timings.mjs";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Sequential, nested stage accounting for one content invocation. */
|
|
2
|
+
export function createContentTimings(): {
|
|
3
|
+
/** @template T @param {string} name @param {() => T} work @returns {T} */
|
|
4
|
+
sync<T>(name: string, work: () => T): T;
|
|
5
|
+
/** @template T @param {string} name @param {() => Promise<T>|T} work @returns {Promise<T>} */
|
|
6
|
+
measure<T>(name: string, work: () => Promise<T> | T): Promise<T>;
|
|
7
|
+
/** @param {string} name */
|
|
8
|
+
hit(name: string): void;
|
|
9
|
+
snapshot(): {
|
|
10
|
+
totalMs: number;
|
|
11
|
+
stages: any;
|
|
12
|
+
hits: any;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
/** The authored verse lines, excluding stanza separators. */
|
|
1
|
+
/** The authored verse lines, excluding blank lines and stanza separators. */
|
|
2
2
|
export function verseLines(body: any): string[];
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Read one verse line. Marker offsets are zero-based in the authored line;
|
|
5
|
+
* textColumn is the one-based column of its first non-space character.
|
|
6
|
+
* Periods inside a span set indentation only when that span starts the line.
|
|
7
|
+
*/
|
|
8
|
+
export function verseLine(line: any): {
|
|
9
|
+
text: string;
|
|
10
|
+
level: number;
|
|
11
|
+
markerStart: number;
|
|
12
|
+
markerLength: number;
|
|
13
|
+
textColumn: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Blank lines divide verse groups. A standalone `***` is its own group and
|
|
17
|
+
* separates stanzas. Each text line carries its period-based indentation.
|
|
7
18
|
*/
|
|
8
19
|
export function verseStanzas(body: any): {
|
|
9
20
|
text: string;
|
|
@@ -12,7 +23,8 @@ export function verseStanzas(body: any): {
|
|
|
12
23
|
/** A verse is inline Markdown even when it starts with block syntax. */
|
|
13
24
|
export function inlineVerse(text: any): string;
|
|
14
25
|
/**
|
|
15
|
-
* Keep
|
|
26
|
+
* Keep blank-line verse groups as paragraphs and each text line a hard break.
|
|
27
|
+
* A standalone `***` emits a separate stanza gap.
|
|
16
28
|
* The surrounding renderer still sees the entire note, so links and footnote
|
|
17
29
|
* definitions remain in scope. The span carries the indent for each line.
|
|
18
30
|
*/
|
|
@@ -41,61 +53,20 @@ export function scanVerse(source: string): {
|
|
|
41
53
|
classes: never[];
|
|
42
54
|
indent: string;
|
|
43
55
|
}[];
|
|
44
|
-
errors:
|
|
45
|
-
line: number;
|
|
46
|
-
column: number;
|
|
47
|
-
message: string;
|
|
48
|
-
}[];
|
|
56
|
+
errors: any[];
|
|
49
57
|
};
|
|
50
|
-
/**
|
|
58
|
+
/** The number of verse columns; an omitted or invalid count uses the ordinary layout. */
|
|
59
|
+
export function verseColumnCount(block: any): number;
|
|
60
|
+
/** Whether a verse uses the numbered multi-column protocol. */
|
|
51
61
|
export function hasColumns(block: any): boolean;
|
|
52
62
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* @returns {Array<{raw: string, offset: number, lang?: string, map?: string, font?: string, offsets: {lang: number, map?: number, font?: number}}>}
|
|
57
|
-
* Each entry; one whose `lang` is `undefined` is malformed.
|
|
58
|
-
*/
|
|
59
|
-
export function columnEntries(value: string): Array<{
|
|
60
|
-
raw: string;
|
|
61
|
-
offset: number;
|
|
62
|
-
lang?: string;
|
|
63
|
-
map?: string;
|
|
64
|
-
font?: string;
|
|
65
|
-
offsets: {
|
|
66
|
-
lang: number;
|
|
67
|
-
map?: number;
|
|
68
|
-
font?: number;
|
|
69
|
-
};
|
|
70
|
-
}>;
|
|
71
|
-
/**
|
|
72
|
-
* The columns of a verse, the left first, each entry located in the opening
|
|
73
|
-
* line.
|
|
63
|
+
* Blank-separated multi-column rows with ordered physical parts. Text retains
|
|
64
|
+
* its authored inline markup and spacing after the numeric prefix. All source
|
|
65
|
+
* offsets are measured before prefixes or indentation periods are removed.
|
|
74
66
|
*
|
|
75
|
-
* @param {object} block - A verse from
|
|
76
|
-
* @param {string}
|
|
77
|
-
* @returns {Array<{
|
|
78
|
-
* 1-based columns.
|
|
79
|
-
*/
|
|
80
|
-
export function verseColumns(block: object, opening: string): Array<{
|
|
81
|
-
key: string;
|
|
82
|
-
entries: Array<ReturnType<typeof columnEntries>[number] & {
|
|
83
|
-
column: number;
|
|
84
|
-
columns: {
|
|
85
|
-
lang: number;
|
|
86
|
-
map?: number;
|
|
87
|
-
font?: number;
|
|
88
|
-
};
|
|
89
|
-
}>;
|
|
90
|
-
}>;
|
|
91
|
-
/**
|
|
92
|
-
* The verse lines of a verse in columns: each blank-line group of span lines
|
|
93
|
-
* is one verse line, and a line holding only `***` breaks the stanza.
|
|
94
|
-
*
|
|
95
|
-
* @param {object} block - A verse from {@link scanVerse}.
|
|
96
|
-
* @param {string[]} lines - The source, by line.
|
|
97
|
-
* @returns {Array<{stanzaBreak: true, line: number}|{stanzaBreak?: false, parts: Array<{line: number, column: number, text: string, textColumn: number, lang?: string, span: boolean, extra: boolean, indent: number}>}>}
|
|
98
|
-
* 0-based lines, 1-based columns.
|
|
67
|
+
* @param {object} block - A verse from scanVerse.
|
|
68
|
+
* @param {string[]} lines - The complete source, by line.
|
|
69
|
+
* @returns {Array<{stanzaBreak: true, line: number}|{stanzaBreak?: false, parts: Array<{column: number, line: number, sourceColumn: number, textColumn: number, text: string, indent: number, markerStart: number, markerLength: number, prefixLength: number}>}>}
|
|
99
70
|
*/
|
|
100
71
|
export function verseGroups(block: object, lines: string[]): Array<{
|
|
101
72
|
stanzaBreak: true;
|
|
@@ -103,14 +74,15 @@ export function verseGroups(block: object, lines: string[]): Array<{
|
|
|
103
74
|
} | {
|
|
104
75
|
stanzaBreak?: false;
|
|
105
76
|
parts: Array<{
|
|
106
|
-
line: number;
|
|
107
77
|
column: number;
|
|
108
|
-
|
|
78
|
+
line: number;
|
|
79
|
+
sourceColumn: number;
|
|
109
80
|
textColumn: number;
|
|
110
|
-
|
|
111
|
-
span: boolean;
|
|
112
|
-
extra: boolean;
|
|
81
|
+
text: string;
|
|
113
82
|
indent: number;
|
|
83
|
+
markerStart: number;
|
|
84
|
+
markerLength: number;
|
|
85
|
+
prefixLength: number;
|
|
114
86
|
}>;
|
|
115
87
|
}>;
|
|
116
88
|
/**
|
|
@@ -121,75 +93,15 @@ export function verseGroups(block: object, lines: string[]): Array<{
|
|
|
121
93
|
* @returns {boolean} Whether it starts right to left.
|
|
122
94
|
*/
|
|
123
95
|
export function rightToLeft(text: string): boolean;
|
|
124
|
-
/**
|
|
125
|
-
* Where a line of {@link expandVerseOrigins}'s output came from.
|
|
126
|
-
*
|
|
127
|
-
* @typedef {object} VerseOrigin
|
|
128
|
-
* @property {number} line - The source line, 0-based.
|
|
129
|
-
* @property {number} [textColumn] - For an entry's line, the 1-based source
|
|
130
|
-
* column of its text's first character.
|
|
131
|
-
* @property {boolean} [span] - Whether the source line is a span, whose `[`
|
|
132
|
-
* sits before its text.
|
|
133
|
-
* @property {number} [textLength] - The length of the entry's text.
|
|
134
|
-
* @property {{line: number, columns: {lang: number, map?: number, font?: number}}} [entry] -
|
|
135
|
-
* Where the entry is written in the opening line.
|
|
136
|
-
*/
|
|
137
|
-
/**
|
|
138
|
-
* Write each verse line of a sound verse in columns as one span per column
|
|
139
|
-
* entry, the left column's entries first, each with the entry's language,
|
|
140
|
-
* mapping and font. Every target runs it before marked text is rewritten, so
|
|
141
|
-
* each entry is set exactly as a span with those keys is. The verse gains the
|
|
142
|
-
* class {@link COLUMNS_CLASS}; a verse already carrying it, a verse with a
|
|
143
|
-
* finding, and a verse without columns are left as written.
|
|
144
|
-
*
|
|
145
|
-
* @param {string} source - Markdown.
|
|
146
|
-
* @returns {{markdown: string, origins: VerseOrigin[]}} The Markdown, and
|
|
147
|
-
* where each of its lines came from.
|
|
148
|
-
*/
|
|
149
|
-
export function expandVerseOrigins(source: string): {
|
|
150
|
-
markdown: string;
|
|
151
|
-
origins: VerseOrigin[];
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* {@link expandVerseOrigins}'s Markdown alone.
|
|
155
|
-
*
|
|
156
|
-
* @param {string} source - Markdown.
|
|
157
|
-
* @returns {string} The Markdown with each verse in columns expanded.
|
|
158
|
-
*/
|
|
159
|
-
export function expandVerse(source: string): string;
|
|
160
|
-
/**
|
|
161
|
-
* Where a position in {@link expandVerseOrigins}'s output was written.
|
|
162
|
-
*
|
|
163
|
-
* A position in an entry's text is the same character of the source line; a
|
|
164
|
-
* position in its keys is the entry's part in the opening line that states
|
|
165
|
-
* the key it falls in.
|
|
166
|
-
*
|
|
167
|
-
* @param {{line: number, column: number}} at - 1-based, in the output.
|
|
168
|
-
* @param {string[]} expanded - The output, by line.
|
|
169
|
-
* @param {VerseOrigin[]} origins - From {@link expandVerseOrigins}.
|
|
170
|
-
* @returns {{line: number, column: number}} 1-based, in the source.
|
|
171
|
-
*/
|
|
172
|
-
export function sourcePosition(at: {
|
|
173
|
-
line: number;
|
|
174
|
-
column: number;
|
|
175
|
-
}, expanded: string[], origins: VerseOrigin[]): {
|
|
176
|
-
line: number;
|
|
177
|
-
column: number;
|
|
178
|
-
};
|
|
179
96
|
/** Replace verse fences with HTML wrappers whose body remains inline Markdown.
|
|
180
97
|
* @param {string} source - Authored Markdown.
|
|
181
98
|
*/
|
|
182
99
|
export function renderVerse(source: string): {
|
|
183
100
|
markdown: string;
|
|
184
|
-
errors:
|
|
185
|
-
line: number;
|
|
186
|
-
column: number;
|
|
187
|
-
message: string;
|
|
188
|
-
}[];
|
|
101
|
+
errors: any[];
|
|
189
102
|
};
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
/** The class the build gives a verse in columns once its lines are expanded. */
|
|
103
|
+
export function stanzaSeparator(group: any): boolean;
|
|
104
|
+
/** The layout class the build gives a verse whose cols count exceeds one. */
|
|
193
105
|
export const COLUMNS_CLASS: "verse-columns";
|
|
194
106
|
/**
|
|
195
107
|
* The keys a verse fence's attribute block takes. `lang`, `font` and `map`
|
|
@@ -198,43 +110,5 @@ export const COLUMNS_CLASS: "verse-columns";
|
|
|
198
110
|
* the faces, and reach the element as they are written.
|
|
199
111
|
*/
|
|
200
112
|
export const VERSE_KEYS: readonly string[];
|
|
201
|
-
/**
|
|
202
|
-
* The line that breaks a stanza in a verse in columns, `***`, also as the
|
|
203
|
-
* rewrite of marked text escapes it.
|
|
204
|
-
*/
|
|
113
|
+
/** A line separating stanzas, including escaped output from a native run. */
|
|
205
114
|
export const STANZA_BREAK: RegExp;
|
|
206
|
-
/**
|
|
207
|
-
* Where a line of {@link expandVerseOrigins}'s output came from.
|
|
208
|
-
*/
|
|
209
|
-
export type VerseOrigin = {
|
|
210
|
-
/**
|
|
211
|
-
* - The source line, 0-based.
|
|
212
|
-
*/
|
|
213
|
-
line: number;
|
|
214
|
-
/**
|
|
215
|
-
* - For an entry's line, the 1-based source
|
|
216
|
-
* column of its text's first character.
|
|
217
|
-
*/
|
|
218
|
-
textColumn?: number | undefined;
|
|
219
|
-
/**
|
|
220
|
-
* - Whether the source line is a span, whose `[`
|
|
221
|
-
* sits before its text.
|
|
222
|
-
*/
|
|
223
|
-
span?: boolean | undefined;
|
|
224
|
-
/**
|
|
225
|
-
* - The length of the entry's text.
|
|
226
|
-
*/
|
|
227
|
-
textLength?: number | undefined;
|
|
228
|
-
/**
|
|
229
|
-
* -
|
|
230
|
-
* Where the entry is written in the opening line.
|
|
231
|
-
*/
|
|
232
|
-
entry?: {
|
|
233
|
-
line: number;
|
|
234
|
-
columns: {
|
|
235
|
-
lang: number;
|
|
236
|
-
map?: number;
|
|
237
|
-
font?: number;
|
|
238
|
-
};
|
|
239
|
-
} | undefined;
|
|
240
|
-
};
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
* @property {string|null} lang - The language it is set in, as written: its
|
|
7
7
|
* own `lang=`, else the one the div or fence around it states.
|
|
8
8
|
* @property {string|null} tag - The BCP 47 tag it resolves to, or null.
|
|
9
|
-
* @property {string|null} font - Its font,
|
|
10
|
-
*
|
|
11
|
-
* @property {string|null} map - Its map
|
|
12
|
-
*
|
|
9
|
+
* @property {string|null} font - Its explicit font, an inherited ordinary
|
|
10
|
+
* prose family, or the configured default for an opted-in native run.
|
|
11
|
+
* @property {string|null} map - Its explicit map or the configured map of an
|
|
12
|
+
* opted-in native run; null for Roman language-only text.
|
|
13
|
+
* @property {boolean} [nativefont] - Explicit native opt-in on this construct;
|
|
14
|
+
* absent on Roman runs. This internal flag is not a SQL column.
|
|
13
15
|
* @property {number} line - 1-based file line of its opening.
|
|
14
16
|
* @property {number} column - 1-based UTF-16 file column of its opening.
|
|
15
17
|
*/
|
|
@@ -36,7 +38,7 @@ export function recordRuns(body: string, { context, bodyLine, bodyColumn, syntax
|
|
|
36
38
|
syntax?: import("./content-session.mjs").ContentSyntax | undefined;
|
|
37
39
|
}): RecordRun[];
|
|
38
40
|
/**
|
|
39
|
-
* Give
|
|
41
|
+
* Give explicitly native recorded runs the map and face their language names in
|
|
40
42
|
* `data.writtenIn`, where the run leaves them unstated, as a run is set. Read
|
|
41
43
|
* once every record exists, since a run's language note may be recorded after
|
|
42
44
|
* the note that marks it.
|
|
@@ -88,15 +90,20 @@ export type RecordRun = {
|
|
|
88
90
|
*/
|
|
89
91
|
tag: string | null;
|
|
90
92
|
/**
|
|
91
|
-
* - Its font,
|
|
92
|
-
*
|
|
93
|
+
* - Its explicit font, an inherited ordinary
|
|
94
|
+
* prose family, or the configured default for an opted-in native run.
|
|
93
95
|
*/
|
|
94
96
|
font: string | null;
|
|
95
97
|
/**
|
|
96
|
-
* - Its map
|
|
97
|
-
*
|
|
98
|
+
* - Its explicit map or the configured map of an
|
|
99
|
+
* opted-in native run; null for Roman language-only text.
|
|
98
100
|
*/
|
|
99
101
|
map: string | null;
|
|
102
|
+
/**
|
|
103
|
+
* - Explicit native opt-in on this construct;
|
|
104
|
+
* absent on Roman runs. This internal flag is not a SQL column.
|
|
105
|
+
*/
|
|
106
|
+
nativefont?: boolean | undefined;
|
|
100
107
|
/**
|
|
101
108
|
* - 1-based file line of its opening.
|
|
102
109
|
*/
|
|
@@ -7,19 +7,21 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @param {DeliveryConfig} config - The resolved configuration.
|
|
9
9
|
* @param {import("./script-fonts.mjs").ScriptFonts} installed - The fonts package.
|
|
10
|
+
* @param {import("./content-session.mjs").ContentSession} [session] - Captured sources when staging within a content build.
|
|
10
11
|
* @returns {ReadonlySet<string>} The slugs of the faces used.
|
|
11
12
|
*/
|
|
12
|
-
export function facesUsed(config: DeliveryConfig, installed: import("./script-fonts.mjs").ScriptFonts): ReadonlySet<string>;
|
|
13
|
+
export function facesUsed(config: DeliveryConfig, installed: import("./script-fonts.mjs").ScriptFonts, session?: import("./content-session.mjs").ContentSession): ReadonlySet<string>;
|
|
13
14
|
/**
|
|
14
15
|
* The files a target receives, as paths relative to the fonts package root.
|
|
15
16
|
*
|
|
16
17
|
* @param {DeliveryConfig} config - The resolved configuration.
|
|
17
18
|
* @param {string[]} formats - The font formats the target uses: `woff2`, `ttf`.
|
|
19
|
+
* @param {import("./content-session.mjs").ContentSession} [session] - Captured sources when staging within a content build.
|
|
18
20
|
* @returns {{root: string, version: string, files: string[]}|undefined} The
|
|
19
21
|
* files, sorted: `fonts.css`, `LICENSE` and every file in `fonts/` of a
|
|
20
22
|
* listed format. `undefined` when the consumer ships none.
|
|
21
23
|
*/
|
|
22
|
-
export function scriptFontFiles(config: DeliveryConfig, formats: string[]): {
|
|
24
|
+
export function scriptFontFiles(config: DeliveryConfig, formats: string[], session?: import("./content-session.mjs").ContentSession): {
|
|
23
25
|
root: string;
|
|
24
26
|
version: string;
|
|
25
27
|
files: string[];
|
|
@@ -46,18 +48,20 @@ export function stagedStylesheet(css: string, staged: ReadonlySet<string>): stri
|
|
|
46
48
|
* @param {string} dest - The directory to fill; created when there is
|
|
47
49
|
* something to put in it.
|
|
48
50
|
* @param {string[]} formats - The font formats the target uses.
|
|
51
|
+
* @param {import("./content-session.mjs").ContentSession} [session] - Captured sources when staging within a content build.
|
|
49
52
|
* @returns {number} How many files were written; 0 when the consumer ships none.
|
|
50
53
|
*/
|
|
51
|
-
export function copyScriptFonts(config: DeliveryConfig, dest: string, formats: string[]): number;
|
|
54
|
+
export function copyScriptFonts(config: DeliveryConfig, dest: string, formats: string[], session?: import("./content-session.mjs").ContentSession): number;
|
|
52
55
|
/**
|
|
53
56
|
* Whether the package ships what its manifest and stylesheet promise: the
|
|
54
57
|
* stylesheet, the licence and every file the manifest lists.
|
|
55
58
|
*
|
|
56
59
|
* @param {DeliveryConfig} config - The resolved configuration.
|
|
60
|
+
* @param {import("./content-session.mjs").ContentSession} [session] - Captured sources when staging within a content build.
|
|
57
61
|
* @returns {{file: string, severity: "error", message: string}[]} One finding
|
|
58
62
|
* per missing file, located at the manifest; empty when the consumer ships none.
|
|
59
63
|
*/
|
|
60
|
-
export function checkScriptFonts(config: DeliveryConfig): {
|
|
64
|
+
export function checkScriptFonts(config: DeliveryConfig, session?: import("./content-session.mjs").ContentSession): {
|
|
61
65
|
file: string;
|
|
62
66
|
severity: "error";
|
|
63
67
|
message: string;
|
|
@@ -73,7 +73,7 @@ export function metreMessage({ min, max }: {
|
|
|
73
73
|
* @param {ReadonlyArray<{start: number, end: number, indent: string, attributes: Record<string, string>, classes: string[]}>} blocks -
|
|
74
74
|
* The fences, from {@link module:engine/content-verse.scanVerse}.
|
|
75
75
|
* @param {string[]} lines - The source's lines.
|
|
76
|
-
* @param {{metres?: ReadonlyMap<string, import("./metre-declaration.mjs").Metre>, metreBooks?: ReadonlyMap<string, MetreBook>, lexicons?: ReadonlyMap<string, unknown>,
|
|
76
|
+
* @param {{languages?: Readonly<Record<string, {tag: string}>>, metres?: ReadonlyMap<string, import("./metre-declaration.mjs").Metre>, metreBooks?: ReadonlyMap<string, MetreBook>, lexicons?: ReadonlyMap<string, unknown>, attributeColumns: (line: string, key: string) => {key: number, value: number}}} ctx -
|
|
77
77
|
* The metres and books, and how the fence says its columns and where its
|
|
78
78
|
* keys sit.
|
|
79
79
|
* @returns {{errors: object[], warnings: object[]}} The findings at 1-based
|
|
@@ -86,11 +86,12 @@ export function metreFindings(blocks: ReadonlyArray<{
|
|
|
86
86
|
attributes: Record<string, string>;
|
|
87
87
|
classes: string[];
|
|
88
88
|
}>, lines: string[], ctx: {
|
|
89
|
+
languages?: Readonly<Record<string, {
|
|
90
|
+
tag: string;
|
|
91
|
+
}>>;
|
|
89
92
|
metres?: ReadonlyMap<string, import("./metre-declaration.mjs").Metre>;
|
|
90
93
|
metreBooks?: ReadonlyMap<string, MetreBook>;
|
|
91
94
|
lexicons?: ReadonlyMap<string, unknown>;
|
|
92
|
-
columnsClass: string;
|
|
93
|
-
columnKeys: readonly string[];
|
|
94
95
|
attributeColumns: (line: string, key: string) => {
|
|
95
96
|
key: number;
|
|
96
97
|
value: number;
|