explico 0.13.0 → 0.14.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 +894 -1
- package/README.md +200 -30
- package/dist/compiler/astro.d.ts +15 -2
- package/dist/compiler/astro.js +40 -11
- package/dist/compiler/cli-main.d.ts +43 -0
- package/dist/compiler/cli-main.js +392 -0
- package/dist/compiler/cli.d.ts +424 -9
- package/dist/compiler/cli.js +1289 -8
- package/dist/compiler/collections.d.ts +88 -1
- package/dist/compiler/collections.js +170 -25
- package/dist/compiler/course-config.d.ts +1 -1
- package/dist/compiler/course-config.js +105 -1
- package/dist/compiler/decks.d.ts +161 -0
- package/dist/compiler/decks.js +235 -0
- package/dist/compiler/exports/combined-html.d.ts +5 -1
- package/dist/compiler/exports/deck-fit.d.ts +55 -0
- package/dist/compiler/exports/deck-fit.js +90 -0
- package/dist/compiler/exports/export-chapters.d.ts +37 -6
- package/dist/compiler/exports/export-chapters.js +64 -5
- package/dist/compiler/exports/export-pages.d.ts +30 -3
- package/dist/compiler/exports/export-pages.js +24 -1
- package/dist/compiler/exports/latex/beamerthemeexplico.sty +124 -0
- package/dist/compiler/exports/latex/cache.d.ts +78 -0
- package/dist/compiler/exports/latex/cache.js +129 -0
- package/dist/compiler/exports/latex/capture.d.ts +10 -1
- package/dist/compiler/exports/latex/capture.js +3 -1
- package/dist/compiler/exports/latex/compile.d.ts +13 -2
- package/dist/compiler/exports/latex/compile.js +12 -1
- package/dist/compiler/exports/latex/deck.d.ts +92 -0
- package/dist/compiler/exports/latex/deck.js +349 -0
- package/dist/compiler/exports/latex/document.d.ts +51 -6
- package/dist/compiler/exports/latex/document.js +71 -12
- package/dist/compiler/exports/latex/explico-common.sty +198 -0
- package/dist/compiler/exports/latex/explico.cls +13 -183
- package/dist/compiler/exports/latex/serialize.d.ts +60 -4
- package/dist/compiler/exports/latex/serialize.js +4 -2
- package/dist/compiler/exports/latex-export.d.ts +24 -2
- package/dist/compiler/exports/latex-export.js +107 -26
- package/dist/compiler/exports/markdown/serialize.d.ts +24 -4
- package/dist/compiler/exports/markdown/serialize.js +85 -8
- package/dist/compiler/exports/markdown-export.d.ts +6 -1
- package/dist/compiler/exports/markdown-export.js +50 -11
- package/dist/compiler/exports/standalone-html.d.ts +10 -5
- package/dist/compiler/exports/standalone-html.js +3 -3
- package/dist/compiler/exports/static-tree.d.ts +38 -1
- package/dist/compiler/exports/static-tree.js +120 -4
- package/dist/compiler/knowledge-version.d.ts +26 -2
- package/dist/compiler/knowledge-version.js +27 -17
- package/dist/compiler/lesson-derivation.d.ts +143 -6
- package/dist/compiler/lesson-derivation.js +145 -13
- package/dist/compiler/manifest.d.ts +133 -4
- package/dist/compiler/manifest.js +359 -58
- package/dist/compiler/page-versions.d.ts +160 -0
- package/dist/compiler/page-versions.js +198 -0
- package/dist/compiler/render-diagnostics.d.ts +5 -1
- package/dist/compiler/resolution-report.d.ts +24 -6
- package/dist/compiler/resolution-report.js +22 -4
- package/dist/compiler/validate-content.d.ts +7 -0
- package/dist/compiler/validate-content.js +160 -0
- package/dist/{course-config-rRtME5UV.d.ts → course-config-BLtIdkei.d.ts} +164 -1
- package/dist/curriculum/competency-graph.d.ts +54 -0
- package/dist/curriculum/competency-graph.js +41 -0
- package/dist/reference/base-library.d.mts +8 -0
- package/dist/reference/base-library.mjs +19 -0
- package/dist/reference/consistency.d.ts +8 -4
- package/dist/reference/consistency.js +76 -26
- package/dist/reference/deck-remark.d.mts +123 -0
- package/dist/reference/deck-remark.mjs +600 -0
- package/dist/reference/deck-source.d.ts +107 -0
- package/dist/reference/deck-source.js +140 -0
- package/dist/reference/decks-validate.d.ts +133 -0
- package/dist/reference/decks-validate.js +359 -0
- package/dist/reference/derived-entries.d.ts +5 -1
- package/dist/reference/diagram-fit.d.ts +1 -1
- package/dist/reference/figure-symbols.d.ts +23 -6
- package/dist/reference/figure-symbols.js +51 -15
- package/dist/reference/float-name.d.ts +43 -0
- package/dist/reference/float-name.js +58 -0
- package/dist/reference/folds-validate.d.ts +1 -1
- package/dist/reference/gate-abbreviations.d.ts +1 -1
- package/dist/reference/gate-indices.js +5 -4
- package/dist/reference/gate-math.d.ts +29 -2
- package/dist/reference/gate-math.js +99 -18
- package/dist/reference/gate-part-pages.d.ts +1 -1
- package/dist/reference/lab-katex-validate.d.ts +10 -6
- package/dist/reference/lab-katex-validate.js +17 -9
- package/dist/reference/lab-math-scope.js +29 -4
- package/dist/reference/math-glyphs.d.mts +25 -0
- package/dist/reference/math-glyphs.mjs +189 -25
- package/dist/reference/page-notation.d.ts +22 -3
- package/dist/reference/page-notation.js +32 -10
- package/dist/reference/references.d.ts +14 -1
- package/dist/reference/references.js +13 -0
- package/dist/reference/registry-scope.d.mts +33 -0
- package/dist/reference/registry-scope.mjs +34 -0
- package/dist/reference/registry.js +29 -10
- package/dist/reference/rehype-deck.d.mts +6 -0
- package/dist/reference/rehype-deck.mjs +286 -0
- package/dist/reference/rehype-heading-anchors.d.mts +20 -0
- package/dist/reference/rehype-heading-anchors.mjs +48 -6
- package/dist/reference/remark-notation.mjs +249 -40
- package/dist/reference/source-lines.d.mts +12 -0
- package/dist/reference/source-lines.mjs +65 -0
- package/dist/reference/types.d.ts +28 -0
- package/dist/rules/catalog.d.ts +21 -4
- package/dist/rules/catalog.js +221 -2
- package/dist/rules/course-rules.d.ts +5 -1
- package/dist/rules/course-rules.js +17 -3
- package/dist/rules/course-rules.schema.json +12 -0
- package/dist/rules/in-effect.d.ts +13 -3
- package/dist/rules/in-effect.js +30 -7
- package/dist/rules/rules.schema.json +259 -1
- package/dist/rules/settings.d.ts +1 -1
- package/dist/session/PreferenceStore.d.ts +6 -0
- package/dist/session/PreferenceStore.js +18 -1
- package/dist/session/deck-memory.d.ts +116 -0
- package/dist/session/deck-memory.js +143 -0
- package/dist/session/reading-memory.d.ts +96 -0
- package/dist/session/reading-memory.js +133 -0
- package/docs/VERSIONING.md +21 -18
- package/docs/authoring/README.md +29 -9
- package/docs/authoring/agents.md +63 -16
- package/docs/authoring/components.md +15 -0
- package/docs/authoring/deck.md +588 -0
- package/docs/authoring/migrating.md +1087 -14
- package/docs/authoring/notation.md +49 -6
- package/docs/authoring/structure.md +80 -1
- package/docs/authoring/versioning.md +54 -2
- package/docs/authoring/visualizations.md +7 -2
- package/docs/course-agent/AGENTS.md +37 -0
- package/docs/course-agent/agents/rules-reviewer.md +33 -0
- package/docs/course-agent/skills/draft-lesson/SKILL.md +37 -0
- package/docs/course-agent/skills/migrate-course/SKILL.md +31 -0
- package/docs/course-agent/skills/release-content/SKILL.md +24 -0
- package/docs/diagram-scaling.md +148 -0
- package/docs/privacy.md +59 -0
- package/package.json +8 -2
- package/src/compiler/astro.ts +60 -21
- package/src/compiler/cli-main.ts +469 -0
- package/src/compiler/cli.ts +1905 -16
- package/src/compiler/collections.ts +284 -25
- package/src/compiler/course-config.ts +267 -0
- package/src/compiler/decks.ts +455 -0
- package/src/compiler/exports/deck-fit.ts +127 -0
- package/src/compiler/exports/export-chapters.ts +105 -6
- package/src/compiler/exports/export-pages.ts +46 -2
- package/src/compiler/exports/latex/beamerthemeexplico.sty +124 -0
- package/src/compiler/exports/latex/cache.ts +183 -0
- package/src/compiler/exports/latex/capture.ts +5 -2
- package/src/compiler/exports/latex/compile.ts +18 -0
- package/src/compiler/exports/latex/deck.ts +419 -0
- package/src/compiler/exports/latex/document.ts +117 -21
- package/src/compiler/exports/latex/explico-common.sty +198 -0
- package/src/compiler/exports/latex/explico.cls +13 -183
- package/src/compiler/exports/latex/serialize.ts +25 -21
- package/src/compiler/exports/latex/texlive-packages.txt +6 -2
- package/src/compiler/exports/latex-export.ts +187 -45
- package/src/compiler/exports/markdown/serialize.ts +118 -9
- package/src/compiler/exports/markdown-export.ts +56 -11
- package/src/compiler/exports/standalone-html.ts +8 -7
- package/src/compiler/exports/static-tree.ts +175 -3
- package/src/compiler/knowledge-version.ts +56 -21
- package/src/compiler/lesson-derivation.ts +282 -16
- package/src/compiler/manifest.ts +558 -63
- package/src/compiler/page-versions.ts +359 -0
- package/src/compiler/resolution-report.ts +38 -7
- package/src/compiler/validate-content.ts +212 -0
- package/src/components/CourseContents.astro +124 -6
- package/src/components/CurriculumMap.astro +49 -1
- package/src/components/FloatIndex.astro +1 -1
- package/src/components/PartOverview.astro +51 -5
- package/src/components/assessments/AssessmentSet.astro +41 -15
- package/src/components/block-heading.ts +15 -6
- package/src/components/card-carry.ts +7 -4
- package/src/components/card-manager.ts +14 -2
- package/src/components/card-memory.ts +13 -9
- package/src/components/deck/DeckEnhancer.astro +13 -0
- package/src/components/deck/deck-context.ts +104 -0
- package/src/components/deck/deck-controller.ts +1287 -0
- package/src/components/deck/deck-map.ts +91 -0
- package/src/components/deck-lane.ts +163 -0
- package/src/components/diagram/Diagram.astro +131 -86
- package/src/components/disclosure/persisted-disclosure.ts +9 -1
- package/src/components/figure/Figure.astro +7 -2
- package/src/components/figure/FloatCaption.astro +5 -3
- package/src/components/fold/Fold.astro +2 -2
- package/src/components/notation/NotationFormula.astro +81 -11
- package/src/components/notation/NotationGlossary.astro +132 -1
- package/src/components/notation/NotationLayer.astro +29 -0
- package/src/components/starlight/AboutPanel.astro +186 -3
- package/src/components/starlight/CollapsibleSections.astro +24 -3
- package/src/components/starlight/DiagramEnhancer.astro +5 -1
- package/src/components/starlight/HeadingAnchorEnhancer.astro +1 -1
- package/src/components/starlight/LayoutHeader.astro +17 -0
- package/src/components/starlight/LayoutPageTitle.astro +110 -0
- package/src/components/starlight/LayoutSidebar.astro +807 -21
- package/src/components/starlight/LayoutSocialIcons.astro +62 -6
- package/src/components/starlight/LessonExportActions.astro +27 -9
- package/src/components/starlight/LessonFooter.astro +59 -0
- package/src/components/starlight/ReadingMemoryNotice.astro +114 -0
- package/src/components/starlight/TextSizeControl.astro +24 -13
- package/src/components/starlight/page-marks.ts +139 -0
- package/src/components/starlight/section-summary.ts +1 -1
- package/src/components/starlight/sidebar-editions.ts +245 -0
- package/src/components/table/Table.astro +15 -7
- package/src/content-config.ts +87 -1
- package/src/curriculum/competency-graph.ts +95 -0
- package/src/reference/base-library.mjs +19 -0
- package/src/reference/consistency.ts +126 -39
- package/src/reference/deck-remark.mjs +600 -0
- package/src/reference/deck-source.ts +273 -0
- package/src/reference/decks-validate.ts +604 -0
- package/src/reference/diagram-layout.ts +3 -1
- package/src/reference/figure-symbols.ts +108 -31
- package/src/reference/folds-validate.ts +1 -1
- package/src/reference/gate-indices.ts +5 -3
- package/src/reference/gate-math.ts +169 -25
- package/src/reference/lab-katex-validate.ts +30 -15
- package/src/reference/lab-math-scope.ts +34 -3
- package/src/reference/math-glyphs.mjs +189 -25
- package/src/reference/page-notation.ts +69 -15
- package/src/reference/references.ts +28 -0
- package/src/reference/registry-scope.mjs +34 -0
- package/src/reference/registry.ts +41 -11
- package/src/reference/rehype-deck.mjs +286 -0
- package/src/reference/rehype-heading-anchors.mjs +48 -6
- package/src/reference/remark-notation.mjs +249 -40
- package/src/reference/source-lines.mjs +65 -0
- package/src/reference/types.ts +28 -0
- package/src/rules/catalog.ts +257 -4
- package/src/rules/course-rules.ts +21 -1
- package/src/rules/in-effect.ts +54 -8
- package/src/session/PreferenceStore.ts +23 -0
- package/src/session/deck-memory.ts +263 -0
- package/src/session/reading-memory.ts +243 -0
- package/src/styles/deck.css +1150 -0
- package/src/styles/global.css +958 -27
- package/src/styles/zones.css +277 -0
- /package/src/{components → reference}/float-name.ts +0 -0
|
@@ -1,10 +1,35 @@
|
|
|
1
1
|
import { citedIds, withoutLinkCitations } from "../reference/citation-format.mjs";
|
|
2
2
|
function lessonIdFromSlug(slug) {
|
|
3
|
-
return slug.replace(/\.(md|mdx)$/, "").replace(/\//g, ".");
|
|
3
|
+
return slug.replace(/\.(md|mdx)$/, "").replace(/\.deck$/, "").replace(/\//g, ".");
|
|
4
4
|
}
|
|
5
5
|
function isLessonSlug(slug) {
|
|
6
6
|
const clean = slug.replace(/\.(md|mdx)$/, "");
|
|
7
|
-
return clean.includes("/") && !clean.endsWith("/index");
|
|
7
|
+
return clean.includes("/") && !clean.endsWith("/index") && !isDeckSlug(clean);
|
|
8
|
+
}
|
|
9
|
+
const DECK_ROUTE_SEGMENT = "slides";
|
|
10
|
+
function isDeckSlug(slug) {
|
|
11
|
+
return /\.deck(?:\.mdx?)?$/.test(slug);
|
|
12
|
+
}
|
|
13
|
+
function deckLessonSlug(slug) {
|
|
14
|
+
return slug.replace(/\.(md|mdx)$/, "").replace(/\.deck$/, "");
|
|
15
|
+
}
|
|
16
|
+
function isPartDeckSlug(slug) {
|
|
17
|
+
return /^[^/]+\/index\.deck(?:\.mdx?)?$/.test(slug);
|
|
18
|
+
}
|
|
19
|
+
function partDeckDir(slug) {
|
|
20
|
+
return slug.replace(/\/index\.deck(?:\.mdx?)?$/, "");
|
|
21
|
+
}
|
|
22
|
+
function partDeckRouteSlug(partDir) {
|
|
23
|
+
return `${partDir}/${DECK_ROUTE_SEGMENT}`;
|
|
24
|
+
}
|
|
25
|
+
function partDeckPageId(partDir) {
|
|
26
|
+
return `${partDir}.${DECK_ROUTE_SEGMENT}`;
|
|
27
|
+
}
|
|
28
|
+
function deckRouteSlug(lessonSlug, hasChapter) {
|
|
29
|
+
return hasChapter ? `${lessonSlug}/${DECK_ROUTE_SEGMENT}` : lessonSlug;
|
|
30
|
+
}
|
|
31
|
+
function deckPageId(lessonId, hasChapter) {
|
|
32
|
+
return hasChapter ? `${lessonId}.${DECK_ROUTE_SEGMENT}` : lessonId;
|
|
8
33
|
}
|
|
9
34
|
function docsSlugsForRoute(routeSlug) {
|
|
10
35
|
return routeSlug === "" ? ["index"] : [routeSlug, `${routeSlug}/index`];
|
|
@@ -58,27 +83,95 @@ function mergeTrackOrder(tracks) {
|
|
|
58
83
|
return ordered;
|
|
59
84
|
}
|
|
60
85
|
const PART_OVERVIEW_CLASS = "explico-part-overview";
|
|
61
|
-
|
|
86
|
+
const DECK_ROW_CLASS = "explico-deck-row";
|
|
87
|
+
const DECK_LESSON_CLASS = "explico-deck-lesson";
|
|
88
|
+
const PART_DECK_CLASS = "explico-part-deck";
|
|
89
|
+
function numberList(numbers) {
|
|
90
|
+
const sorted = [...new Set(numbers)].sort((left, right) => left - right);
|
|
91
|
+
const runs = [];
|
|
92
|
+
for (let start = 0; start < sorted.length; ) {
|
|
93
|
+
let end = start;
|
|
94
|
+
while (end + 1 < sorted.length && sorted[end + 1] === sorted[end] + 1) end += 1;
|
|
95
|
+
runs.push(end === start ? String(sorted[start]) : `${sorted[start]}\u2013${sorted[end]}`);
|
|
96
|
+
start = end + 1;
|
|
97
|
+
}
|
|
98
|
+
return runs.join(", ");
|
|
99
|
+
}
|
|
100
|
+
function sidebarLessonSlug(item) {
|
|
101
|
+
if (typeof item === "string") return item;
|
|
102
|
+
if (!("slug" in item)) return void 0;
|
|
103
|
+
return item.attrs?.["data-lesson"] === item.slug ? item.slug : void 0;
|
|
104
|
+
}
|
|
105
|
+
function buildSidebar(tracks, lessonSlugs, parts, {
|
|
106
|
+
floatIndex = false,
|
|
107
|
+
decks = /* @__PURE__ */ new Map(),
|
|
108
|
+
slidesFirst = /* @__PURE__ */ new Set(),
|
|
109
|
+
partDecks = /* @__PURE__ */ new Map(),
|
|
110
|
+
titleOf = () => void 0
|
|
111
|
+
} = {}) {
|
|
62
112
|
const rank = new Map(
|
|
63
113
|
mergeTrackOrder(tracks).map((lessonId, index) => [lessonId, index])
|
|
64
114
|
);
|
|
65
115
|
const positionOf = (slug) => rank.get(lessonIdFromSlug(slug)) ?? Number.POSITIVE_INFINITY;
|
|
116
|
+
const edition = (lesson, name) => {
|
|
117
|
+
const title = titleOf(lesson);
|
|
118
|
+
return {
|
|
119
|
+
"data-edition": name,
|
|
120
|
+
"data-lesson": lesson,
|
|
121
|
+
...title === void 0 ? {} : { "data-title": title }
|
|
122
|
+
};
|
|
123
|
+
};
|
|
66
124
|
const groups = parts.map(
|
|
67
125
|
({ dir, label, overviewLabel, overviewLink }) => {
|
|
68
|
-
const
|
|
126
|
+
const partDeck = partDecks.get(dir);
|
|
127
|
+
const ordered = lessonSlugs.filter((slug) => slug.startsWith(`${dir}/`)).sort(
|
|
69
128
|
(left, right) => positionOf(left) - positionOf(right) || left.localeCompare(right)
|
|
70
129
|
);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
130
|
+
const chapters = ordered.flatMap((slug) => {
|
|
131
|
+
if (slidesFirst.has(slug)) {
|
|
132
|
+
return [{ slug, attrs: { class: DECK_LESSON_CLASS, ...edition(slug, "slides") } }];
|
|
133
|
+
}
|
|
134
|
+
const deck = decks.get(slug);
|
|
135
|
+
const frame = deck === void 0 ? partDeck?.covers.get(slug) : void 0;
|
|
136
|
+
const chapter = {
|
|
137
|
+
slug,
|
|
138
|
+
attrs: {
|
|
139
|
+
...edition(slug, "chapter"),
|
|
140
|
+
...frame === void 0 || partDeck === void 0 ? {} : { "data-deck-href": `/${partDeck.route}/#slide-${frame}` }
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
return deck === void 0 ? [chapter] : [chapter, { slug: deck, label: "Slides", attrs: { class: DECK_ROW_CLASS, ...edition(slug, "slides") } }];
|
|
144
|
+
});
|
|
145
|
+
const own = [
|
|
146
|
+
...overviewLink ? [
|
|
74
147
|
{
|
|
75
148
|
label: overviewLabel ?? "Overview",
|
|
76
149
|
link: overviewLink,
|
|
77
|
-
attrs: { class: PART_OVERVIEW_CLASS }
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
] :
|
|
81
|
-
|
|
150
|
+
attrs: { class: PART_OVERVIEW_CLASS, "data-part": dir, "data-part-edition": "overview" }
|
|
151
|
+
}
|
|
152
|
+
] : [],
|
|
153
|
+
...partDeck === void 0 ? [] : [
|
|
154
|
+
{
|
|
155
|
+
slug: partDeck.route,
|
|
156
|
+
label: "Slides",
|
|
157
|
+
attrs: {
|
|
158
|
+
class: `${DECK_ROW_CLASS} ${PART_DECK_CLASS}`,
|
|
159
|
+
"data-edition": "slides",
|
|
160
|
+
"data-part": dir,
|
|
161
|
+
"data-part-edition": "slides",
|
|
162
|
+
"data-title": label,
|
|
163
|
+
// A chapter's ordinal is its place in the part, as `lessons[].chapter` numbers it.
|
|
164
|
+
"data-chapters": numberList(
|
|
165
|
+
[...partDeck.covers.keys()].flatMap((slug) => {
|
|
166
|
+
const at = ordered.indexOf(slug);
|
|
167
|
+
return at === -1 ? [] : [at + 1];
|
|
168
|
+
})
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
];
|
|
174
|
+
return { label, items: [...own, ...chapters] };
|
|
82
175
|
}
|
|
83
176
|
);
|
|
84
177
|
groups.push({
|
|
@@ -91,15 +184,54 @@ function buildSidebar(tracks, lessonSlugs, parts, { floatIndex = false } = {}) {
|
|
|
91
184
|
});
|
|
92
185
|
return groups;
|
|
93
186
|
}
|
|
187
|
+
function withPartDeckFrames(groups, decks) {
|
|
188
|
+
const byPart = new Map(decks.flatMap((deck) => deck.part === void 0 ? [] : [[deck.part, deck]]));
|
|
189
|
+
const rangeOf = (chapter) => {
|
|
190
|
+
const numbers = decks.flatMap(
|
|
191
|
+
(deck) => deck.part === void 0 ? [] : deck.frames.filter((frame) => frame.chapter === chapter).map((frame) => frame.number)
|
|
192
|
+
);
|
|
193
|
+
if (numbers.length === 0) return void 0;
|
|
194
|
+
const first = Math.min(...numbers);
|
|
195
|
+
const last = Math.max(...numbers);
|
|
196
|
+
return first === last ? String(first) : `${first}\u2013${last}`;
|
|
197
|
+
};
|
|
198
|
+
return groups.map((group) => ({
|
|
199
|
+
...group,
|
|
200
|
+
items: group.items.map((item) => {
|
|
201
|
+
if (typeof item === "string" || item.attrs === void 0) return item;
|
|
202
|
+
const attrs = item.attrs;
|
|
203
|
+
const deck = attrs["data-part-edition"] === "slides" ? byPart.get(attrs["data-part"] ?? "") : void 0;
|
|
204
|
+
if (deck) return { ...item, attrs: { ...attrs, "data-frames": String(deck.frames.length) } };
|
|
205
|
+
const lesson = attrs["data-lesson"];
|
|
206
|
+
const range = attrs["data-deck-href"] === void 0 || lesson === void 0 ? void 0 : rangeOf(lesson);
|
|
207
|
+
return range === void 0 ? item : { ...item, attrs: { ...attrs, "data-deck-range": range } };
|
|
208
|
+
})
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
94
211
|
export {
|
|
212
|
+
DECK_LESSON_CLASS,
|
|
213
|
+
DECK_ROUTE_SEGMENT,
|
|
214
|
+
DECK_ROW_CLASS,
|
|
215
|
+
PART_DECK_CLASS,
|
|
95
216
|
PART_OVERVIEW_CLASS,
|
|
96
217
|
buildSidebar,
|
|
97
218
|
citedSourceIds,
|
|
219
|
+
deckLessonSlug,
|
|
220
|
+
deckPageId,
|
|
221
|
+
deckRouteSlug,
|
|
98
222
|
deriveRequires,
|
|
99
223
|
deriveSources,
|
|
100
224
|
docsSlugsForRoute,
|
|
225
|
+
isDeckSlug,
|
|
101
226
|
isLessonSlug,
|
|
227
|
+
isPartDeckSlug,
|
|
102
228
|
lessonIdFromSlug,
|
|
103
229
|
mergeTrackOrder,
|
|
104
|
-
|
|
230
|
+
numberList,
|
|
231
|
+
parseCheckList,
|
|
232
|
+
partDeckDir,
|
|
233
|
+
partDeckPageId,
|
|
234
|
+
partDeckRouteSlug,
|
|
235
|
+
sidebarLessonSlug,
|
|
236
|
+
withPartDeckFrames
|
|
105
237
|
};
|
|
@@ -12,10 +12,12 @@ import { LabKatexDiagnostic } from '../reference/lab-katex-validate.js';
|
|
|
12
12
|
import { MathGateDiagnostic } from '../reference/gate-math.js';
|
|
13
13
|
import { ContentSegment } from '../reference/mixed-content.js';
|
|
14
14
|
import { GlyphScopeEntry } from '../reference/gloss.js';
|
|
15
|
-
import { NotationDefinitionRecord, NotationPageBundle, NotationBacklink, NotationDiagnostic
|
|
16
|
-
import { N as NormalizedLessonExports, a as NormalizedDisclosure, b as NormalizedNumbering, B as BlockLabels, c as NormalizedCards, M as ManifestRules,
|
|
15
|
+
import { NotationGlossEntry, NotationDefinitionRecord, NotationPageBundle, NotationBacklink, NotationDiagnostic } from '../reference/types.js';
|
|
16
|
+
import { N as NormalizedLessonExports, a as NormalizedDisclosure, b as NormalizedNumbering, B as BlockLabels, c as NormalizedCards, d as NormalizedSidebarMarks, e as NormalizedSidebarEditions, R as ReadingMemorySetting, f as NormalizedAppearance, g as NormalizedDeck, M as ManifestRules, h as ConfigDiagnostic, C as CourseConfig } from '../course-config-BLtIdkei.js';
|
|
17
17
|
import { WaiverDiagnostic } from '../rules/waivers.js';
|
|
18
18
|
import { KnowledgeVersionDiagnostic } from './knowledge-version.js';
|
|
19
|
+
import { ManifestPageVersions } from './page-versions.js';
|
|
20
|
+
import { BuiltDeck } from './decks.js';
|
|
19
21
|
import { SidebarGroup } from './lesson-derivation.js';
|
|
20
22
|
import './collections.js';
|
|
21
23
|
import '../reference/gate-retired-keys.js';
|
|
@@ -23,6 +25,8 @@ import '../reference/lint-ignore.js';
|
|
|
23
25
|
import '../reference/keyed-float-validate.js';
|
|
24
26
|
import '../rules/catalog.js';
|
|
25
27
|
import '../rules/course-rules.js';
|
|
28
|
+
import '../reference/decks-validate.js';
|
|
29
|
+
import '../reference/deck-source.js';
|
|
26
30
|
|
|
27
31
|
/**
|
|
28
32
|
* The one compiler manifest (Phase D5).
|
|
@@ -209,8 +213,65 @@ import '../rules/course-rules.js';
|
|
|
209
213
|
* `formulaTemplate` when its entry sets them, and a bundle definition its
|
|
210
214
|
* `range`. `diagnostics.math` carries `index-explained`, `index-swallowed`,
|
|
211
215
|
* `index-range` and `derived-key-taken`.
|
|
216
|
+
*
|
|
217
|
+
* v32 (a page's own version, rule C5): `lessons[].since` and
|
|
218
|
+
* `parts[].overview.since` carry the knowledge version each chapter's and
|
|
219
|
+
* part page's content last changed in (`null` for a change not yet
|
|
220
|
+
* released), read from the committed `content/versions.json` through
|
|
221
|
+
* `pageVersions` — the record as `validate:content` writes it.
|
|
222
|
+
* `about.knowledge` gains `releases` (every released entry with its date)
|
|
223
|
+
* and `unreleased` (whether `## [Unreleased]` holds bullets).
|
|
224
|
+
* `diagnostics.knowledge` can carry `page-versions-invalid`.
|
|
225
|
+
* `sidebarMarks` carries the course's `sidebarMarks` setting, defaults
|
|
226
|
+
* applied: whether the sidebar marks a page the reader has not opened yet,
|
|
227
|
+
* and one whose content changed since they last did. `readingMemory` says
|
|
228
|
+
* whether the course asks the reader to keep that memory (`ask`) or never
|
|
229
|
+
* keeps it (`off`).
|
|
230
|
+
* v33 (decks, additive): `decks` lists each lesson's slide edition
|
|
231
|
+
* (`<lesson>.deck.mdx`) with its frames, numbered as the deck shows them;
|
|
232
|
+
* `deck` carries the course's `deck` settings, defaults applied, and the
|
|
233
|
+
* canvas; `lessons[].editions` says which editions a lesson has
|
|
234
|
+
* (`chapter`, `deck`). A slides-first lesson (a deck with no chapter) is a
|
|
235
|
+
* lesson like any other, with `editions: ["deck"]`. `decks[].since` is the
|
|
236
|
+
* version a deck's page last changed in (rule C5), as a chapter's `since`.
|
|
237
|
+
* In `sidebar`, a deck beside its chapter follows the chapter's slug as
|
|
238
|
+
* `{ slug, label: "Slides", attrs: { class: "explico-deck-row" } }`, and a
|
|
239
|
+
* slides-first lesson is `{ slug, attrs: { class: "explico-deck-lesson" } }`
|
|
240
|
+
* in place of its slug (`sidebarLessonSlug` reads either kind of lesson).
|
|
241
|
+
*
|
|
242
|
+
* v34 (editions in the sidebar): `sidebarEditions` carries the course's
|
|
243
|
+
* `sidebarEditions` setting, defaults applied: the edition a lesson's row
|
|
244
|
+
* opens (`lead`: `chapter` or `slides`) and whether the row lists the other
|
|
245
|
+
* (`other`: `listed` or `hidden`). In `sidebar`, every item of a lesson
|
|
246
|
+
* carries `data-edition` (`chapter` or `slides`), `data-lesson` (the
|
|
247
|
+
* lesson's slug) and `data-title` (its title) in `attrs`, so a chapter is
|
|
248
|
+
* `{ slug, attrs }` where it was a bare slug. An item lists its lesson when
|
|
249
|
+
* it is served at the lesson's own URL, `data-lesson` equal to its `slug`:
|
|
250
|
+
* a chapter, or a slides-first lesson's deck; a chapter's slides row
|
|
251
|
+
* follows it as before.
|
|
252
|
+
*
|
|
253
|
+
* v35 (the slides a reader has seen): every frame of `decks[].frames`
|
|
254
|
+
* carries `id`, 12 hex digits of a SHA-256 over what it shows, which a
|
|
255
|
+
* reader's record of the frames shown in Present mode keeps
|
|
256
|
+
* (`ManifestDeckFrame.id`).
|
|
257
|
+
*
|
|
258
|
+
* v36 (a part's deck): `decks` lists each part's deck
|
|
259
|
+
* (`<part>/index.deck.mdx`, at `<part>/slides`) too, with `part` (its
|
|
260
|
+
* directory) and no `lessonId`, which is now optional. Every deck carries
|
|
261
|
+
* `covers`, the chapters a part's deck covers with the frame each one's
|
|
262
|
+
* section opens on (empty on a lesson's deck); a part's deck carries
|
|
263
|
+
* `recalledFrom`, the chapter of each float it recalls, and each frame of
|
|
264
|
+
* a covered section `chapter`. In `sidebar`, a part's deck follows the
|
|
265
|
+
* part's Overview as `{ slug, label: "Slides", attrs: { class:
|
|
266
|
+
* "explico-deck-row explico-part-deck", "data-edition": "slides",
|
|
267
|
+
* "data-part" } }`, and a chapter it covers that has no deck of its own
|
|
268
|
+
* carries `data-deck-href`, the address of its section.
|
|
269
|
+
*
|
|
270
|
+
* v37 (the page's zones and slide edges): `appearance` carries the course's
|
|
271
|
+
* `appearance` setting, defaults applied: `zones` (`tonal`, `accent-header`,
|
|
272
|
+
* `paper` or `none`) and `slides` (`lifted`, `edge` or `sorter`).
|
|
212
273
|
*/
|
|
213
|
-
declare const MANIFEST_SCHEMA_VERSION =
|
|
274
|
+
declare const MANIFEST_SCHEMA_VERSION = 37;
|
|
214
275
|
declare const MANIFEST_PATH: string;
|
|
215
276
|
interface ManifestCitation {
|
|
216
277
|
readonly id: string;
|
|
@@ -276,6 +337,16 @@ interface ManifestDerivedNotation {
|
|
|
276
337
|
readonly glosses: readonly NotationGlossEntry[];
|
|
277
338
|
readonly formulaScope: readonly GlyphScopeEntry[];
|
|
278
339
|
}
|
|
340
|
+
/**
|
|
341
|
+
* One lesson's deck (v33), or a part's (v36): its frames as `decks.ts` reads
|
|
342
|
+
* them, and the notation its page shows — its own bundle, which holds its
|
|
343
|
+
* chapters'.
|
|
344
|
+
*/
|
|
345
|
+
interface ManifestDeck extends BuiltDeck {
|
|
346
|
+
readonly notation: ManifestLesson['notation'];
|
|
347
|
+
/** The version the deck's page last changed in (rule C5), as a chapter's `since`. */
|
|
348
|
+
readonly since: string | null;
|
|
349
|
+
}
|
|
279
350
|
/**
|
|
280
351
|
* One keyed float of a lesson (v21): its key and number, and its caption pair
|
|
281
352
|
* — `short` (an equation's `\caption{…}`, or the `short` prop) and, for a
|
|
@@ -305,6 +376,12 @@ interface ManifestLesson {
|
|
|
305
376
|
readonly id: string;
|
|
306
377
|
/** Docs-loader slug, e.g. `bonds/price-yield-relationship`. */
|
|
307
378
|
readonly slug: string;
|
|
379
|
+
/**
|
|
380
|
+
* The lesson's editions (v33): `chapter` (its `.mdx`), `deck` (its
|
|
381
|
+
* `.deck.mdx`, listed in `manifest.decks`), or both. A slides-first lesson
|
|
382
|
+
* is `["deck"]`: its slug is its deck's route and its floats are unnumbered.
|
|
383
|
+
*/
|
|
384
|
+
readonly editions: readonly ('chapter' | 'deck')[];
|
|
308
385
|
/**
|
|
309
386
|
* The 1-based ordinal of the **part** this lesson sits in — its sidebar
|
|
310
387
|
* group's position in `courseConfig.parts`. It is the first number of every
|
|
@@ -353,6 +430,15 @@ interface ManifestLesson {
|
|
|
353
430
|
readonly file: string;
|
|
354
431
|
readonly title: string;
|
|
355
432
|
readonly description: string;
|
|
433
|
+
/**
|
|
434
|
+
* The knowledge version this chapter's content last changed in (v32, rule
|
|
435
|
+
* C5): its file, its checks and assessments, the shared notation it uses,
|
|
436
|
+
* the sources it cites and its numbers, against `content/versions.json`.
|
|
437
|
+
* `null` while it has a change `## [Unreleased]` has not released. What
|
|
438
|
+
* the exports and the `[?]` panel print for the page; with rule C5 off,
|
|
439
|
+
* the course's own version.
|
|
440
|
+
*/
|
|
441
|
+
readonly since: string | null;
|
|
356
442
|
/** Authored reader-facing estimate; `40` and `[30, 40]` both land here. */
|
|
357
443
|
readonly studyMinutes?: {
|
|
358
444
|
readonly min: number;
|
|
@@ -439,6 +525,16 @@ interface ManifestAbout {
|
|
|
439
525
|
readonly date?: string;
|
|
440
526
|
/** Bullet notes from that entry. */
|
|
441
527
|
readonly notes: readonly string[];
|
|
528
|
+
/**
|
|
529
|
+
* Every released entry, newest first, with its date (v32): what dates a
|
|
530
|
+
* document whose content last changed in an earlier release (rule C5).
|
|
531
|
+
*/
|
|
532
|
+
readonly releases: readonly {
|
|
533
|
+
readonly version: string;
|
|
534
|
+
readonly date?: string;
|
|
535
|
+
}[];
|
|
536
|
+
/** `## [Unreleased]` holds bullets: a change is waiting for a release (v32). */
|
|
537
|
+
readonly unreleased: boolean;
|
|
442
538
|
/** Content fingerprint at compile time — ties the shown version to a build. */
|
|
443
539
|
readonly contentTree: string;
|
|
444
540
|
};
|
|
@@ -506,6 +602,8 @@ interface ManifestPart {
|
|
|
506
602
|
readonly title: string;
|
|
507
603
|
readonly file: string;
|
|
508
604
|
readonly description?: string;
|
|
605
|
+
/** The version the page's content last changed in (v32, rule C5), as a chapter's `since`. */
|
|
606
|
+
readonly since: string | null;
|
|
509
607
|
};
|
|
510
608
|
}
|
|
511
609
|
interface Manifest {
|
|
@@ -520,6 +618,30 @@ interface Manifest {
|
|
|
520
618
|
readonly blockLabels: BlockLabels;
|
|
521
619
|
/** How the explanation cards start for a reader, defaults applied (`CourseConfig.cards`). */
|
|
522
620
|
readonly cards: NormalizedCards;
|
|
621
|
+
/**
|
|
622
|
+
* Which marks the sidebar shows a reader beside a chapter or part page
|
|
623
|
+
* (v32, `CourseConfig.sidebarMarks`): not opened yet, changed since opened.
|
|
624
|
+
*/
|
|
625
|
+
readonly sidebarMarks: NormalizedSidebarMarks;
|
|
626
|
+
/**
|
|
627
|
+
* Which edition a lesson's sidebar row opens for a reader who has not
|
|
628
|
+
* chosen, and whether it lists the other (v34, `CourseConfig.sidebarEditions`).
|
|
629
|
+
*/
|
|
630
|
+
readonly sidebarEditions: NormalizedSidebarEditions;
|
|
631
|
+
/**
|
|
632
|
+
* Whether the course asks the reader to keep their reading memory (v32,
|
|
633
|
+
* `CourseConfig.readingMemory`): `ask` or `off`.
|
|
634
|
+
*/
|
|
635
|
+
readonly readingMemory: ReadingMemorySetting;
|
|
636
|
+
/**
|
|
637
|
+
* How the page tells its zones apart and how slides sit on it, defaults
|
|
638
|
+
* applied (v37, `CourseConfig.appearance`).
|
|
639
|
+
*/
|
|
640
|
+
readonly appearance: NormalizedAppearance;
|
|
641
|
+
/** The course's `deck` settings, defaults applied, and its canvas (v33). */
|
|
642
|
+
readonly deck: NormalizedDeck;
|
|
643
|
+
/** Each lesson's deck, by route (v33). */
|
|
644
|
+
readonly decks: readonly ManifestDeck[];
|
|
523
645
|
/** Reader-facing identity + versions (the `[?]` About panel). */
|
|
524
646
|
readonly about: ManifestAbout;
|
|
525
647
|
readonly notation: {
|
|
@@ -539,6 +661,13 @@ interface Manifest {
|
|
|
539
661
|
/** The course's parts in config order, with their chapters and overview pages. */
|
|
540
662
|
readonly parts: readonly ManifestPart[];
|
|
541
663
|
readonly lessons: readonly ManifestLesson[];
|
|
664
|
+
/**
|
|
665
|
+
* The record of every chapter's and part page's own version (v32, rule
|
|
666
|
+
* C5), as `validate:content` writes it to `content/versions.json`
|
|
667
|
+
* (`syncPageVersions`); `lessons[].since` and `parts[].overview.since`
|
|
668
|
+
* are read from it.
|
|
669
|
+
*/
|
|
670
|
+
readonly pageVersions: ManifestPageVersions;
|
|
542
671
|
/** Every docs page that is not a chapter, by id (v25). */
|
|
543
672
|
readonly pages: readonly ManifestPage[];
|
|
544
673
|
/** Full competency prerequisite graph. */
|
|
@@ -656,4 +785,4 @@ declare function readManifestSync(): Manifest;
|
|
|
656
785
|
*/
|
|
657
786
|
declare function loadManifest(courseConfig?: CourseConfig): Promise<Manifest>;
|
|
658
787
|
|
|
659
|
-
export { MANIFEST_PATH, MANIFEST_SCHEMA_VERSION, type Manifest, type ManifestAbout, type ManifestAssessmentItemContent, type ManifestCitation, type ManifestDerivedNotation, type ManifestLesson, type ManifestLessonFloat, type ManifestLessonNotation, type ManifestNotationResolution, type ManifestPage, type ManifestPart, type ManifestTitledBlock, type PrereqEdge, compileManifest, loadManifest, readManifestSync, serializeManifest, writeManifest };
|
|
788
|
+
export { MANIFEST_PATH, MANIFEST_SCHEMA_VERSION, type Manifest, type ManifestAbout, type ManifestAssessmentItemContent, type ManifestCitation, type ManifestDeck, type ManifestDerivedNotation, type ManifestLesson, type ManifestLessonFloat, type ManifestLessonNotation, type ManifestNotationResolution, type ManifestPage, type ManifestPart, type ManifestTitledBlock, type PrereqEdge, compileManifest, loadManifest, readManifestSync, serializeManifest, writeManifest };
|