@heroiclands/package-build 24.1.1 → 25.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +1 -0
- package/bin/content-commands.mjs +30 -96
- package/bin/encoding-commands.mjs +146 -0
- package/bin/package-build.mjs +35 -24
- package/config.mjs +25 -0
- package/convert.mjs +182 -0
- package/docs/api.md +154 -11
- package/docs/authoring/links-and-markup.md +260 -473
- package/docs/commands.md +118 -119
- package/docs/configuration.md +31 -13
- package/docs/content-format.md +11 -4
- package/docs/diagnostics.md +43 -16
- package/docs/encoding-core.md +135 -0
- package/docs/guides/book.md +2 -2
- package/docs/guides/module-project.md +23 -1
- package/docs/guides/site.md +2 -2
- package/docs/guides/writing-in-invented-scripts.md +453 -569
- package/docs/reference/format-details.md +290 -380
- package/docs/reference/note-types.md +80 -62
- package/docs/source-preview.md +8 -0
- package/e2e.mjs +1 -1
- package/engine/base-compiler.mjs +27 -9
- package/engine/content-charset.mjs +21 -1
- package/engine/content-format.yaml +7 -2
- package/engine/content-index.mjs +6 -2
- package/engine/content-links.mjs +1 -0
- package/engine/content-scripts.mjs +658 -423
- package/engine/content-scroll.mjs +4 -4
- package/engine/content-spans.mjs +40 -9
- package/engine/content-verse.mjs +1 -1
- package/engine/converter-data.mjs +70 -0
- package/engine/dictionary-rows.mjs +2 -34
- package/engine/encoding-integrity.mjs +94 -0
- package/engine/encoding-language.mjs +506 -0
- package/engine/encoding-lexicon.mjs +699 -0
- package/engine/encoding-notes.mjs +186 -0
- package/engine/encoding-standard.mjs +42 -0
- package/engine/encoding-template.mjs +313 -0
- package/engine/encoding-terms.mjs +141 -0
- package/engine/encoding.mjs +946 -0
- package/engine/extension-attributes.mjs +2 -0
- package/engine/helpers.mjs +1 -1
- package/engine/index.mjs +10 -0
- package/engine/language-data.mjs +4 -1
- package/engine/language-terms.mjs +23 -12
- package/engine/{logographic.mjs → language-writings.mjs} +29 -38
- package/engine/markup-validation.mjs +1 -1
- package/engine/note-vocabulary.mjs +4 -158
- package/engine/pdf-render.mjs +31 -3
- package/engine/roman-characters.mjs +232 -0
- package/engine/roman-run.mjs +149 -0
- package/engine/roman-verse.mjs +95 -0
- package/engine/run-rows.mjs +29 -31
- package/engine/run-words.mjs +2 -2
- package/engine/script-emphasis-terms.mjs +3 -0
- package/engine/script-emphasis.mjs +3 -10
- package/engine/script-font-delivery.mjs +9 -12
- package/engine/script-fonts.mjs +2 -1
- package/engine/site-build.mjs +14 -5
- package/engine/site-preview.mjs +12 -2
- package/engine/sql-tables.mjs +36 -31
- package/engine/verse-metre.mjs +1 -1
- package/engine/word-forms.mjs +1 -1
- package/engine/word-inflections.mjs +48 -0
- package/engine/word-rows.mjs +1 -1
- package/engine/word-terms.mjs +16 -17
- package/package.json +11 -5
- package/types/config.d.mts +5 -0
- package/types/convert.d.mts +44 -0
- package/types/e2e.d.mts +1 -1
- package/types/engine/base-compiler.d.mts +4 -2
- package/types/engine/content-charset.d.mts +8 -0
- package/types/engine/content-index.d.mts +4 -1
- package/types/engine/content-scripts.d.mts +108 -42
- package/types/engine/converter-data.d.mts +11 -0
- package/types/engine/dictionary-rows.d.mts +1 -25
- package/types/engine/encoding-integrity.d.mts +14 -0
- package/types/engine/encoding-language.d.mts +36 -0
- package/types/engine/encoding-lexicon.d.mts +259 -0
- package/types/engine/encoding-notes.d.mts +39 -0
- package/types/engine/encoding-standard.d.mts +11 -0
- package/types/engine/encoding-template.d.mts +43 -0
- package/types/engine/encoding-terms.d.mts +105 -0
- package/types/engine/encoding.d.mts +155 -0
- package/types/engine/helpers.d.mts +1 -1
- package/types/engine/index.d.mts +5 -0
- package/types/engine/language-terms.d.mts +1 -1
- package/types/engine/{logographic.d.mts → language-writings.d.mts} +6 -6
- package/types/engine/markup-validation.d.mts +1 -1
- package/types/engine/pdf-render.d.mts +1 -1
- package/types/engine/roman-characters.d.mts +45 -0
- package/types/engine/roman-run.d.mts +101 -0
- package/types/engine/roman-verse.d.mts +23 -0
- package/types/engine/run-rows.d.mts +13 -20
- package/types/engine/script-emphasis-terms.d.mts +2 -0
- package/types/engine/script-emphasis.d.mts +1 -1
- package/types/engine/script-font-delivery.d.mts +2 -3
- package/types/engine/script-fonts.d.mts +5 -0
- package/types/engine/site-preview.d.mts +1 -1
- package/types/engine/word-inflections.d.mts +25 -0
- package/engine/map-lexicon.mjs +0 -1034
- package/engine/text-maps.mjs +0 -654
- package/engine/written-in.mjs +0 -204
- package/types/engine/map-lexicon.d.mts +0 -330
- package/types/engine/text-maps.d.mts +0 -189
- package/types/engine/written-in.d.mts +0 -76
|
@@ -7,11 +7,8 @@
|
|
|
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
9
|
* @property {string|null} font - Its explicit font, an inherited ordinary
|
|
10
|
-
* prose family, or the
|
|
11
|
-
* @property {string|null}
|
|
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.
|
|
10
|
+
* prose family, or the font of the selected encoding document.
|
|
11
|
+
* @property {string|null} enc - Its resolved encoding document, or default for Roman text.
|
|
15
12
|
* @property {number} line - 1-based file line of its opening.
|
|
16
13
|
* @property {number} column - 1-based UTF-16 file column of its opening.
|
|
17
14
|
*/
|
|
@@ -38,22 +35,24 @@ export function recordRuns(body: string, { context, bodyLine, bodyColumn, syntax
|
|
|
38
35
|
syntax?: import("./content-session.mjs").ContentSyntax | undefined;
|
|
39
36
|
}): RecordRun[];
|
|
40
37
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* once every record exists, since a run's language note may be recorded after
|
|
44
|
-
* the note that marks it.
|
|
38
|
+
* Resolve recorded encoding Addresses and fill the language and font supplied
|
|
39
|
+
* by each selected document, once every index record exists.
|
|
45
40
|
*
|
|
46
41
|
* @param {Record<string, any>[]} records - The package's index records; each
|
|
47
42
|
* note record's `runs` is updated in place.
|
|
48
|
-
* @param {{languages?: Readonly<Record<string, {tag: string, note?: string}>>, contentPackage?: string}} config -
|
|
43
|
+
* @param {{languages?: Readonly<Record<string, {tag: string, note?: string}>>, contentPackage?: string, rootDir?:string, paths?:{content?:string}}} config -
|
|
49
44
|
* The configured languages, whose `note` names each language note.
|
|
50
45
|
*/
|
|
51
|
-
export function
|
|
46
|
+
export function fillEncodingRuns(records: Record<string, any>[], config: {
|
|
52
47
|
languages?: Readonly<Record<string, {
|
|
53
48
|
tag: string;
|
|
54
49
|
note?: string;
|
|
55
50
|
}>>;
|
|
56
51
|
contentPackage?: string;
|
|
52
|
+
rootDir?: string;
|
|
53
|
+
paths?: {
|
|
54
|
+
content?: string;
|
|
55
|
+
};
|
|
57
56
|
}): void;
|
|
58
57
|
/**
|
|
59
58
|
* The containing page's NOTE identity.
|
|
@@ -91,19 +90,13 @@ export type RecordRun = {
|
|
|
91
90
|
tag: string | null;
|
|
92
91
|
/**
|
|
93
92
|
* - Its explicit font, an inherited ordinary
|
|
94
|
-
* prose family, or the
|
|
93
|
+
* prose family, or the font of the selected encoding document.
|
|
95
94
|
*/
|
|
96
95
|
font: string | null;
|
|
97
96
|
/**
|
|
98
|
-
* - Its
|
|
99
|
-
* opted-in native run; null for Roman language-only text.
|
|
97
|
+
* - Its resolved encoding document, or default for Roman text.
|
|
100
98
|
*/
|
|
101
|
-
|
|
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;
|
|
99
|
+
enc: string | null;
|
|
107
100
|
/**
|
|
108
101
|
* - 1-based file line of its opening.
|
|
109
102
|
*/
|
|
@@ -26,3 +26,5 @@ export const LANGUAGE_EMPHASES: readonly string[];
|
|
|
26
26
|
export const SCRIPT_DIRECTIONS: readonly string[];
|
|
27
27
|
/** The `subType` of a script note. */
|
|
28
28
|
export const SCRIPT_SUBTYPE: "script";
|
|
29
|
+
/** The ordinary prose families accepted by font=. */
|
|
30
|
+
export const GENERIC_FAMILIES: readonly string[];
|
|
@@ -12,7 +12,7 @@ export function emphasesFromRecords(records: Iterable<Record<string, any>> | und
|
|
|
12
12
|
*
|
|
13
13
|
* @param {ReadonlyMap<string, Record<string, any>>} byName - Each configured
|
|
14
14
|
* language's note record, by language name, from
|
|
15
|
-
* {@link module:engine/
|
|
15
|
+
* {@link module:engine/encoding-lexicon.languageRecordsByName}.
|
|
16
16
|
* @returns {Map<string, LanguageEmphasis>} The conventions, by language name;
|
|
17
17
|
* a language whose note states none, or one the build does not know, is
|
|
18
18
|
* absent.
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The faces the package's notes set text in, read from the notes
|
|
3
3
|
* themselves: every Markdown file under the content tree that writes `font=`
|
|
4
|
-
* is scanned for its runs, and
|
|
5
|
-
*
|
|
6
|
-
* in it.
|
|
4
|
+
* is scanned for its runs, and encoding documents supply the fonts their
|
|
5
|
+
* encoded runs infer.
|
|
7
6
|
*
|
|
8
7
|
* @param {DeliveryConfig} config - The resolved configuration.
|
|
9
8
|
* @param {import("./script-fonts.mjs").ScriptFonts} installed - The fonts package.
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @typedef {object} FaceCodepoint
|
|
5
5
|
* @property {string} codepoint - `U+` and the hexadecimal code point.
|
|
6
6
|
* @property {string} glyph - The glyph's name in the face.
|
|
7
|
+
* @property {string} [code] - The font's case-sensitive glyph code.
|
|
7
8
|
* @property {string} kind - What it is: `letter`, `numeral`, `mark` and so on.
|
|
8
9
|
*/
|
|
9
10
|
/**
|
|
@@ -77,6 +78,10 @@ export type FaceCodepoint = {
|
|
|
77
78
|
* - The glyph's name in the face.
|
|
78
79
|
*/
|
|
79
80
|
glyph: string;
|
|
81
|
+
/**
|
|
82
|
+
* - The font's case-sensitive glyph code.
|
|
83
|
+
*/
|
|
84
|
+
code?: string | undefined;
|
|
80
85
|
/**
|
|
81
86
|
* - What it is: `letter`, `numeral`, `mark` and so on.
|
|
82
87
|
*/
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @param {string} text - Markdown, optionally beginning with YAML frontmatter.
|
|
12
12
|
* @param {{dark?: boolean, infobox?: boolean, file?: string, currentDate?: string,
|
|
13
13
|
* index?: import("./preview-index.mjs").PreviewIndex}} [options] - Explicit palette, profile visibility, diagnostic filename, neutral current date (default "720.1") and the content index, from {@link module:engine/preview-index.previewIndex}.
|
|
14
|
-
* @returns {{ok: boolean, html: string, frontmatter: object, findings: object[]}} HTML and metadata with locally calculable ages; unavailable ages remain absent or null.
|
|
14
|
+
* @returns {{ok: boolean, html: string, frontmatter: object, findings: object[]}} HTML and metadata with locally calculable ages; unavailable ages remain absent or null. Error findings set `ok` to false while retaining the HTML.
|
|
15
15
|
*/
|
|
16
16
|
export function renderPreview(text: string, { dark, infobox, file, currentDate, index }?: {
|
|
17
17
|
dark?: boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A noun's stated plural, or the first literal ending replacement that fits.
|
|
3
|
+
*
|
|
4
|
+
* @param {{form: string, class?: unknown, plural?: unknown}} word - A word of
|
|
5
|
+
* `data.words`.
|
|
6
|
+
* @param {Record<string, any>|undefined} grammar - Its language's
|
|
7
|
+
* `data.grammar`.
|
|
8
|
+
* @returns {string|null} The plural, or `null` for a word that is no noun or
|
|
9
|
+
* that no rule fits.
|
|
10
|
+
*/
|
|
11
|
+
export function pluralOf(word: {
|
|
12
|
+
form: string;
|
|
13
|
+
class?: unknown;
|
|
14
|
+
plural?: unknown;
|
|
15
|
+
}, grammar: Record<string, any> | undefined): string | null;
|
|
16
|
+
/**
|
|
17
|
+
* The plural a language's `data.grammar.plural` rule gives a form: the first
|
|
18
|
+
* literal ending replacement that fits, whatever the form's class.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} form - The form.
|
|
21
|
+
* @param {Record<string, any>|undefined} grammar - Its language's
|
|
22
|
+
* `data.grammar`.
|
|
23
|
+
* @returns {string|null} The plural, or `null` where no rule fits.
|
|
24
|
+
*/
|
|
25
|
+
export function pluralByRule(form: string, grammar: Record<string, any> | undefined): string | null;
|