explico 0.12.0 → 0.13.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 +1122 -1
- package/README.md +91 -13
- package/dist/compiler/astro.d.ts +4 -3
- package/dist/compiler/astro.js +45 -15
- package/dist/compiler/cli.d.ts +26 -12
- package/dist/compiler/cli.js +96 -25
- package/dist/compiler/collections.d.ts +9 -1
- package/dist/compiler/collections.js +55 -16
- package/dist/compiler/content-schema.d.ts +31 -0
- package/dist/compiler/content-schema.js +82 -0
- package/dist/compiler/content-schemas.d.ts +422 -0
- package/dist/compiler/content-schemas.js +229 -0
- package/dist/compiler/course-config.d.ts +1 -1
- package/dist/compiler/course-config.js +30 -2
- package/dist/compiler/exports/combined-html.d.ts +97 -0
- package/dist/compiler/exports/combined-html.js +492 -0
- package/dist/compiler/exports/download-index.d.ts +9 -0
- package/dist/compiler/exports/download-index.js +33 -0
- package/dist/compiler/exports/export-chapters.d.ts +98 -0
- package/dist/compiler/exports/export-chapters.js +164 -0
- package/dist/compiler/exports/export-pages.d.ts +48 -0
- package/dist/compiler/exports/export-pages.js +22 -0
- package/dist/compiler/exports/html-tree.d.ts +22 -0
- package/dist/compiler/exports/html-tree.js +47 -0
- package/dist/compiler/exports/latex/capture.d.ts +106 -0
- package/dist/compiler/exports/latex/capture.js +435 -0
- package/dist/compiler/exports/latex/compile.d.ts +73 -0
- package/dist/compiler/exports/latex/compile.js +115 -0
- package/dist/compiler/exports/latex/document.d.ts +102 -0
- package/dist/compiler/exports/latex/document.js +349 -0
- package/dist/compiler/exports/latex/explico.cls +415 -0
- package/dist/compiler/exports/latex/numbering.d.ts +18 -0
- package/dist/compiler/exports/latex/numbering.js +57 -0
- package/dist/compiler/exports/latex/serialize.d.ts +112 -0
- package/dist/compiler/exports/latex/serialize.js +606 -0
- package/dist/compiler/exports/latex-export.d.ts +44 -0
- package/dist/compiler/exports/latex-export.js +169 -0
- package/dist/compiler/exports/markdown/serialize.d.ts +51 -0
- package/dist/compiler/exports/markdown/serialize.js +527 -0
- package/dist/compiler/exports/markdown-export.d.ts +39 -0
- package/dist/compiler/exports/markdown-export.js +240 -0
- package/dist/compiler/exports/standalone-html.d.ts +14 -5
- package/dist/compiler/exports/standalone-html.js +23 -51
- package/dist/compiler/exports/static-tree.d.ts +253 -0
- package/dist/compiler/exports/static-tree.js +625 -0
- package/dist/compiler/exports/zip.d.ts +16 -0
- package/dist/compiler/exports/zip.js +72 -0
- package/dist/compiler/lesson-derivation.d.ts +8 -2
- package/dist/compiler/lesson-derivation.js +6 -7
- package/dist/compiler/manifest.d.ts +87 -6
- package/dist/compiler/manifest.js +174 -31
- package/dist/compiler/render-diagnostics.d.ts +65 -0
- package/dist/compiler/render-diagnostics.js +56 -0
- package/dist/compiler/resolution-report.d.ts +2 -1
- package/dist/{course-config-Dsnri9Tk.d.ts → course-config-rRtME5UV.d.ts} +56 -13
- package/dist/curriculum/validation.d.ts +9 -3
- package/dist/curriculum/validation.js +35 -17
- package/dist/reference/base-abbreviations.d.mts +2 -2
- package/dist/reference/base-abbreviations.mjs +2 -2
- package/dist/reference/base-operators.d.mts +2 -2
- package/dist/reference/base-operators.mjs +2 -2
- package/dist/reference/base-roman-labels.d.mts +4 -3
- package/dist/reference/base-roman-labels.mjs +4 -3
- package/dist/reference/citation-format.d.mts +35 -0
- package/dist/reference/citation-format.mjs +74 -0
- package/dist/reference/consistency.d.ts +5 -9
- package/dist/reference/consistency.js +34 -38
- package/dist/reference/curriculum-alignment.js +3 -24
- package/dist/reference/derived-entries.d.ts +45 -0
- package/dist/reference/derived-entries.js +50 -0
- package/dist/reference/derived-notation.d.mts +125 -0
- package/dist/reference/derived-notation.mjs +121 -0
- package/dist/reference/diagram-fit.d.ts +45 -0
- package/dist/reference/diagram-fit.js +54 -0
- package/dist/reference/diagram-layout.d.ts +59 -10
- package/dist/reference/diagram-layout.js +85 -24
- package/dist/reference/diagrams-validate.d.ts +1 -1
- package/dist/reference/equations-validate.d.ts +1 -1
- package/dist/reference/equations-validate.js +26 -1
- package/dist/reference/equations.d.mts +27 -0
- package/dist/reference/equations.mjs +120 -22
- package/dist/reference/examples-validate.d.ts +1 -1
- package/dist/reference/figure-fit.d.ts +70 -0
- package/dist/reference/figure-fit.js +60 -0
- package/dist/reference/figure-pictures.d.ts +27 -0
- package/dist/reference/figure-pictures.js +49 -0
- package/dist/reference/figures-validate.d.ts +1 -1
- package/dist/reference/gate-abbreviations.d.ts +1 -1
- package/dist/reference/gate-abbreviations.js +1 -1
- package/dist/reference/gate-course-rules.d.ts +4 -3
- package/dist/reference/gate-course-rules.js +9 -4
- package/dist/reference/gate-heading-length.d.ts +2 -0
- package/dist/reference/gate-heading-length.js +7 -5
- package/dist/reference/gate-heading-structure.js +26 -0
- package/dist/reference/gate-indices.d.ts +35 -0
- package/dist/reference/gate-indices.js +299 -0
- package/dist/reference/gate-math.d.ts +32 -2
- package/dist/reference/gate-math.js +68 -12
- package/dist/reference/gate-mdx-expression.d.ts +17 -0
- package/dist/reference/gate-mdx-expression.js +29 -0
- package/dist/reference/gate-part-pages.d.ts +1 -1
- package/dist/reference/gate-prop-text.d.ts +28 -0
- package/dist/reference/gate-prop-text.js +106 -0
- package/dist/reference/gate-prose-notation.d.ts +3 -1
- package/dist/reference/gate-prose-notation.js +4 -2
- package/dist/reference/gate-retired-keys.d.ts +35 -0
- package/dist/reference/gate-retired-keys.js +58 -0
- package/dist/reference/gloss.d.ts +2 -0
- package/dist/reference/katex-measure.d.ts +17 -0
- package/dist/reference/katex-measure.js +223 -0
- package/dist/reference/keyed-float-validate.js +12 -0
- package/dist/reference/keyed-jsx-floats.d.mts +2 -2
- package/dist/reference/keyed-jsx-floats.mjs +11 -14
- package/dist/reference/lab-math-scope.d.ts +1 -0
- package/dist/reference/lab-math-scope.js +13 -2
- package/dist/reference/math-glyphs.d.mts +94 -2
- package/dist/reference/math-glyphs.mjs +851 -46
- package/dist/reference/mixed-content.d.ts +8 -3
- package/dist/reference/mixed-content.js +4 -2
- package/dist/reference/page-notation.d.ts +34 -4
- package/dist/reference/page-notation.js +54 -2
- package/dist/reference/references.d.ts +11 -1
- package/dist/reference/references.js +6 -0
- package/dist/reference/registry.js +104 -10
- package/dist/reference/rehype-fail-katex-errors.d.mts +9 -0
- package/dist/reference/rehype-fail-katex-errors.mjs +19 -0
- package/dist/reference/rehype-heading-anchors.mjs +11 -1
- package/dist/reference/remark-citation.mjs +0 -0
- package/dist/reference/remark-notation.mjs +84 -20
- package/dist/reference/render-lab-math.d.ts +2 -0
- package/dist/reference/render-lab-math.js +17 -5
- package/dist/reference/sections-validate.d.ts +28 -3
- package/dist/reference/sections-validate.js +31 -4
- package/dist/reference/sections.d.mts +24 -6
- package/dist/reference/sections.mjs +92 -17
- package/dist/reference/tables-validate.d.ts +1 -1
- package/dist/reference/tables-validate.js +24 -1
- package/dist/reference/text-measure.d.ts +10 -0
- package/dist/reference/text-measure.js +41 -0
- package/dist/reference/text-widths.d.ts +10 -0
- package/dist/reference/text-widths.js +1238 -0
- package/dist/reference/types.d.ts +64 -8
- package/dist/rules/catalog.js +191 -30
- package/dist/rules/in-effect.d.ts +1 -1
- package/dist/rules/rules.schema.json +79 -24
- package/dist/rules/settings.d.ts +1 -1
- package/dist/rules/settings.js +7 -0
- package/dist/session/PreferenceStore.d.ts +18 -1
- package/dist/session/PreferenceStore.js +29 -1
- package/docs/authoring/README.md +32 -21
- package/docs/authoring/agents.md +38 -7
- package/docs/authoring/components.md +111 -6
- package/docs/authoring/migrating.md +663 -0
- package/docs/authoring/notation.md +281 -29
- package/docs/authoring/retired.md +1 -0
- package/docs/authoring/structure-rules.md +10 -41
- package/docs/authoring/structure.md +53 -2
- package/docs/authoring/visualizations.md +144 -18
- package/package.json +12 -7
- package/src/compiler/astro.ts +57 -17
- package/src/compiler/cli.ts +143 -35
- package/src/compiler/collections.ts +92 -19
- package/src/compiler/content-schema.ts +108 -0
- package/src/compiler/content-schemas.ts +391 -0
- package/src/compiler/course-config.ts +86 -15
- package/src/compiler/exports/combined-html.ts +669 -0
- package/src/compiler/exports/download-index.ts +36 -0
- package/src/compiler/exports/export-chapters.ts +233 -0
- package/src/compiler/exports/export-pages.ts +44 -0
- package/src/compiler/exports/html-tree.ts +62 -0
- package/src/compiler/exports/latex/capture.ts +651 -0
- package/src/compiler/exports/latex/compile.ts +168 -0
- package/src/compiler/exports/latex/document.ts +479 -0
- package/src/compiler/exports/latex/explico.cls +415 -0
- package/src/compiler/exports/latex/numbering.ts +74 -0
- package/src/compiler/exports/latex/serialize.ts +787 -0
- package/src/compiler/exports/latex/texlive-packages.txt +76 -0
- package/src/compiler/exports/latex-export.ts +255 -0
- package/src/compiler/exports/markdown/serialize.ts +632 -0
- package/src/compiler/exports/markdown-export.ts +329 -0
- package/src/compiler/exports/standalone-html.ts +39 -70
- package/src/compiler/exports/static-tree.ts +944 -0
- package/src/compiler/exports/zip.ts +88 -0
- package/src/compiler/lesson-derivation.ts +13 -8
- package/src/compiler/manifest.ts +299 -28
- package/src/compiler/render-diagnostics.ts +111 -0
- package/src/components/HoverPanel.astro +204 -6
- package/src/components/PartOverview.astro +12 -9
- package/src/components/abbreviation/AbbreviationLayer.astro +21 -12
- package/src/components/assessments/AssessmentRunner.tsx +7 -1
- package/src/components/assessments/AssessmentSet.astro +14 -1
- package/src/components/block-heading.ts +38 -0
- package/src/components/card-arrow.ts +18 -4
- package/src/components/card-carry.ts +406 -0
- package/src/components/card-drag.ts +1 -30
- package/src/components/card-fetch.ts +87 -0
- package/src/components/card-manager.ts +1222 -38
- package/src/components/card-memory.ts +5 -1
- package/src/components/card-placement.ts +211 -13
- package/src/components/card-side.ts +281 -31
- package/src/components/citation/CitationLayer.astro +45 -40
- package/src/components/diagram/Diagram.astro +123 -44
- package/src/components/figure/Figure.astro +11 -0
- package/src/components/figure/FloatCaption.astro +4 -17
- package/src/components/float-toolbar.ts +274 -0
- package/src/components/memo/Memo.astro +21 -10
- package/src/components/memo/ShortNote.astro +4 -0
- package/src/components/notation/NotationGlossary.astro +22 -17
- package/src/components/notation/NotationLayer.astro +300 -79
- package/src/components/notation/NotationMath.astro +8 -1
- package/src/components/notation/render-notation-math.ts +51 -5
- package/src/components/readable-text.ts +25 -0
- package/src/components/reference/FloatRefLayer.astro +162 -89
- package/src/components/starlight/HeadingAnchorEnhancer.astro +13 -8
- package/src/components/starlight/KeyedFloatEnhancer.astro +28 -9
- package/src/components/starlight/LayoutPageSidebar.astro +17 -3
- package/src/components/starlight/LayoutSocialIcons.astro +79 -29
- package/src/components/starlight/LessonExportActions.astro +384 -310
- package/src/components/starlight/LessonFooter.astro +47 -9
- package/src/components/starlight/PrintController.astro +28 -0
- package/src/components/starlight/TextSizeControl.astro +137 -0
- package/src/components/starlight/print-controller.ts +380 -0
- package/src/components/starlight/section-summary.ts +13 -5
- package/src/components/table/Table.astro +13 -21
- package/src/components/table/table-truncation.ts +15 -0
- package/src/content-config.ts +20 -312
- package/src/curriculum/validation.ts +72 -24
- package/src/reference/base-abbreviations.mjs +2 -2
- package/src/reference/base-operators.mjs +2 -2
- package/src/reference/base-roman-labels.mjs +4 -3
- package/src/reference/citation-format.mjs +74 -0
- package/src/reference/consistency.ts +47 -61
- package/src/reference/curriculum-alignment.ts +4 -41
- package/src/reference/derived-entries.ts +68 -0
- package/src/reference/derived-notation.mjs +121 -0
- package/src/reference/diagram-fit.ts +104 -0
- package/src/reference/diagram-layout.ts +182 -51
- package/src/reference/diagrams-validate.ts +2 -1
- package/src/reference/equations-validate.ts +41 -2
- package/src/reference/equations.mjs +120 -22
- package/src/reference/examples-validate.ts +1 -0
- package/src/reference/figure-fit.ts +139 -0
- package/src/reference/figure-pictures.ts +96 -0
- package/src/reference/figures-validate.ts +2 -1
- package/src/reference/gate-abbreviations.ts +1 -1
- package/src/reference/gate-course-rules.ts +22 -7
- package/src/reference/gate-heading-length.ts +25 -7
- package/src/reference/gate-heading-structure.ts +40 -1
- package/src/reference/gate-indices.ts +470 -0
- package/src/reference/gate-math.ts +102 -13
- package/src/reference/gate-mdx-expression.ts +45 -0
- package/src/reference/gate-prop-text.ts +145 -0
- package/src/reference/gate-prose-notation.ts +19 -5
- package/src/reference/gate-retired-keys.ts +101 -0
- package/src/reference/gloss.ts +2 -0
- package/src/reference/katex-measure.ts +384 -0
- package/src/reference/keyed-float-validate.ts +22 -0
- package/src/reference/keyed-jsx-floats.mjs +11 -14
- package/src/reference/lab-math-scope.ts +15 -1
- package/src/reference/math-glyphs.mjs +851 -46
- package/src/reference/mixed-content.ts +11 -2
- package/src/reference/page-notation.ts +100 -3
- package/src/reference/references.ts +14 -0
- package/src/reference/registry.ts +154 -8
- package/src/reference/rehype-fail-katex-errors.mjs +19 -0
- package/src/reference/rehype-heading-anchors.mjs +11 -1
- package/src/reference/remark-citation.mjs +0 -0
- package/src/reference/remark-notation.mjs +84 -20
- package/src/reference/render-lab-math.ts +29 -5
- package/src/reference/sections-validate.ts +67 -3
- package/src/reference/sections.mjs +92 -17
- package/src/reference/tables-validate.ts +40 -2
- package/src/reference/text-measure.ts +63 -0
- package/src/reference/text-widths.ts +133 -0
- package/src/reference/types.ts +75 -8
- package/src/rules/catalog.ts +205 -29
- package/src/rules/settings.ts +10 -0
- package/src/session/PreferenceStore.ts +53 -0
- package/src/styles/global.css +291 -75
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Buffer } from 'node:buffer';
|
|
2
|
+
import { crc32, deflateRawSync } from 'node:zlib';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A minimal, deterministic ZIP writer for export downloads: entries sorted by
|
|
6
|
+
* path, one fixed timestamp (1980-01-01, the format's epoch), UTF-8 names,
|
|
7
|
+
* deflate where it helps. The same files always give the same bytes, so a
|
|
8
|
+
* rebuild does not churn the published download.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export interface ZipEntry {
|
|
12
|
+
/** Path inside the archive, `/`-separated, no leading slash. */
|
|
13
|
+
readonly path: string;
|
|
14
|
+
readonly content: string | Uint8Array;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const DOS_DATE_1980_01_01 = 0x0021;
|
|
18
|
+
const UTF8_NAMES = 0x0800;
|
|
19
|
+
const REGULAR_FILE_644 = 0o100644 << 16;
|
|
20
|
+
|
|
21
|
+
export function zip(entries: readonly ZipEntry[]): Buffer {
|
|
22
|
+
const sorted = [...entries].sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
|
|
23
|
+
const seen = new Set<string>();
|
|
24
|
+
const locals: Buffer[] = [];
|
|
25
|
+
const centrals: Buffer[] = [];
|
|
26
|
+
let offset = 0;
|
|
27
|
+
for (const entry of sorted) {
|
|
28
|
+
if (!entry.path || entry.path.startsWith('/') || entry.path.split('/').includes('..')) {
|
|
29
|
+
throw new Error(`Zip entry path ${JSON.stringify(entry.path)} is not a relative path.`);
|
|
30
|
+
}
|
|
31
|
+
if (seen.has(entry.path)) throw new Error(`Zip entry ${entry.path} appears twice.`);
|
|
32
|
+
seen.add(entry.path);
|
|
33
|
+
const name = Buffer.from(entry.path, 'utf8');
|
|
34
|
+
const data =
|
|
35
|
+
typeof entry.content === 'string' ? Buffer.from(entry.content, 'utf8') : Buffer.from(entry.content);
|
|
36
|
+
const deflated = deflateRawSync(data, { level: 9 });
|
|
37
|
+
const stored = deflated.length >= data.length;
|
|
38
|
+
const body = stored ? data : deflated;
|
|
39
|
+
const checksum = crc32(data) >>> 0;
|
|
40
|
+
|
|
41
|
+
const local = Buffer.alloc(30);
|
|
42
|
+
local.writeUInt32LE(0x04034b50, 0);
|
|
43
|
+
local.writeUInt16LE(20, 4);
|
|
44
|
+
local.writeUInt16LE(UTF8_NAMES, 6);
|
|
45
|
+
local.writeUInt16LE(stored ? 0 : 8, 8);
|
|
46
|
+
local.writeUInt16LE(0, 10);
|
|
47
|
+
local.writeUInt16LE(DOS_DATE_1980_01_01, 12);
|
|
48
|
+
local.writeUInt32LE(checksum, 14);
|
|
49
|
+
local.writeUInt32LE(body.length, 18);
|
|
50
|
+
local.writeUInt32LE(data.length, 22);
|
|
51
|
+
local.writeUInt16LE(name.length, 26);
|
|
52
|
+
local.writeUInt16LE(0, 28);
|
|
53
|
+
locals.push(local, name, body);
|
|
54
|
+
|
|
55
|
+
const central = Buffer.alloc(46);
|
|
56
|
+
central.writeUInt32LE(0x02014b50, 0);
|
|
57
|
+
central.writeUInt16LE((3 << 8) | 20, 4); // made by UNIX, ZIP 2.0
|
|
58
|
+
central.writeUInt16LE(20, 6);
|
|
59
|
+
central.writeUInt16LE(UTF8_NAMES, 8);
|
|
60
|
+
central.writeUInt16LE(stored ? 0 : 8, 10);
|
|
61
|
+
central.writeUInt16LE(0, 12);
|
|
62
|
+
central.writeUInt16LE(DOS_DATE_1980_01_01, 14);
|
|
63
|
+
central.writeUInt32LE(checksum, 16);
|
|
64
|
+
central.writeUInt32LE(body.length, 20);
|
|
65
|
+
central.writeUInt32LE(data.length, 24);
|
|
66
|
+
central.writeUInt16LE(name.length, 28);
|
|
67
|
+
central.writeUInt16LE(0, 30);
|
|
68
|
+
central.writeUInt16LE(0, 32);
|
|
69
|
+
central.writeUInt16LE(0, 34);
|
|
70
|
+
central.writeUInt16LE(0, 36);
|
|
71
|
+
central.writeUInt32LE(REGULAR_FILE_644 >>> 0, 38);
|
|
72
|
+
central.writeUInt32LE(offset, 42);
|
|
73
|
+
centrals.push(central, name);
|
|
74
|
+
|
|
75
|
+
offset += local.length + name.length + body.length;
|
|
76
|
+
}
|
|
77
|
+
const directory = Buffer.concat(centrals);
|
|
78
|
+
const end = Buffer.alloc(22);
|
|
79
|
+
end.writeUInt32LE(0x06054b50, 0);
|
|
80
|
+
end.writeUInt16LE(0, 4);
|
|
81
|
+
end.writeUInt16LE(0, 6);
|
|
82
|
+
end.writeUInt16LE(sorted.length, 8);
|
|
83
|
+
end.writeUInt16LE(sorted.length, 10);
|
|
84
|
+
end.writeUInt32LE(directory.length, 12);
|
|
85
|
+
end.writeUInt32LE(offset, 16);
|
|
86
|
+
end.writeUInt16LE(0, 20);
|
|
87
|
+
return Buffer.concat([...locals, directory, end]);
|
|
88
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* layout, the tests) goes through that one loader.
|
|
6
6
|
*
|
|
7
7
|
* Authored per lesson after C2: `title`, `description`, `teaches`, `assumptions`,
|
|
8
|
-
* `
|
|
8
|
+
* `notation.local`. Everything below is derived:
|
|
9
9
|
*
|
|
10
10
|
* - `lessonId` — the doc slug, `/` → `.` (`foundations/discount-factors`).
|
|
11
11
|
* - `requires` — direct competency-graph prerequisites of `teaches`, minus
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
* is redundant.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
+
import { citedIds, withoutLinkCitations } from '../reference/citation-format.mjs';
|
|
28
|
+
|
|
27
29
|
/** `foundations/discount-factors` → `foundations.discount-factors`. */
|
|
28
30
|
export function lessonIdFromSlug(slug: string): string {
|
|
29
31
|
return slug.replace(/\.(md|mdx)$/, '').replace(/\//g, '.');
|
|
@@ -39,6 +41,15 @@ export function isLessonSlug(slug: string): boolean {
|
|
|
39
41
|
return clean.includes('/') && !clean.endsWith('/index');
|
|
40
42
|
}
|
|
41
43
|
|
|
44
|
+
/**
|
|
45
|
+
* The docs slugs a Starlight route id can stand for. The glob loader shortens
|
|
46
|
+
* `<dir>/index.mdx` to the id `<dir>`, and may give the landing page an empty
|
|
47
|
+
* one, so a manifest entry matches its route either way.
|
|
48
|
+
*/
|
|
49
|
+
export function docsSlugsForRoute(routeSlug: string): readonly string[] {
|
|
50
|
+
return routeSlug === '' ? ['index'] : [routeSlug, `${routeSlug}/index`];
|
|
51
|
+
}
|
|
52
|
+
|
|
42
53
|
/**
|
|
43
54
|
* Direct prerequisites of everything the lesson `teaches`, minus the taught
|
|
44
55
|
* competencies themselves, sorted. Editorial "you should also know" extras that
|
|
@@ -68,13 +79,7 @@ export function citedSourceIds(body: string): Set<string> {
|
|
|
68
79
|
const withoutCode = body
|
|
69
80
|
.replace(/```[\s\S]*?```/g, '')
|
|
70
81
|
.replace(/`[^`\n]*`/g, '');
|
|
71
|
-
|
|
72
|
-
for (const match of withoutCode.matchAll(
|
|
73
|
-
/\[@([a-z0-9][a-z0-9.-]*)(?:;[^\]]*)?\]/g,
|
|
74
|
-
)) {
|
|
75
|
-
ids.add((match[1] ?? '').trim());
|
|
76
|
-
}
|
|
77
|
-
return ids;
|
|
82
|
+
return citedIds(withoutLinkCitations(withoutCode)) as Set<string>;
|
|
78
83
|
}
|
|
79
84
|
|
|
80
85
|
/** Cited source ids as a sorted array — the derived frontmatter `sources`. */
|