@heroiclands/package-build 23.6.1 → 23.7.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 +39 -0
- package/docs/authoring/links-and-markup.md +418 -24
- package/docs/content-format.md +1 -1
- package/docs/reference/format-details.md +680 -73
- package/docs/reference/note-types.md +208 -39
- package/engine/content-format.yaml +13 -0
- package/engine/content-index.mjs +21 -14
- package/engine/dictionary-layout.mjs +7 -3
- package/engine/dictionary-rows.mjs +6 -13
- package/engine/index-records.mjs +1 -0
- package/engine/language-data.mjs +613 -0
- package/engine/language-rows.mjs +993 -0
- package/engine/language-terms.mjs +1718 -0
- package/engine/language-words.mjs +115 -6
- package/engine/note-addresses.mjs +38 -4
- package/engine/note-vocabulary.mjs +9 -2
- package/engine/sql-tables.mjs +45 -12
- package/engine/word-citations.mjs +206 -0
- package/engine/word-rows.mjs +66 -12
- package/engine/word-terms.mjs +131 -13
- package/package.json +1 -1
- package/types/engine/dictionary-layout.d.mts +5 -3
- package/types/engine/language-data.d.mts +22 -0
- package/types/engine/language-rows.d.mts +313 -0
- package/types/engine/language-terms.d.mts +367 -0
- package/types/engine/note-addresses.d.mts +8 -10
- package/types/engine/sql-tables.d.mts +2 -2
- package/types/engine/word-citations.d.mts +43 -0
- package/types/engine/word-rows.d.mts +18 -1
- package/types/engine/word-terms.d.mts +27 -0
|
@@ -63,6 +63,14 @@ export const STRUCTURED_ADDRESSES: readonly ({
|
|
|
63
63
|
type: string;
|
|
64
64
|
accepts: string[];
|
|
65
65
|
lenient: boolean;
|
|
66
|
+
} | {
|
|
67
|
+
lenient: boolean;
|
|
68
|
+
system?: string | string[] | undefined;
|
|
69
|
+
accepts?: string | string[] | undefined;
|
|
70
|
+
type?: string | string[] | undefined;
|
|
71
|
+
noteType: string;
|
|
72
|
+
path: (string | string[] | undefined)[];
|
|
73
|
+
shape: string;
|
|
66
74
|
} | {
|
|
67
75
|
path: string[];
|
|
68
76
|
shape: string;
|
|
@@ -70,7 +78,6 @@ export const STRUCTURED_ADDRESSES: readonly ({
|
|
|
70
78
|
accepts: string[];
|
|
71
79
|
system: string;
|
|
72
80
|
noteType?: undefined;
|
|
73
|
-
lenient?: undefined;
|
|
74
81
|
} | {
|
|
75
82
|
noteType: string;
|
|
76
83
|
path: string[];
|
|
@@ -78,14 +85,5 @@ export const STRUCTURED_ADDRESSES: readonly ({
|
|
|
78
85
|
type: string;
|
|
79
86
|
accepts: string[];
|
|
80
87
|
system?: undefined;
|
|
81
|
-
lenient?: undefined;
|
|
82
|
-
} | {
|
|
83
|
-
noteType: string;
|
|
84
|
-
path: string[];
|
|
85
|
-
shape: string;
|
|
86
|
-
lenient: boolean;
|
|
87
|
-
type?: undefined;
|
|
88
|
-
accepts?: undefined;
|
|
89
|
-
system?: undefined;
|
|
90
88
|
})[];
|
|
91
89
|
export { AddressEntries, encodeAddresses, cloneAddressState, publishAddresses, readPublishedAddresses, flattenPublishedAddresses } from "./address-values.mjs";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @param {string} markdown - The note body, frontmatter already stripped.
|
|
9
9
|
* @returns {Array<{line: number, close: number, indent: string, query: string,
|
|
10
|
-
* allowEmpty: boolean, sectionLevel: number, showKey: boolean, layout: string, block: string}>} One entry per
|
|
10
|
+
* allowEmpty: boolean, sectionLevel: number, showKey: boolean|"only", layout: string, block: string}>} One entry per
|
|
11
11
|
* fence, in document order.
|
|
12
12
|
*/
|
|
13
13
|
export function findSqlBlocks(markdown: string): Array<{
|
|
@@ -17,7 +17,7 @@ export function findSqlBlocks(markdown: string): Array<{
|
|
|
17
17
|
query: string;
|
|
18
18
|
allowEmpty: boolean;
|
|
19
19
|
sectionLevel: number;
|
|
20
|
-
showKey: boolean;
|
|
20
|
+
showKey: boolean | "only";
|
|
21
21
|
layout: string;
|
|
22
22
|
block: string;
|
|
23
23
|
}>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A form as uses are matched against it: diacritics taken off, case folded.
|
|
3
|
+
*
|
|
4
|
+
* @param {unknown} text - A form or a use.
|
|
5
|
+
* @returns {string} The folded form.
|
|
6
|
+
*/
|
|
7
|
+
export function foldForm(text: unknown): string;
|
|
8
|
+
/**
|
|
9
|
+
* The marked uses in a note's body: the text of every italic span that holds
|
|
10
|
+
* text alone, in document order.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} body - The note's Markdown body.
|
|
13
|
+
* @returns {string[]} Each span's text.
|
|
14
|
+
*/
|
|
15
|
+
export function markedUses(body: string): string[];
|
|
16
|
+
/**
|
|
17
|
+
* Each language note's cited words: for every word some note's marked use
|
|
18
|
+
* spells, the Addresses of the notes citing it.
|
|
19
|
+
*
|
|
20
|
+
* @param {Iterable<Record<string, any>>} records - Index records.
|
|
21
|
+
* @param {Iterable<{record: Record<string, any>, body: string}>} notes - The
|
|
22
|
+
* notes whose bodies are read, each with its record.
|
|
23
|
+
* @returns {Map<string, Map<string, string[]>>} By language Address, by the
|
|
24
|
+
* word's form, the citing notes in code-point order.
|
|
25
|
+
*/
|
|
26
|
+
export function wordCitations(records: Iterable<Record<string, any>>, notes: Iterable<{
|
|
27
|
+
record: Record<string, any>;
|
|
28
|
+
body: string;
|
|
29
|
+
}>): Map<string, Map<string, string[]>>;
|
|
30
|
+
/**
|
|
31
|
+
* Set each language record's `citations` from {@link wordCitations}: one entry
|
|
32
|
+
* per cited word, in the order the words stand, `{ form, notes }`. A language
|
|
33
|
+
* with no cited word carries no `citations`.
|
|
34
|
+
*
|
|
35
|
+
* @param {Record<string, any>[]} records - Index records, written in place.
|
|
36
|
+
* @param {Iterable<{record: Record<string, any>, body: string}>} notes - The
|
|
37
|
+
* notes whose bodies are read.
|
|
38
|
+
* @returns {void}
|
|
39
|
+
*/
|
|
40
|
+
export function attachCitations(records: Record<string, any>[], notes: Iterable<{
|
|
41
|
+
record: Record<string, any>;
|
|
42
|
+
body: string;
|
|
43
|
+
}>): void;
|
|
@@ -48,6 +48,22 @@ export function languageLineages(records: Iterable<Record<string, any>>): {
|
|
|
48
48
|
* @returns {boolean}
|
|
49
49
|
*/
|
|
50
50
|
export function isLanguageRecord(record: Record<string, any>): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* A record's Address as a reference to it is written: in the `note` system,
|
|
53
|
+
* so it compares equal to the Addresses other notes state.
|
|
54
|
+
*
|
|
55
|
+
* @param {Record<string, any>} record - An index record.
|
|
56
|
+
* @returns {string|null} The Address, or `null` for a record naming no note.
|
|
57
|
+
*/
|
|
58
|
+
export function noteAddressOf(record: Record<string, any>): string | null;
|
|
59
|
+
/**
|
|
60
|
+
* A lookup of the notes citing a word, from records that carry `citations`.
|
|
61
|
+
*
|
|
62
|
+
* @param {Iterable<Record<string, any>>} records - Index records.
|
|
63
|
+
* @returns {(language: string, form: string) => string[]} The citing notes;
|
|
64
|
+
* empty where none cites the word.
|
|
65
|
+
*/
|
|
66
|
+
export function citationLookup(records: Iterable<Record<string, any>>): (language: string, form: string) => string[];
|
|
51
67
|
/**
|
|
52
68
|
* The `words` rows of a set of index records.
|
|
53
69
|
*
|
|
@@ -62,7 +78,8 @@ export function isLanguageRecord(record: Record<string, any>): boolean;
|
|
|
62
78
|
export function wordRows(records: Iterable<Record<string, any>>, all?: Iterable<Record<string, any>>): object[];
|
|
63
79
|
/**
|
|
64
80
|
* The `affixes` rows of a set of index records: one per `data.affixes` entry
|
|
65
|
-
* of a language note, which is the row's `language
|
|
81
|
+
* of a language note, which is the row's `language`, with `written`, the form
|
|
82
|
+
* as a table prints it: `∅` for a zero affix, whose `form` is `NULL`.
|
|
66
83
|
*
|
|
67
84
|
* @param {Iterable<Record<string, any>>} records - Index records, every
|
|
68
85
|
* Address a string, already narrowed to the audience being published to.
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A word's senses: one for a string gloss, one per entry for a list, each
|
|
3
|
+
* trimmed, blanks dropped.
|
|
4
|
+
*
|
|
5
|
+
* @param {unknown} gloss - The word's `gloss`.
|
|
6
|
+
* @returns {string[]} The senses, in order.
|
|
7
|
+
*/
|
|
8
|
+
export function glossSenses(gloss: unknown): string[];
|
|
9
|
+
/**
|
|
10
|
+
* A word's gloss as one line of text: its senses joined by `; `, or `null`
|
|
11
|
+
* where it states none.
|
|
12
|
+
*
|
|
13
|
+
* @param {unknown} gloss - The word's `gloss`.
|
|
14
|
+
* @returns {string|null}
|
|
15
|
+
*/
|
|
16
|
+
export function glossText(gloss: unknown): string | null;
|
|
1
17
|
/**
|
|
2
18
|
* Why a pronunciation is not a respelling, or `undefined` when it is one.
|
|
3
19
|
*
|
|
@@ -29,6 +45,17 @@ export const WORD_DATA_KEYS: readonly string[];
|
|
|
29
45
|
* one; `coined`, `substrate` and `island` name no form.
|
|
30
46
|
*/
|
|
31
47
|
export const WORD_SOURCE_KINDS: readonly string[];
|
|
48
|
+
/**
|
|
49
|
+
* What an affix makes: a case, a word derived from another, a verb's tense,
|
|
50
|
+
* aspect, mood or voice, a given name's ending, or a lineage name's ending.
|
|
51
|
+
*/
|
|
52
|
+
export const AFFIX_KINDS: readonly string[];
|
|
53
|
+
/** The affix kind whose ending says who the name is given to. */
|
|
54
|
+
export const NAME_AFFIX_KIND: "name";
|
|
55
|
+
/** How a zero affix is written where a table prints it. */
|
|
56
|
+
export const ZERO_AFFIX: "\u2205";
|
|
57
|
+
/** Who a given name's ending is given to. */
|
|
58
|
+
export const AFFIX_GIVEN: readonly string[];
|
|
32
59
|
/** The source kind that requires `language`. */
|
|
33
60
|
export const BORROWED_SOURCE_KIND: "borrowed";
|
|
34
61
|
/**
|