@heroiclands/package-build 23.13.0 → 24.0.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 +50 -0
- package/README.md +2 -1
- package/assets/preview/gitea.ini +12 -7
- package/assets/styles/content-base.css +150 -1
- package/bin/content-commands.mjs +356 -210
- package/bin/package-build.mjs +3 -2
- package/ci/check-banners.mjs +7 -7
- package/config.mjs +21 -6
- package/content-config.mjs +199 -80
- package/docs/api.md +93 -72
- package/docs/authoring/links-and-markup.md +316 -78
- package/docs/commands.md +248 -80
- package/docs/configuration.md +210 -102
- package/docs/content-format.md +2 -2
- package/docs/diagnostics.md +2 -2
- package/docs/getting-started.md +1 -1
- package/docs/guides/icons.md +1 -1
- package/docs/guides/module-project.md +5 -8
- package/docs/guides/release-and-deploy.md +2 -2
- package/docs/guides/site.md +155 -23
- package/docs/guides/system-project.md +1 -1
- package/docs/guides/writing-in-invented-scripts.md +1247 -0
- package/docs/index.md +1 -0
- package/docs/project-setup.md +28 -30
- package/docs/reference/format-details.md +589 -308
- package/docs/reference/note-types.md +40 -10
- package/docs/reference/theme-pages.md +127 -108
- package/docs/source-preview.md +15 -1
- package/engine/asset-shipping.mjs +22 -10
- package/engine/base-compiler.mjs +62 -104
- package/engine/changelog-lint.mjs +1 -1
- package/engine/content-address.mjs +1 -1
- package/engine/content-alerts.mjs +8 -4
- package/engine/content-blocks.mjs +26 -11
- package/engine/content-embeds.mjs +1 -1
- package/engine/content-expand.mjs +376 -0
- package/engine/content-figures.mjs +13 -6
- package/engine/content-format.yaml +8 -0
- package/engine/content-glyphs.mjs +213 -0
- package/engine/content-images.mjs +6 -7
- package/engine/content-links.mjs +3 -3
- package/engine/content-lint.mjs +1 -1
- package/engine/content-render.mjs +453 -0
- package/engine/content-scripts.mjs +326 -27
- package/engine/content-spans.mjs +4 -1
- package/engine/content-styles.mjs +91 -0
- package/engine/content-symbols.mjs +186 -0
- package/engine/content-verse.mjs +6 -18
- package/engine/core-report.mjs +169 -0
- package/engine/core-vocabulary.mjs +208 -0
- package/engine/dictionary-html.mjs +119 -0
- package/engine/field-reference.mjs +1 -1
- package/engine/frontmatter-lint.mjs +1 -1
- package/engine/heading-attributes.mjs +89 -0
- package/engine/helpers.mjs +61 -101
- package/engine/homepage.mjs +17 -29
- package/engine/html-minify.mjs +70 -0
- package/engine/index.mjs +8 -5
- package/engine/language-rows.mjs +8 -2
- package/engine/language-terms.mjs +115 -14
- package/engine/language-words.mjs +12 -0
- package/engine/logographic.mjs +255 -0
- package/engine/map-lexicon.mjs +221 -25
- package/engine/map-places.mjs +5 -4
- package/engine/markdown-expressions.mjs +0 -2
- package/engine/markdownlint-run.mjs +9 -3
- package/engine/markup-validation.mjs +21 -0
- package/engine/metre-declaration.mjs +134 -0
- package/engine/note-matter.mjs +2 -2
- package/engine/note-vocabulary.mjs +187 -3
- package/engine/pdf-build.mjs +68 -133
- package/engine/pdf-render.mjs +102 -44
- package/engine/post-fields.mjs +157 -0
- package/engine/preview-index.mjs +130 -0
- package/engine/preview-source.mjs +450 -0
- package/engine/project-init.mjs +5 -12
- package/engine/prose-config.mjs +3 -3
- package/engine/run-words.mjs +3 -2
- package/engine/script-emphasis-terms.mjs +38 -0
- package/engine/script-emphasis.mjs +295 -0
- package/engine/script-font-delivery.mjs +4 -4
- package/engine/site-build.mjs +265 -313
- package/engine/site-config.mjs +26 -238
- package/engine/site-files.mjs +175 -0
- package/engine/site-index.mjs +9 -4
- package/engine/site-preview.mjs +50 -523
- package/engine/site-reach.mjs +213 -0
- package/engine/site-render.mjs +668 -0
- package/engine/site-root.mjs +90 -39
- package/engine/site-search.mjs +161 -0
- package/engine/site-serve.mjs +274 -0
- package/engine/site-theme-banner.mjs +154 -0
- package/engine/site-theme-urls.mjs +125 -0
- package/engine/site-theme.mjs +939 -0
- package/engine/sql-tables.mjs +9 -6
- package/engine/text-maps.mjs +57 -10
- package/engine/typographer.mjs +248 -0
- package/engine/verse-metre.mjs +357 -0
- package/engine/wikilink-syntax.mjs +29 -47
- package/engine/wikilinks.mjs +758 -279
- package/engine/word-forms.mjs +39 -24
- package/engine/word-rows.mjs +12 -2
- package/engine/word-terms.mjs +29 -4
- package/manifest.mjs +3 -4
- package/package.json +10 -7
- package/{hugo-theme → site-theme}/data/banners.yaml +6 -10
- package/site-theme/layouts/base.hbs +31 -0
- package/site-theme/layouts/blog-list.hbs +30 -0
- package/site-theme/layouts/blog-post.hbs +40 -0
- package/site-theme/layouts/home.hbs +35 -0
- package/site-theme/layouts/list.hbs +20 -0
- package/site-theme/layouts/not-found.hbs +31 -0
- package/site-theme/layouts/page.hbs +7 -0
- package/site-theme/partials/copy-buttons.hbs +37 -0
- package/site-theme/partials/draft-notice.hbs +5 -0
- package/site-theme/partials/exturl.hbs +2 -0
- package/{hugo-theme/layouts/partials/footer.html → site-theme/partials/footer.hbs} +10 -7
- package/site-theme/partials/header.hbs +44 -0
- package/site-theme/partials/hero-banner.hbs +11 -0
- package/site-theme/partials/infobox-entry.hbs +2 -0
- package/site-theme/partials/infobox-section.hbs +31 -0
- package/site-theme/partials/infobox-value.hbs +2 -0
- package/site-theme/partials/infobox.hbs +18 -0
- package/site-theme/partials/list-members.hbs +9 -0
- package/site-theme/partials/nav-links.hbs +5 -0
- package/site-theme/partials/page-body.hbs +48 -0
- package/site-theme/partials/page-list.hbs +14 -0
- package/site-theme/partials/related.hbs +24 -0
- package/site-theme/partials/search-meta.hbs +6 -0
- package/site-theme/partials/search-names.hbs +2 -0
- package/site-theme/partials/search.hbs +52 -0
- package/site-theme/partials/tags.hbs +4 -0
- package/site-theme/partials/toc.hbs +7 -0
- package/{hugo-theme → site-theme}/static/css/style.css +14 -0
- package/stage.mjs +1 -2
- package/types/config.d.mts +8 -4
- package/types/content-config.d.mts +15 -15
- package/types/engine/asset-shipping.d.mts +5 -2
- package/types/engine/base-compiler.d.mts +20 -2
- package/types/engine/content-address.d.mts +1 -1
- package/types/engine/content-alerts.d.mts +8 -2
- package/types/engine/content-blocks.d.mts +11 -4
- package/types/engine/content-expand.d.mts +288 -0
- package/types/engine/content-figures.d.mts +11 -3
- package/types/engine/content-glyphs.d.mts +85 -0
- package/types/engine/content-images.d.mts +6 -7
- package/types/engine/content-links.d.mts +1 -1
- package/types/engine/content-render.d.mts +199 -0
- package/types/engine/content-scripts.d.mts +62 -0
- package/types/engine/content-spans.d.mts +1 -1
- package/types/engine/content-styles.d.mts +33 -0
- package/types/engine/content-symbols.d.mts +35 -0
- package/types/engine/core-report.d.mts +45 -0
- package/types/engine/core-vocabulary.d.mts +53 -0
- package/types/engine/dictionary-html.d.mts +8 -0
- package/types/engine/field-reference.d.mts +1 -1
- package/types/engine/heading-attributes.d.mts +20 -0
- package/types/engine/helpers.d.mts +3 -10
- package/types/engine/homepage.d.mts +11 -24
- package/types/engine/html-minify.d.mts +9 -0
- package/types/engine/index.d.mts +2 -1
- package/types/engine/language-terms.d.mts +24 -2
- package/types/engine/logographic.d.mts +45 -0
- package/types/engine/map-lexicon.d.mts +48 -8
- package/types/engine/map-places.d.mts +8 -0
- package/types/engine/markdown-expressions.d.mts +0 -2
- package/types/engine/metre-declaration.d.mts +39 -0
- package/types/engine/pdf-render.d.mts +6 -2
- package/types/engine/post-fields.d.mts +44 -0
- package/types/engine/preview-index.d.mts +72 -0
- package/types/engine/preview-source.d.mts +51 -0
- package/types/engine/script-emphasis-terms.d.mts +21 -0
- package/types/engine/script-emphasis.d.mts +84 -0
- package/types/engine/script-font-delivery.d.mts +4 -4
- package/types/engine/site-build.d.mts +71 -113
- package/types/engine/site-config.d.mts +14 -134
- package/types/engine/site-files.d.mts +73 -0
- package/types/engine/site-index.d.mts +11 -3
- package/types/engine/site-preview.d.mts +15 -19
- package/types/engine/site-reach.d.mts +76 -0
- package/types/engine/site-render.d.mts +173 -0
- package/types/engine/site-root.d.mts +14 -4
- package/types/engine/site-search.d.mts +54 -0
- package/types/engine/site-serve.d.mts +44 -0
- package/types/engine/site-theme-banner.d.mts +51 -0
- package/types/engine/site-theme-urls.d.mts +60 -0
- package/types/engine/site-theme.d.mts +127 -0
- package/types/engine/text-maps.d.mts +17 -3
- package/types/engine/typographer.d.mts +11 -0
- package/types/engine/verse-metre.d.mts +131 -0
- package/types/engine/wikilink-syntax.d.mts +30 -48
- package/types/engine/wikilinks.d.mts +330 -14
- package/types/engine/word-forms.d.mts +3 -2
- package/types/manifest.d.mts +3 -4
- package/types/stage.d.mts +1 -2
- package/types/vendor/markdownlint.d.mts +8 -0
- package/vendor/markdownlint.mjs +20388 -0
- package/engine/web-wikilinks.mjs +0 -594
- package/hugo-theme/layouts/404.html +0 -85
- package/hugo-theme/layouts/_default/baseof.html +0 -67
- package/hugo-theme/layouts/_default/list.html +0 -139
- package/hugo-theme/layouts/_default/single.html +0 -4
- package/hugo-theme/layouts/blog/list.html +0 -54
- package/hugo-theme/layouts/blog-post/single.html +0 -36
- package/hugo-theme/layouts/index.html +0 -75
- package/hugo-theme/layouts/partials/banner-url.html +0 -141
- package/hugo-theme/layouts/partials/cdn-url.html +0 -36
- package/hugo-theme/layouts/partials/dictionary-lists.html +0 -58
- package/hugo-theme/layouts/partials/draft-notice.html +0 -41
- package/hugo-theme/layouts/partials/draft-state.html +0 -26
- package/hugo-theme/layouts/partials/header.html +0 -35
- package/hugo-theme/layouts/partials/hero-banner.html +0 -85
- package/hugo-theme/layouts/partials/infobox/entry.html +0 -18
- package/hugo-theme/layouts/partials/infobox/items.html +0 -26
- package/hugo-theme/layouts/partials/infobox/section.html +0 -56
- package/hugo-theme/layouts/partials/infobox/value.html +0 -43
- package/hugo-theme/layouts/partials/infobox.html +0 -57
- package/hugo-theme/layouts/partials/page-body.html +0 -152
- package/hugo-theme/layouts/partials/related.html +0 -138
- package/hugo-theme/layouts/partials/search.html +0 -84
- package/hugo-theme/layouts/partials/site-url.html +0 -32
- package/hugo-theme/layouts/partials/tags.html +0 -30
- package/hugo-theme/layouts/partials/toc.html +0 -28
- package/hugo-theme/layouts/partials/warn-missing-banner.html +0 -3
- package/hugo-theme/layouts/shortcodes/cartouche.html +0 -64
- package/hugo-theme/layouts/shortcodes/exturl.html +0 -12
- package/hugo-theme/layouts/shortcodes/glyph.html +0 -43
- package/hugo-theme/layouts/shortcodes/pagelist.html +0 -63
- package/hugo-theme/theme.toml +0 -11
- package/types/engine/web-wikilinks.d.mts +0 -107
- /package/{hugo-theme → site-theme}/data/banner-kinds.yaml +0 -0
- /package/{hugo-theme → site-theme}/static/css/sohl-icons.css +0 -0
- /package/{hugo-theme → site-theme}/static/fonts/game-icons-kb.woff2 +0 -0
- /package/{hugo-theme → site-theme}/static/img/banners/takheperu-hieroglyphs.svg +0 -0
- /package/{hugo-theme → site-theme}/static/img/cartouches/takheperu.svg +0 -0
- /package/{hugo-theme → site-theme}/static/js/inline-spoilers.js +0 -0
|
@@ -48,8 +48,6 @@ export function renderMarkdownExpressions(body: string, { fm, dates, sqlResults,
|
|
|
48
48
|
/**
|
|
49
49
|
* An inline expression, as an author writes one.
|
|
50
50
|
*
|
|
51
|
-
* Hugo shortcodes begin `{{<` or `{{%` and stay in the source for Hugo.
|
|
52
|
-
*
|
|
53
51
|
* Exported because a renderer that meets one has met a body this pass never ran
|
|
54
52
|
* over, and has to be able to say so.
|
|
55
53
|
*
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check a note's `data.metres`: each name's form, that no other entry declares
|
|
3
|
+
* it, and that a beat count is a whole number above zero. The data-key check
|
|
4
|
+
* owns every key, its kind and the closed `kind` list.
|
|
5
|
+
*
|
|
6
|
+
* @param {{file: string, raw?: string, fm?: Record<string, any>}} note - The note.
|
|
7
|
+
* @param {{index?: {notes?: Iterable<object>}}} [context] - The lint index.
|
|
8
|
+
* @returns {object[]} The findings, each at its key.
|
|
9
|
+
*/
|
|
10
|
+
export function checkMetresField(note: {
|
|
11
|
+
file: string;
|
|
12
|
+
raw?: string;
|
|
13
|
+
fm?: Record<string, any>;
|
|
14
|
+
}, { index }?: {
|
|
15
|
+
index?: {
|
|
16
|
+
notes?: Iterable<object>;
|
|
17
|
+
};
|
|
18
|
+
}): object[];
|
|
19
|
+
/** What a metre's `kind` may be. */
|
|
20
|
+
export const METRE_KINDS: readonly string[];
|
|
21
|
+
/** What a metre's `name` may be. */
|
|
22
|
+
export const METRE_NAME: RegExp;
|
|
23
|
+
/**
|
|
24
|
+
* One declared metre.
|
|
25
|
+
*/
|
|
26
|
+
export type Metre = {
|
|
27
|
+
/**
|
|
28
|
+
* - What `scan=` names it by.
|
|
29
|
+
*/
|
|
30
|
+
name: string;
|
|
31
|
+
/**
|
|
32
|
+
* - The beats of a line.
|
|
33
|
+
*/
|
|
34
|
+
beats: number;
|
|
35
|
+
/**
|
|
36
|
+
* - How they are counted: `accentual`.
|
|
37
|
+
*/
|
|
38
|
+
kind: string;
|
|
39
|
+
};
|
|
@@ -26,12 +26,16 @@ export function escapeTypstString(text: string): string;
|
|
|
26
26
|
*/
|
|
27
27
|
export function labelFor(anchor: string): string;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* The shared parser configured for the book: the `book` target of
|
|
30
|
+
* {@link module:engine/content-render.createRenderer}, which parses and leaves
|
|
31
|
+
* the output to this module's Typst stage.
|
|
30
32
|
*
|
|
31
33
|
* `html: false` is the load-bearing setting: raw HTML in a note has no route to
|
|
32
34
|
* Typst at all, which is why {@link module:engine/content-html} reports it. With
|
|
33
35
|
* HTML disabled markdown-it emits the tag as text, so it arrives in the book
|
|
34
|
-
* visibly wrong rather than invisibly missing.
|
|
36
|
+
* visibly wrong rather than invisibly missing. The one tag it reads is the
|
|
37
|
+
* emphasis a script run's convention sets, which the run's rewrite writes and
|
|
38
|
+
* the book prints in its rubric ink or under an overline.
|
|
35
39
|
*
|
|
36
40
|
* @param {object} [registry] - The icon registry.
|
|
37
41
|
* @returns {object} A markdown-it instance.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a note's frontmatter, or a page's parameters, are a post's.
|
|
3
|
+
*
|
|
4
|
+
* @param {{type?: unknown, subType?: unknown}|null|undefined} fm - The frontmatter.
|
|
5
|
+
* @returns {boolean} Whether it is a `doc` of `subType: post`.
|
|
6
|
+
*/
|
|
7
|
+
export function isPost(fm: {
|
|
8
|
+
type?: unknown;
|
|
9
|
+
subType?: unknown;
|
|
10
|
+
} | null | undefined): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether a string is a calendar day, `YYYY-MM-DD`, that exists.
|
|
13
|
+
*
|
|
14
|
+
* @param {unknown} value - The value.
|
|
15
|
+
* @returns {boolean} Whether it is one.
|
|
16
|
+
*/
|
|
17
|
+
export function isCalendarDay(value: unknown): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Scope `data.date` and `data.author` to posts, and check their values.
|
|
20
|
+
*
|
|
21
|
+
* A post with no date is an error at its `subType:` line; a date that is not a
|
|
22
|
+
* calendar day, or an author that is blank, is an error at the value. Either
|
|
23
|
+
* field on a `doc` that is not a post is an error at the key.
|
|
24
|
+
*
|
|
25
|
+
* @param {object} note - The note, as the link index hands it over.
|
|
26
|
+
* @returns {object[]} Findings.
|
|
27
|
+
*/
|
|
28
|
+
export function checkPostFields(note: object): object[];
|
|
29
|
+
/** The `doc` subType a post is. */
|
|
30
|
+
export const POST_SUBTYPE: "post";
|
|
31
|
+
/** `data.date`, as the vocabulary declares it. */
|
|
32
|
+
export const POST_DATE_FIELD: Readonly<{
|
|
33
|
+
name: "date";
|
|
34
|
+
shape: "string";
|
|
35
|
+
kind: "string";
|
|
36
|
+
describe: string;
|
|
37
|
+
}>;
|
|
38
|
+
/** `data.author`, as the vocabulary declares it. */
|
|
39
|
+
export const POST_AUTHOR_FIELD: Readonly<{
|
|
40
|
+
name: "author";
|
|
41
|
+
shape: "string";
|
|
42
|
+
kind: "string";
|
|
43
|
+
describe: string;
|
|
44
|
+
}>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a preview reads to render with an index.
|
|
3
|
+
*
|
|
4
|
+
* @typedef {object} PreviewIndex
|
|
5
|
+
* @property {object} runs - The package's languages, faces and maps.
|
|
6
|
+
* @property {object|undefined} icons - The package's icon registry.
|
|
7
|
+
* @property {(src: string) => ({role?: string, width?: number|"", height?: number|""}|undefined)} lookupAsset -
|
|
8
|
+
* From a picture's address to its asset.
|
|
9
|
+
* @property {(src: string) => string} resolveSrc - From a picture's authored
|
|
10
|
+
* pathname to the address the website serves it at.
|
|
11
|
+
* @property {(markdown: string, note: {fm: object, file?: string}) => {markdown: string, figures: object[]}} expand -
|
|
12
|
+
* Expand a buffer's body as the website expands a page: links, embeds,
|
|
13
|
+
* expressions and figure numbers resolved. A query, which a buffer cannot
|
|
14
|
+
* answer, is left as written.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Build the object a preview with an index renders from.
|
|
18
|
+
*
|
|
19
|
+
* @param {object} options
|
|
20
|
+
* @param {object} options.config - The resolved package configuration.
|
|
21
|
+
* @param {object[]} options.records - The content index's records: every note
|
|
22
|
+
* and every asset.
|
|
23
|
+
* @param {object} [options.foreign] - The dependencies' indexes, as
|
|
24
|
+
* {@link module:engine/metadata-index.loadForeignIndexes} returns them.
|
|
25
|
+
* Omitted, the package links only to itself.
|
|
26
|
+
* @returns {PreviewIndex} The index.
|
|
27
|
+
*/
|
|
28
|
+
export function previewIndex({ config, records, foreign }: {
|
|
29
|
+
config: object;
|
|
30
|
+
records: object[];
|
|
31
|
+
foreign?: object | undefined;
|
|
32
|
+
}): PreviewIndex;
|
|
33
|
+
/**
|
|
34
|
+
* What a preview reads to render with an index.
|
|
35
|
+
*/
|
|
36
|
+
export type PreviewIndex = {
|
|
37
|
+
/**
|
|
38
|
+
* - The package's languages, faces and maps.
|
|
39
|
+
*/
|
|
40
|
+
runs: object;
|
|
41
|
+
/**
|
|
42
|
+
* - The package's icon registry.
|
|
43
|
+
*/
|
|
44
|
+
icons: object | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* -
|
|
47
|
+
* From a picture's address to its asset.
|
|
48
|
+
*/
|
|
49
|
+
lookupAsset: (src: string) => ({
|
|
50
|
+
role?: string;
|
|
51
|
+
width?: number | "";
|
|
52
|
+
height?: number | "";
|
|
53
|
+
} | undefined);
|
|
54
|
+
/**
|
|
55
|
+
* - From a picture's authored
|
|
56
|
+
* pathname to the address the website serves it at.
|
|
57
|
+
*/
|
|
58
|
+
resolveSrc: (src: string) => string;
|
|
59
|
+
/**
|
|
60
|
+
* -
|
|
61
|
+
* Expand a buffer's body as the website expands a page: links, embeds,
|
|
62
|
+
* expressions and figure numbers resolved. A query, which a buffer cannot
|
|
63
|
+
* answer, is left as written.
|
|
64
|
+
*/
|
|
65
|
+
expand: (markdown: string, note: {
|
|
66
|
+
fm: object;
|
|
67
|
+
file?: string;
|
|
68
|
+
}) => {
|
|
69
|
+
markdown: string;
|
|
70
|
+
figures: object[];
|
|
71
|
+
};
|
|
72
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Highlight a wikilink or an embed without interpreting any Markdown or HTML
|
|
3
|
+
* inside the source.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} raw - The link as written, from `[[` or `![[` to its end.
|
|
6
|
+
* @returns {string} The highlighted source.
|
|
7
|
+
*/
|
|
8
|
+
export function wikiSource(raw: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Install the preview target's rules.
|
|
11
|
+
*
|
|
12
|
+
* @param {import("markdown-it")} md - The shared parser.
|
|
13
|
+
* @param {object} [options]
|
|
14
|
+
* @param {boolean} [options.source] - The buffer has no index: show wikilinks,
|
|
15
|
+
* embeds, spans and local expressions as authored source.
|
|
16
|
+
* @param {object} [options.fm] - The buffer's frontmatter, which a local
|
|
17
|
+
* expression reads.
|
|
18
|
+
* @param {string} [options.file] - The buffer's name, for a finding.
|
|
19
|
+
* @param {Map<string, object>} [options.figures] - The buffer's captioned items
|
|
20
|
+
* by id, which a local `ref` reads.
|
|
21
|
+
*/
|
|
22
|
+
export function previewSourcePlugin(md: typeof import("markdown-it"), { source, fm, file, figures }?: {
|
|
23
|
+
source?: boolean | undefined;
|
|
24
|
+
fm?: object | undefined;
|
|
25
|
+
file?: string | undefined;
|
|
26
|
+
figures?: Map<string, object> | undefined;
|
|
27
|
+
}): void;
|
|
28
|
+
/** Explicit dependency policy: a new registered helper requires a preview decision. */
|
|
29
|
+
export const PREVIEW_HELPERS: Readonly<{
|
|
30
|
+
eq: "local";
|
|
31
|
+
gt: "local";
|
|
32
|
+
gte: "local";
|
|
33
|
+
lt: "local";
|
|
34
|
+
lte: "local";
|
|
35
|
+
not: "local";
|
|
36
|
+
and: "local";
|
|
37
|
+
or: "local";
|
|
38
|
+
words: "local";
|
|
39
|
+
digits: "local";
|
|
40
|
+
sql: "dependent";
|
|
41
|
+
dateformat: "dependent";
|
|
42
|
+
ref: "reference";
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* What stands for an authored `<` in the preview between
|
|
46
|
+
* {@link module:engine/content-render.inertHtml} and the rendered HTML, where
|
|
47
|
+
* it is written `<`. A private-use character, so it can neither be read as
|
|
48
|
+
* markup nor collide with prose.
|
|
49
|
+
*/
|
|
50
|
+
export const INERT_BRACKET: "\uE000";
|
|
51
|
+
export function colored(role: string, source: string): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **The words a script note and a language note state emphasis by.** Read by
|
|
3
|
+
* the vocabulary as it is declared, so this module imports nothing; the
|
|
4
|
+
* checks and the conventions' use are in {@link module:engine/script-emphasis}.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
/** The conventions a script states its emphasis by. */
|
|
9
|
+
export const EMPHASIS_CONVENTIONS: readonly string[];
|
|
10
|
+
/** The class each convention gives an `<em>` or a `<strong>`. */
|
|
11
|
+
export const EMPHASIS_CLASSES: Readonly<{
|
|
12
|
+
rubric: "emph-rubric";
|
|
13
|
+
overline: "emph-overline";
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* The conventions a language note states, which override its script's.
|
|
17
|
+
* `words` marks emphasis with a word, so a mark in its text is a finding.
|
|
18
|
+
*/
|
|
19
|
+
export const LANGUAGE_EMPHASES: readonly string[];
|
|
20
|
+
/** The `subType` of a script note. */
|
|
21
|
+
export const SCRIPT_SUBTYPE: "script";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Each face's conventions, from the script notes among the index records. The
|
|
3
|
+
* first note to list a face keeps it; a second is the lint's to report, and a
|
|
4
|
+
* note whose convention is unknown gives none.
|
|
5
|
+
*
|
|
6
|
+
* @param {Iterable<Record<string, any>>|undefined} records - Index records.
|
|
7
|
+
* @returns {Map<string, Emphasis>} The conventions, by face slug.
|
|
8
|
+
*/
|
|
9
|
+
export function emphasesFromRecords(records: Iterable<Record<string, any>> | undefined): Map<string, Emphasis>;
|
|
10
|
+
/**
|
|
11
|
+
* The convention each language's note states.
|
|
12
|
+
*
|
|
13
|
+
* @param {ReadonlyMap<string, Record<string, any>>} byName - Each configured
|
|
14
|
+
* language's note record, by language name, from
|
|
15
|
+
* {@link module:engine/map-lexicon.languageRecordsByName}.
|
|
16
|
+
* @returns {Map<string, LanguageEmphasis>} The conventions, by language name;
|
|
17
|
+
* a language whose note states none, or one the build does not know, is
|
|
18
|
+
* absent.
|
|
19
|
+
*/
|
|
20
|
+
export function languageEmphasesOf(byName: ReadonlyMap<string, Record<string, any>>): Map<string, LanguageEmphasis>;
|
|
21
|
+
/**
|
|
22
|
+
* Refuse `data.emphasis` on a skill that is not a language, at its key.
|
|
23
|
+
*
|
|
24
|
+
* @param {{file: string, raw?: string, fm?: Record<string, any>}} note - The note.
|
|
25
|
+
* @returns {object[]} The findings.
|
|
26
|
+
*/
|
|
27
|
+
export function checkLanguageEmphasis(note: {
|
|
28
|
+
file: string;
|
|
29
|
+
raw?: string;
|
|
30
|
+
fm?: Record<string, any>;
|
|
31
|
+
}): object[];
|
|
32
|
+
/**
|
|
33
|
+
* Check a note's `data.script`: that the note is a script, and that its
|
|
34
|
+
* `fonts` is not empty, names no generic family, lists no face twice, and
|
|
35
|
+
* lists no face another script note lists. The data-key check owns every key,
|
|
36
|
+
* its kind and the conventions; whether a face is installed is
|
|
37
|
+
* {@link checkScriptNoteFonts}'s.
|
|
38
|
+
*
|
|
39
|
+
* @param {{file: string, raw?: string, fm?: Record<string, any>}} note - The note.
|
|
40
|
+
* @param {{index?: {notes?: Iterable<object>}}} [context] - The lint index.
|
|
41
|
+
* @returns {object[]} The findings, each at its key or entry.
|
|
42
|
+
*/
|
|
43
|
+
export function checkScriptField(note: {
|
|
44
|
+
file: string;
|
|
45
|
+
raw?: string;
|
|
46
|
+
fm?: Record<string, any>;
|
|
47
|
+
}, { index }?: {
|
|
48
|
+
index?: {
|
|
49
|
+
notes?: Iterable<object>;
|
|
50
|
+
};
|
|
51
|
+
}): object[];
|
|
52
|
+
/**
|
|
53
|
+
* Each face a script note lists that is not installed, at its entry.
|
|
54
|
+
*
|
|
55
|
+
* @param {{file: string, raw?: string, fm?: Record<string, any>}} note - The note.
|
|
56
|
+
* @param {{faces?: ReadonlyMap<string, unknown>}} [ctx] - The installed faces,
|
|
57
|
+
* from {@link module:engine/content-scripts.runContext}.
|
|
58
|
+
* @returns {object[]} The findings.
|
|
59
|
+
*/
|
|
60
|
+
export function checkScriptNoteFonts(note: {
|
|
61
|
+
file: string;
|
|
62
|
+
raw?: string;
|
|
63
|
+
fm?: Record<string, any>;
|
|
64
|
+
}, ctx?: {
|
|
65
|
+
faces?: ReadonlyMap<string, unknown>;
|
|
66
|
+
}): object[];
|
|
67
|
+
/**
|
|
68
|
+
* One face's conventions, one for each level of emphasis.
|
|
69
|
+
*/
|
|
70
|
+
export type Emphasis = {
|
|
71
|
+
/**
|
|
72
|
+
* - What `*…*` is set by.
|
|
73
|
+
*/
|
|
74
|
+
em: "rubric" | "overline";
|
|
75
|
+
/**
|
|
76
|
+
* - What `**…**` is set by.
|
|
77
|
+
*/
|
|
78
|
+
strong: "rubric" | "overline";
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* A convention a language note states.
|
|
82
|
+
*/
|
|
83
|
+
export type LanguageEmphasis = "words" | "rubric" | "overline";
|
|
84
|
+
export { EMPHASIS_CLASSES, EMPHASIS_CONVENTIONS, LANGUAGE_EMPHASES } from "./script-emphasis-terms.mjs";
|
|
@@ -69,10 +69,10 @@ export function checkScriptFonts(config: DeliveryConfig): {
|
|
|
69
69
|
*/
|
|
70
70
|
export function siteFontsParam(config: DeliveryConfig): string | undefined;
|
|
71
71
|
/**
|
|
72
|
-
* The directory under the
|
|
72
|
+
* The directory under the site's static tree that holds this version's fonts.
|
|
73
73
|
*
|
|
74
74
|
* @param {string} version - The fonts package's version.
|
|
75
|
-
* @returns {string} The POSIX path, relative to
|
|
75
|
+
* @returns {string} The POSIX path, relative to the static tree.
|
|
76
76
|
*/
|
|
77
77
|
export function siteFontsDestination(version: string): string;
|
|
78
78
|
/**
|
|
@@ -104,8 +104,8 @@ export function typstScriptFontPath(config: DeliveryConfig): string | undefined;
|
|
|
104
104
|
*/
|
|
105
105
|
export const STAGED_FONTS_DIR: string;
|
|
106
106
|
/**
|
|
107
|
-
* Where the files land in the
|
|
108
|
-
*
|
|
107
|
+
* Where the files land in the site's static tree, beneath a directory per
|
|
108
|
+
* version.
|
|
109
109
|
*
|
|
110
110
|
* @type {string}
|
|
111
111
|
*/
|