explico 0.8.0 → 0.11.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.
Files changed (230) hide show
  1. package/CHANGELOG.md +1257 -1
  2. package/README.md +60 -15
  3. package/dist/compiler/astro.d.ts +6 -1
  4. package/dist/compiler/cli.d.ts +46 -2
  5. package/dist/compiler/cli.js +70 -4
  6. package/dist/compiler/collections.d.ts +35 -2
  7. package/dist/compiler/collections.js +68 -5
  8. package/dist/compiler/course-config.d.ts +3 -194
  9. package/dist/compiler/course-config.js +78 -5
  10. package/dist/compiler/exports/standalone-html.d.ts +6 -1
  11. package/dist/compiler/knowledge-version.js +1 -1
  12. package/dist/compiler/lesson-derivation.d.ts +27 -10
  13. package/dist/compiler/lesson-derivation.js +23 -8
  14. package/dist/compiler/logging.d.ts +4 -1
  15. package/dist/compiler/logging.js +4 -1
  16. package/dist/compiler/manifest.d.ts +204 -31
  17. package/dist/compiler/manifest.js +270 -55
  18. package/dist/compiler/resolution-report.d.ts +6 -1
  19. package/dist/course-config-Dsnri9Tk.d.ts +464 -0
  20. package/dist/reference/base-accents.d.mts +26 -0
  21. package/dist/reference/base-accents.mjs +31 -0
  22. package/dist/reference/base-roman-labels.d.mts +2 -2
  23. package/dist/reference/base-roman-labels.mjs +2 -2
  24. package/dist/reference/consistency.d.ts +14 -2
  25. package/dist/reference/consistency.js +108 -4
  26. package/dist/reference/delimiter-size.d.ts +3 -2
  27. package/dist/reference/diagrams-validate.d.ts +7 -2
  28. package/dist/reference/diagrams-validate.js +9 -1
  29. package/dist/reference/equations-validate.d.ts +8 -5
  30. package/dist/reference/equations-validate.js +1 -0
  31. package/dist/reference/equations.d.mts +60 -31
  32. package/dist/reference/equations.mjs +83 -43
  33. package/dist/reference/examples-validate.d.ts +31 -0
  34. package/dist/reference/examples-validate.js +48 -0
  35. package/dist/reference/figures-validate.d.ts +1 -1
  36. package/dist/reference/figures-validate.js +4 -1
  37. package/dist/reference/folds-validate.d.ts +33 -0
  38. package/dist/reference/folds-validate.js +32 -0
  39. package/dist/reference/gate-abbreviations.d.ts +3 -1
  40. package/dist/reference/gate-abbreviations.js +1 -0
  41. package/dist/reference/gate-course-rules.d.ts +32 -0
  42. package/dist/reference/gate-course-rules.js +85 -0
  43. package/dist/reference/gate-heading-length.d.ts +5 -2
  44. package/dist/reference/gate-heading-length.js +45 -21
  45. package/dist/reference/gate-heading-structure.d.ts +41 -0
  46. package/dist/reference/gate-heading-structure.js +113 -0
  47. package/dist/reference/gate-math-punctuation.d.ts +71 -0
  48. package/dist/reference/gate-math-punctuation.js +251 -0
  49. package/dist/reference/gate-math.d.ts +22 -6
  50. package/dist/reference/gate-math.js +42 -8
  51. package/dist/reference/gate-part-pages.d.ts +50 -0
  52. package/dist/reference/gate-part-pages.js +118 -0
  53. package/dist/reference/gate-prose-notation.d.ts +21 -11
  54. package/dist/reference/gate-prose-notation.js +25 -7
  55. package/dist/reference/katex-delimiters.mjs +20 -7
  56. package/dist/reference/keyed-float-validate.d.ts +27 -10
  57. package/dist/reference/keyed-float-validate.js +15 -1
  58. package/dist/reference/keyed-jsx-floats.d.mts +11 -5
  59. package/dist/reference/keyed-jsx-floats.mjs +73 -20
  60. package/dist/reference/knowledge-checks-validate.d.ts +1 -1
  61. package/dist/reference/knowledge-checks.d.mts +3 -1
  62. package/dist/reference/knowledge-checks.mjs +9 -4
  63. package/dist/reference/lab-math-scope.d.ts +1 -0
  64. package/dist/reference/lab-math-slot.d.ts +34 -0
  65. package/dist/reference/lab-math-slot.js +6 -0
  66. package/dist/reference/math-glyphs.d.mts +80 -4
  67. package/dist/reference/math-glyphs.mjs +572 -37
  68. package/dist/reference/page-notation.d.ts +6 -1
  69. package/dist/reference/raw-floats-validate.js +1 -1
  70. package/dist/reference/raw-floats.mjs +1 -1
  71. package/dist/reference/rehype-heading-anchors.d.mts +14 -0
  72. package/dist/reference/rehype-heading-anchors.mjs +116 -17
  73. package/dist/reference/rehype-table-header-labels.d.mts +6 -1
  74. package/dist/reference/rehype-table-header-labels.mjs +21 -3
  75. package/dist/reference/remark-asides.d.mts +3 -0
  76. package/dist/reference/remark-asides.mjs +180 -0
  77. package/dist/reference/remark-memo.d.mts +3 -1
  78. package/dist/reference/remark-memo.mjs +42 -11
  79. package/dist/reference/remark-notation.d.mts +60 -10
  80. package/dist/reference/remark-notation.mjs +387 -36
  81. package/dist/reference/render-lab-math.d.ts +4 -26
  82. package/dist/reference/render-lab-math.js +4 -4
  83. package/dist/reference/sections-validate.d.ts +27 -0
  84. package/dist/reference/sections-validate.js +41 -0
  85. package/dist/reference/sections.d.mts +97 -0
  86. package/dist/reference/sections.mjs +306 -0
  87. package/dist/reference/tables-validate.d.ts +1 -1
  88. package/dist/reference/types.d.ts +17 -1
  89. package/dist/reference/unit-words.d.ts +37 -0
  90. package/dist/reference/unit-words.js +170 -0
  91. package/dist/rules/catalog.d.ts +176 -0
  92. package/dist/rules/catalog.js +983 -0
  93. package/dist/rules/course-rules.d.ts +115 -0
  94. package/dist/rules/course-rules.js +292 -0
  95. package/dist/rules/course-rules.schema.json +138 -0
  96. package/dist/rules/in-effect.d.ts +53 -0
  97. package/dist/rules/in-effect.js +142 -0
  98. package/dist/rules/rules.schema.json +1072 -0
  99. package/dist/rules/settings.d.ts +3 -0
  100. package/dist/rules/settings.js +290 -0
  101. package/dist/rules/waivers.d.ts +53 -0
  102. package/dist/rules/waivers.js +132 -0
  103. package/dist/session/PreferenceStore.d.ts +5 -0
  104. package/dist/session/PreferenceStore.js +9 -0
  105. package/docs/VERSIONING.md +5 -3
  106. package/docs/authoring/README.md +232 -40
  107. package/docs/authoring/agents.md +55 -9
  108. package/docs/authoring/components.md +178 -22
  109. package/docs/authoring/migrating.md +1152 -2
  110. package/docs/authoring/notation.md +576 -322
  111. package/docs/authoring/prose.md +551 -0
  112. package/docs/authoring/retired.md +35 -0
  113. package/docs/authoring/structure-rules.md +422 -40
  114. package/docs/authoring/structure.md +445 -62
  115. package/docs/authoring/versioning.md +20 -28
  116. package/docs/authoring/visualizations.md +142 -20
  117. package/package.json +2 -2
  118. package/src/compiler/cli.ts +116 -6
  119. package/src/compiler/collections.ts +111 -7
  120. package/src/compiler/course-config.ts +273 -34
  121. package/src/compiler/knowledge-version.ts +1 -1
  122. package/src/compiler/lesson-derivation.ts +54 -15
  123. package/src/compiler/logging.ts +8 -2
  124. package/src/compiler/manifest.ts +573 -104
  125. package/src/components/BlockHeading.astro +113 -0
  126. package/src/components/CourseContents.astro +221 -0
  127. package/src/components/CurriculumMap.astro +5 -6
  128. package/src/components/FloatIndex.astro +200 -0
  129. package/src/components/HoverPanel.astro +431 -79
  130. package/src/components/PartBridge.astro +27 -0
  131. package/src/components/PartOverview.astro +401 -0
  132. package/src/components/PartScope.astro +27 -0
  133. package/src/components/abbreviation/AbbreviationLayer.astro +49 -51
  134. package/src/components/assessments/AssessmentRunner.tsx +8 -5
  135. package/src/components/assessments/AssessmentSet.astro +23 -26
  136. package/src/components/block-heading.ts +146 -0
  137. package/src/components/card-arrow.ts +243 -0
  138. package/src/components/card-drag.ts +631 -0
  139. package/src/components/card-jump.ts +45 -0
  140. package/src/components/card-manager.ts +1589 -0
  141. package/src/components/card-memory.ts +177 -0
  142. package/src/components/card-placement.ts +504 -0
  143. package/src/components/card-side.ts +336 -0
  144. package/src/components/card-travel.ts +197 -0
  145. package/src/components/citation/CitationLayer.astro +77 -76
  146. package/src/components/diagram/Diagram.astro +161 -316
  147. package/src/components/disclosure/course-disclosure.ts +24 -0
  148. package/src/components/disclosure/hover-preview.ts +122 -42
  149. package/src/components/disclosure/persisted-disclosure.ts +3 -3
  150. package/src/components/disclosure/print-as-shown.ts +252 -0
  151. package/src/components/examples/CompactExample.astro +3 -1
  152. package/src/components/examples/CompactExamples.astro +101 -94
  153. package/src/components/figure/Figure.astro +174 -274
  154. package/src/components/figure/FloatCaption.astro +87 -0
  155. package/src/components/figure/figure-state.ts +58 -0
  156. package/src/components/figure/figure-tools.ts +87 -0
  157. package/src/components/float-name.ts +101 -0
  158. package/src/components/fold/Fold.astro +125 -0
  159. package/src/components/fold/fold-id.ts +40 -0
  160. package/src/components/memo/Memo.astro +162 -231
  161. package/src/components/memo/ShortNote.astro +6 -6
  162. package/src/components/notation/NotationFormula.astro +5 -1
  163. package/src/components/notation/NotationGlossary.astro +3 -4
  164. package/src/components/notation/NotationLayer.astro +169 -162
  165. package/src/components/notation/NotationMath.astro +10 -1
  166. package/src/components/reference/FloatRefLayer.astro +485 -423
  167. package/src/components/starlight/AboutPanel.astro +5 -4
  168. package/src/components/starlight/CollapsibleSections.astro +207 -93
  169. package/src/components/starlight/DiagramEnhancer.astro +15 -138
  170. package/src/components/starlight/HeadingAnchorEnhancer.astro +193 -1
  171. package/src/components/starlight/KeyedFloatEnhancer.astro +100 -9
  172. package/src/components/starlight/LayoutHeader.astro +298 -19
  173. package/src/components/starlight/LayoutPageSidebar.astro +99 -12
  174. package/src/components/starlight/LayoutPageTitle.astro +120 -0
  175. package/src/components/starlight/LayoutSidebar.astro +229 -11
  176. package/src/components/starlight/LessonExportActions.astro +53 -72
  177. package/src/components/starlight/LessonFooter.astro +26 -4
  178. package/src/components/starlight/section-parts.ts +15 -2
  179. package/src/components/starlight/section-summary.ts +181 -0
  180. package/src/components/table/Table.astro +95 -76
  181. package/src/components/table/TableOverflowExpander.astro +65 -28
  182. package/src/content-config.ts +40 -4
  183. package/src/reference/base-accents.mjs +31 -0
  184. package/src/reference/base-roman-labels.mjs +2 -2
  185. package/src/reference/consistency.ts +176 -5
  186. package/src/reference/delimiter-size.ts +3 -2
  187. package/src/reference/diagrams-validate.ts +17 -1
  188. package/src/reference/equations-validate.ts +10 -5
  189. package/src/reference/equations.mjs +83 -43
  190. package/src/reference/examples-validate.ts +97 -0
  191. package/src/reference/figures-validate.ts +6 -1
  192. package/src/reference/folds-validate.ts +65 -0
  193. package/src/reference/gate-abbreviations.ts +1 -0
  194. package/src/reference/gate-course-rules.ts +134 -0
  195. package/src/reference/gate-heading-length.ts +66 -35
  196. package/src/reference/gate-heading-structure.ts +193 -0
  197. package/src/reference/gate-math-punctuation.ts +381 -0
  198. package/src/reference/gate-math.ts +69 -10
  199. package/src/reference/gate-part-pages.ts +217 -0
  200. package/src/reference/gate-prose-notation.ts +59 -12
  201. package/src/reference/katex-delimiters.mjs +20 -7
  202. package/src/reference/keyed-float-validate.ts +45 -11
  203. package/src/reference/keyed-jsx-floats.mjs +73 -20
  204. package/src/reference/knowledge-checks-validate.ts +1 -1
  205. package/src/reference/knowledge-checks.mjs +9 -4
  206. package/src/reference/lab-math-slot.ts +36 -0
  207. package/src/reference/math-glyphs.mjs +572 -37
  208. package/src/reference/raw-floats-validate.ts +1 -1
  209. package/src/reference/raw-floats.mjs +1 -1
  210. package/src/reference/rehype-heading-anchors.mjs +116 -17
  211. package/src/reference/rehype-table-header-labels.mjs +21 -3
  212. package/src/reference/remark-asides.mjs +180 -0
  213. package/src/reference/remark-memo.mjs +42 -11
  214. package/src/reference/remark-notation.mjs +387 -36
  215. package/src/reference/render-lab-math.ts +16 -31
  216. package/src/reference/sections-validate.ts +81 -0
  217. package/src/reference/sections.mjs +306 -0
  218. package/src/reference/tables-validate.ts +2 -1
  219. package/src/reference/types.ts +17 -0
  220. package/src/reference/unit-words.ts +233 -0
  221. package/src/rules/catalog.ts +1298 -0
  222. package/src/rules/course-rules.ts +456 -0
  223. package/src/rules/in-effect.ts +235 -0
  224. package/src/rules/settings.ts +448 -0
  225. package/src/rules/waivers.ts +249 -0
  226. package/src/session/PreferenceStore.ts +15 -0
  227. package/src/styles/global.css +1467 -163
  228. package/src/styles/surfaces.css +182 -0
  229. package/src/components/hover-panel.ts +0 -339
  230. package/src/components/popup-stack.ts +0 -345
@@ -4,15 +4,21 @@
4
4
  * Every number on a page comes from two places that MUST agree: the page's own
5
5
  * counters (`numbering`) and the manifest tables a cross-page `[[slug#eq-key]]`
6
6
  * is resolved against (`equations` / `tables` / `figures` / `diagrams` /
7
- * `checks`).
7
+ * `checks` / `examples`).
8
8
  * Deriving every input from the same manifest in one step stops a course config from
9
9
  * supplying one without the other — the omission that produced page-local
10
10
  * `(2.2)` and cross-page `(4.5)` for the same equation.
11
11
  *
12
12
  * `numbering` maps a lesson slug to
13
- * `{ part, equations, tables, figures, diagrams, checks }`: the part's ordinal
14
- * (the number before the dot) and, per numbered kind, how many earlier lessons
15
- * of that part already used.
13
+ * `{ part, chapter, prefix, equations, tables, figures, diagrams, checks,
14
+ * examples }`:
15
+ * the part and chapter ordinals, the float-number prefix (`‹part›.‹chapter›`,
16
+ * or the part alone under `numbering.floats: "part"`), and, per numbered kind,
17
+ * how many precede the lesson in that scope. `sections` maps a lesson slug to
18
+ * its top-level headings (`manifest.lessons[].headings`), and
19
+ * `sectionNumbering` is the course's `{ show, depth }`. `checkTitles` and
20
+ * `exampleTitles` map a lesson slug to its checks' and example sets' titles,
21
+ * which a reference prints when the course hides section numbers.
16
22
  */
17
23
  export function numberingFromManifest(manifest: any): {
18
24
  equations?: undefined;
@@ -20,6 +26,11 @@ export function numberingFromManifest(manifest: any): {
20
26
  figures?: undefined;
21
27
  diagrams?: undefined;
22
28
  checks?: undefined;
29
+ examples?: undefined;
30
+ checkTitles?: undefined;
31
+ exampleTitles?: undefined;
32
+ sections?: undefined;
33
+ sectionNumbering?: undefined;
23
34
  numbering?: undefined;
24
35
  } | {
25
36
  equations: any;
@@ -27,6 +38,17 @@ export function numberingFromManifest(manifest: any): {
27
38
  figures: any;
28
39
  diagrams: any;
29
40
  checks: any;
41
+ examples: any;
42
+ checkTitles: {
43
+ [k: string]: any;
44
+ };
45
+ exampleTitles: {
46
+ [k: string]: any;
47
+ };
48
+ sections: {
49
+ [k: string]: any;
50
+ };
51
+ sectionNumbering: any;
30
52
  numbering: {
31
53
  [k: string]: any;
32
54
  };
@@ -70,7 +92,12 @@ export function createRemarkNotationOptions(manifest: object, overrides?: object
70
92
  * figures?: Record<string, Record<string, string>>,
71
93
  * diagrams?: Record<string, Record<string, string>>,
72
94
  * checks?: Record<string, Record<string, string>>,
73
- * numbering?: Record<string, { part: number, equations: number, tables: number, figures: number, diagrams: number, checks: number }>,
95
+ * examples?: Record<string, Record<string, string>>,
96
+ * checkTitles?: Record<string, Record<string, string>>,
97
+ * exampleTitles?: Record<string, Record<string, string>>,
98
+ * sections?: Record<string, readonly { slug: string, text: string, level: number, number?: string }[]>,
99
+ * sectionNumbering?: { show: boolean, depth: number },
100
+ * numbering?: Record<string, { part: number, chapter?: number, prefix?: string, equations: number, tables: number, figures: number, diagrams: number, checks: number, examples?: number }>,
74
101
  * chapters?: Record<string, number>,
75
102
  * }} [options]
76
103
  *
@@ -79,16 +106,23 @@ export function createRemarkNotationOptions(manifest: object, overrides?: object
79
106
  * They stay available individually for hand-built trees, and an explicitly
80
107
  * supplied one still wins over the manifest.
81
108
  *
82
- * `numbering` maps a lesson slug to its **part** (the number before the dot)
83
- * and, per kind of float, how many the earlier lessons of that part already
84
- * used. Every display equation / `<Table>` / `<Figure>` / `<Diagram>` on the page is then
85
- * numbered `‹part›.‹offset + n›`, with `##` and `###` headings ignored; with no
86
- * entry the legacy `##`-section scheme applies. It must agree with
109
+ * `numbering` maps a lesson slug to its **part** and **chapter**, its float
110
+ * `prefix` (`‹part›.‹chapter›`, or the part alone under `numbering.floats:
111
+ * "part"`) and, per kind of float, how many precede the lesson in that scope.
112
+ * Every display equation / `<Table>` / `<Figure>` / `<Diagram>` /
113
+ * `<CompactExamples>` on the page is then numbered `‹prefix›.‹offset + n›`,
114
+ * with `##` and `###` headings ignored;
115
+ * with no entry the legacy `##`-section scheme applies. It must agree with
87
116
  * `manifest.lessons[]`, which is what feeds `equations`/`tables`/`figures`/`diagrams`
88
117
  * above — supplying the tables without `numbering` numbers the same equation
89
118
  * twice, and `assertManifestNumberParity` turns that into a build error rather
90
119
  * than a page whose references disagree with their targets.
91
120
  *
121
+ * `sections` maps a lesson slug to its top-level headings, and
122
+ * `sectionNumbering` is the course's `{ show, depth }`: a page's own headings
123
+ * take the anchors and outline numbers listed there (`stampSectionHeadings`),
124
+ * and `[[sec-…]]` prints `§ 1.1.2` from the same list.
125
+ *
92
126
  * `chapters` is the superseded per-lesson form (slug → the lesson's course
93
127
  * ordinal, no running offset). Still read when `numbering` has no entry, so a
94
128
  * config written against the old option keeps building.
@@ -113,13 +147,29 @@ export default function remarkNotation(options?: {
113
147
  figures?: Record<string, Record<string, string>>;
114
148
  diagrams?: Record<string, Record<string, string>>;
115
149
  checks?: Record<string, Record<string, string>>;
150
+ examples?: Record<string, Record<string, string>>;
151
+ checkTitles?: Record<string, Record<string, string>>;
152
+ exampleTitles?: Record<string, Record<string, string>>;
153
+ sections?: Record<string, readonly {
154
+ slug: string;
155
+ text: string;
156
+ level: number;
157
+ number?: string;
158
+ }[]>;
159
+ sectionNumbering?: {
160
+ show: boolean;
161
+ depth: number;
162
+ };
116
163
  numbering?: Record<string, {
117
164
  part: number;
165
+ chapter?: number;
166
+ prefix?: string;
118
167
  equations: number;
119
168
  tables: number;
120
169
  figures: number;
121
170
  diagrams: number;
122
171
  checks: number;
172
+ examples?: number;
123
173
  }>;
124
174
  chapters?: Record<string, number>;
125
175
  }): (tree: any, file: any) => void;