@heroiclands/package-build 23.6.1 → 23.7.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 +26 -0
- package/docs/authoring/links-and-markup.md +239 -24
- package/docs/content-format.md +1 -1
- package/docs/reference/format-details.md +517 -73
- package/docs/reference/note-types.md +152 -39
- package/engine/content-format.yaml +10 -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 +378 -0
- package/engine/language-rows.mjs +761 -0
- package/engine/language-terms.mjs +1203 -0
- package/engine/language-words.mjs +40 -6
- package/engine/note-addresses.mjs +38 -4
- package/engine/note-vocabulary.mjs +9 -2
- package/engine/sql-tables.mjs +34 -11
- package/engine/word-citations.mjs +206 -0
- package/engine/word-rows.mjs +58 -9
- package/engine/word-terms.mjs +71 -11
- 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 +227 -0
- package/types/engine/language-terms.d.mts +265 -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 +16 -0
- package/types/engine/word-terms.d.mts +16 -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
|
*
|
|
@@ -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
|
*
|