@allons-y/course-kit 0.0.0-stage → 0.2.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.
Files changed (137) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +90 -2
  3. package/assets/fonts/instrument-sans-italic-var.woff2 +0 -0
  4. package/assets/fonts/instrument-sans-var.woff2 +0 -0
  5. package/assets/fonts/pt-mono.woff2 +0 -0
  6. package/assets/scripts/copy.js +99 -0
  7. package/assets/scripts/deck.js +161 -0
  8. package/assets/scripts/email.js +19 -0
  9. package/assets/scripts/practice.js +545 -0
  10. package/assets/scripts/theme-panel.js +647 -0
  11. package/assets/scripts/theme-restore.js +17 -0
  12. package/assets/styles/base.css +2091 -0
  13. package/assets/styles/deck.css +968 -0
  14. package/assets/styles/font.css +36 -0
  15. package/assets/styles/notes.css +137 -0
  16. package/assets/styles/print.css +428 -0
  17. package/assets/styles/semantics.css +101 -0
  18. package/components/practice/check-controls.webc +50 -0
  19. package/components/practice/choice-list.webc +86 -0
  20. package/components/practice/cite-panel.webc +108 -0
  21. package/components/practice/practice-figure.webc +47 -0
  22. package/components/practice/practice-fill.webc +154 -0
  23. package/components/practice/practice-grid.webc +82 -0
  24. package/components/practice/practice-judge.webc +165 -0
  25. package/components/practice/practice-match.webc +178 -0
  26. package/components/practice/practice-question.webc +141 -0
  27. package/components/practice/practice-selfcheck.webc +40 -0
  28. package/components/practice/practice-terms.webc +95 -0
  29. package/components/practice/practice-tree.webc +91 -0
  30. package/components/practice/practice-worksheet.webc +369 -0
  31. package/components/site/copyright.webc +13 -0
  32. package/components/site/course-documents.webc +27 -0
  33. package/components/site/course-now.webc +393 -0
  34. package/components/site/course-summary.webc +136 -0
  35. package/components/site/demo-weeks.webc +91 -0
  36. package/components/site/glossary-entry.webc +31 -0
  37. package/components/site/glossary-panel.webc +1482 -0
  38. package/components/site/glossary.webc +45 -0
  39. package/components/site/grading.webc +50 -0
  40. package/components/site/instructor.webc +432 -0
  41. package/components/site/masthead.webc +147 -0
  42. package/components/site/nav-links.webc +174 -0
  43. package/components/site/policies.webc +17 -0
  44. package/components/site/practice-index.webc +31 -0
  45. package/components/site/schedule-overview.webc +145 -0
  46. package/components/site/schedule-weeks.webc +589 -0
  47. package/components/site/site-footer.webc +119 -0
  48. package/components/site/slide-timetable.webc +152 -0
  49. package/components/site/syllabus.webc +370 -0
  50. package/components/ui/arrow-link.webc +19 -0
  51. package/components/ui/assigned-list.webc +101 -0
  52. package/components/ui/callout.webc +11 -0
  53. package/components/ui/card-list.webc +124 -0
  54. package/components/ui/codepen-embed.webc +123 -0
  55. package/components/ui/download-button.webc +49 -0
  56. package/components/ui/eyebrow.webc +18 -0
  57. package/components/ui/icons/github.webc +6 -0
  58. package/components/ui/icons/google.webc +9 -0
  59. package/components/ui/link-list.webc +130 -0
  60. package/components/ui/link-section.webc +40 -0
  61. package/components/ui/meeting-card.webc +73 -0
  62. package/components/ui/meeting-decks.webc +38 -0
  63. package/components/ui/table-rubric.webc +251 -0
  64. package/components/ui/today-link.webc +43 -0
  65. package/components/ui/today-marker.webc +149 -0
  66. package/components/ui/week-block.webc +53 -0
  67. package/examples/starter/_data/course.json +20 -0
  68. package/examples/starter/_data/dates.json +16 -0
  69. package/examples/starter/_data/grading.json +6 -0
  70. package/examples/starter/_data/instructor.json +7 -0
  71. package/examples/starter/_data/policies.json +9 -0
  72. package/examples/starter/_data/scale.json +8 -0
  73. package/examples/starter/_data/schedule.json +22 -0
  74. package/examples/starter/_data/theme.json +17 -0
  75. package/examples/starter/content/index.webc +12 -0
  76. package/examples/starter/content/schedule.webc +12 -0
  77. package/examples/starter/content/slides/index.11tydata.js +5 -0
  78. package/examples/starter/content/slides/index.webc +12 -0
  79. package/examples/starter/content/slides/week-1-day-1.md +40 -0
  80. package/examples/starter/eleventy.config.js +8 -0
  81. package/glue/deck-notes.data.js +41 -0
  82. package/glue/deck-notes.webc +32 -0
  83. package/glue/lesson-day.data.js +17 -0
  84. package/glue/lesson-day.webc +0 -0
  85. package/glue/lesson-plans.data.js +13 -0
  86. package/glue/lesson-plans.webc +2 -0
  87. package/index.js +6 -0
  88. package/layouts/base.webc +79 -0
  89. package/layouts/deck.webc +46 -0
  90. package/layouts/demo.webc +16 -0
  91. package/layouts/document.webc +10 -0
  92. package/layouts/lesson-detail.webc +109 -0
  93. package/layouts/lesson.webc +71 -0
  94. package/layouts/notes.webc +23 -0
  95. package/layouts/worksheet.webc +52 -0
  96. package/lib/assets.js +42 -0
  97. package/lib/bundles.js +79 -0
  98. package/lib/check.js +110 -0
  99. package/lib/components.js +19 -0
  100. package/lib/copy.js +656 -0
  101. package/lib/data/build.js +22 -0
  102. package/lib/data/fonts.js +16 -0
  103. package/lib/data/glossary.js +304 -0
  104. package/lib/data/index.js +8 -0
  105. package/lib/data/lessons.js +173 -0
  106. package/lib/data/project.js +22 -0
  107. package/lib/data/read.js +61 -0
  108. package/lib/data/site.js +70 -0
  109. package/lib/data/term.js +80 -0
  110. package/lib/extensions.js +70 -0
  111. package/lib/files.js +14 -0
  112. package/lib/filters.js +584 -0
  113. package/lib/fit.js +106 -0
  114. package/lib/glue.js +26 -0
  115. package/lib/lesson-materials.js +66 -0
  116. package/lib/markdown.js +568 -0
  117. package/lib/minify.js +53 -0
  118. package/lib/paths.js +5 -0
  119. package/lib/pdf.js +134 -0
  120. package/lib/plugin.js +231 -0
  121. package/lib/plugins.js +34 -0
  122. package/lib/postcss.js +93 -0
  123. package/lib/theme-server.js +88 -0
  124. package/lib/theme.js +185 -0
  125. package/lib/worksheet-dialect.js +415 -0
  126. package/lib/worksheets.js +276 -0
  127. package/package.json +119 -4
  128. package/schemas/course.schema.json +161 -0
  129. package/schemas/dates.schema.json +165 -0
  130. package/schemas/grading.schema.json +59 -0
  131. package/schemas/instructor.schema.json +76 -0
  132. package/schemas/policies.schema.json +90 -0
  133. package/schemas/project.schema.json +209 -0
  134. package/schemas/scale.schema.json +68 -0
  135. package/schemas/schedule.schema.json +260 -0
  136. package/schemas/theme.schema.json +704 -0
  137. package/schemas/worksheet.schema.json +449 -0
@@ -0,0 +1,174 @@
1
+ <script webc:setup>
2
+ /**
3
+ * The site navigation as a list of links, marking the current page. Give it the `navigation` array, or write the links in the default slot
4
+ * as a `<ul>` of `<li><a>`; the array wins when it has items, and when it is missing or empty the slot is rendered instead.
5
+ * @prop {{ url: string, title: string }[]} navigation pages from `eleventyNavigation`
6
+ * @prop {'footer' | 'hero'} [context] adds the instructor's contact link in the footer and the hero
7
+ */
8
+ </script>
9
+ <nav webc:root="override" :data-context="context">
10
+ <ul role="list" webc:if="navigation?.length">
11
+ <li webc:for="item of navigation">
12
+ <a :href="item?.url" @attributes="({ 'aria-current': item?.url === $data?.page?.url ? 'page' : undefined })" @text="item?.title"></a>
13
+ </li>
14
+ <li webc:if="$data.instructor?.contact && (context === 'footer' || context === 'hero')"><a :href="$data.instructor.contact" @text="$data.copy.nav.contact"></a></li>
15
+ </ul>
16
+ <slot webc:if="!navigation?.length"></slot>
17
+ </nav>
18
+ <style webc:scoped>
19
+ :host:not(:has(li)) {
20
+ display: none;
21
+ }
22
+
23
+ :host {
24
+ display: flex;
25
+ gap: calc(var(--container-space) * 3.5);
26
+
27
+ ul {
28
+ list-style: none;
29
+ margin: 0;
30
+ padding: 0;
31
+
32
+ display: inline-flex;
33
+ flex-wrap: wrap;
34
+ justify-content: space-evenly;
35
+ inline-size: 100%;
36
+ gap: calc(var(--content-space) * 1.6);
37
+
38
+ @media screen and (width <= 612px) {
39
+ justify-content: flex-start;
40
+ column-gap: calc(var(--content-space) * 0.75);
41
+ row-gap: calc(var(--content-space) * 0.25);
42
+ }
43
+ }
44
+
45
+ li {
46
+ font-size: 1em;
47
+ }
48
+
49
+ /* `a[href]` outranks the page's underline for links in lists. A menu is
50
+ not a sentence: it carries no underline until you point at it, and the
51
+ current page keeps an accent one. */
52
+ a[href] {
53
+ /* Inline padding is left alone; the block padding lifts each link to
54
+ the 24px minimum target size without changing the row rhythm. */
55
+ display: inline-flex;
56
+ align-items: center;
57
+ min-block-size: var(--target-min);
58
+ min-inline-size: var(--target-min);
59
+ padding-block: 0.2em;
60
+ font-size: max(var(--base-font-size), 0.95em);
61
+ color: inherit;
62
+ text-decoration: none;
63
+
64
+ /* The current page keeps an underline here; the hero menu fills it (below). */
65
+ &[aria-current="page"] {
66
+ text-decoration: underline;
67
+ text-decoration-color: var(--color-accent-text);
68
+ text-decoration-thickness: var(--border-width);
69
+ text-underline-offset: 0.4ex;
70
+ }
71
+
72
+ &:not([aria-current="page"]):is(:hover, :focus-visible) {
73
+ color: var(--color-link-hover);
74
+ text-decoration: underline;
75
+ text-decoration-thickness: var(--thin-border-width);
76
+ text-underline-offset: 0.4ex;
77
+ }
78
+
79
+ @media screen and (width <= 612px) {
80
+ font-size: max(var(--base-font-size), 0.875em);
81
+ }
82
+ }
83
+ }
84
+
85
+ /* Stacked (the footer and the 404 page): one row while the links fit, folding
86
+ to as many rows as it takes when they don't. No breakpoint — the content
87
+ decides, so the same rule holds for three links or a dozen. */
88
+ :host([stacked]) ul {
89
+ display: flex;
90
+ flex-wrap: wrap;
91
+ justify-content: start;
92
+ align-items: baseline;
93
+ column-gap: calc(var(--content-space) * 2);
94
+ row-gap: calc(var(--content-space) * 0.35);
95
+ }
96
+
97
+ /* Column (the hero's link stack and the footer groups): one link per line,
98
+ folding back into a wrapped row on narrow screens where the column would
99
+ otherwise push the page content down. */
100
+ :host([column]) {
101
+ padding: 0;
102
+ line-height: inherit;
103
+ }
104
+
105
+ :host([column]) ul {
106
+ display: flex;
107
+ flex-direction: column;
108
+ align-items: start;
109
+ justify-content: start;
110
+ inline-size: auto;
111
+ gap: calc(var(--content-space) * 0.35);
112
+
113
+ @media screen and (width <= 768px) {
114
+ flex-direction: row;
115
+ flex-wrap: wrap;
116
+ align-items: baseline;
117
+ column-gap: calc(var(--content-space) * 1.25);
118
+ row-gap: calc(var(--content-space) * 0.25);
119
+ }
120
+ }
121
+
122
+ :host([column]) li {
123
+ display: block;
124
+ }
125
+
126
+ /* A stack of plain links, not pills — no border, no background. */
127
+ :host([column]) a,
128
+ :host([column]) a:visited {
129
+ margin: 0;
130
+ padding-inline: var(--link-pad, 0);
131
+ border: none;
132
+ border-radius: 0;
133
+ line-height: inherit;
134
+ font-size: max(var(--base-font-size), 1em);
135
+ color: inherit;
136
+
137
+ &[aria-current="page"] {
138
+ padding-inline: var(--link-pad, 0);
139
+ background: none;
140
+ color: var(--color-accent-text);
141
+ }
142
+ }
143
+
144
+ /* The hero menu: the current page is a filled pill, so it reads as "you are
145
+ here" without relying on an underline. Links are 44px targets. Flat
146
+ selectors: webc:scoped does not rewrite a nested `&` under `:host()`. */
147
+ :host([data-context="hero"][column]) {
148
+ --link-pad: 0.85em;
149
+ }
150
+
151
+ :host([data-context="hero"][column]) a[href] {
152
+ border-radius: var(--radius-pill);
153
+ }
154
+
155
+ :host([data-context="hero"][column]) a[href][aria-current="page"] {
156
+ background-color: var(--color-accent-secondary);
157
+ color: var(--color-on-accent-secondary);
158
+ text-decoration: none;
159
+ font-weight: var(--font-weight--semi-bold);
160
+ --color-focus-ring: var(--color-on-accent-secondary);
161
+ }
162
+
163
+ :host([data-context="hero"][column]) a[href]:not([aria-current="page"]):hover {
164
+ background-color: color-mix(in oklab, var(--color-accent-secondary) 10%, transparent);
165
+ }
166
+
167
+ @media (forced-colors: active) {
168
+ :host([data-context="hero"][column]) a[href][aria-current="page"] {
169
+ forced-color-adjust: none;
170
+ background: SelectedItem;
171
+ color: SelectedItemText;
172
+ }
173
+ }
174
+ </style>
@@ -0,0 +1,17 @@
1
+ <script webc:setup>
2
+ /**
3
+ * The policies section: one disclosure per entry in `policies.json`, open by
4
+ * default, each with an optional link to the full policy. Renders nothing
5
+ * without `policies`.
6
+ */
7
+ </script>
8
+ <section webc:root="override" class="content-column" aria-labelledby="policies-heading" webc:if="$data.policies">
9
+ <h2 id="policies-heading" @text="$data.copy.policies.policies"></h2>
10
+ <div class="disclosures">
11
+ <details webc:for="entry of Object.entries($data.policies).filter(([key]) => key !== '$schema')" :id="`policy-${entry[0]}`" open>
12
+ <summary @text="entry[1].title"></summary>
13
+ <p @text="expandTokens(entry[1].body, $data)"></p>
14
+ <p webc:if="entry[1].href"><a :href="entry[1].href" @text="entry[1].hrefText ?? $data.copy.policies.readTheFullPolicy"></a></p>
15
+ </details>
16
+ </div>
17
+ </section>
@@ -0,0 +1,31 @@
1
+ <script webc:setup>
2
+ /**
3
+ * The practice page's table: every practice sheet in `collections.practice`,
4
+ * by its worksheet `order` (then its URL), with what each is for. Says so when
5
+ * there are none. The page's own intro stays page content. Wording comes
6
+ * from `copy.practice`.
7
+ */
8
+ const sheets = (collection) => [...(collection ?? [])].sort((a, b) => (a.data.worksheet?.order ?? 99) - (b.data.worksheet?.order ?? 99) || a.url.localeCompare(b.url));
9
+ </script>
10
+ <div webc:root="override" class="practice-index">
11
+ <p class="muted" webc:if="!$data.collections?.practice?.length" @text="$data.copy.practice.empty"></p>
12
+ <table class="table-light" webc:if="$data.collections?.practice?.length" data-practice>
13
+ <caption class="sr-only" @text="$data.copy.practice.caption"></caption>
14
+ <thead>
15
+ <tr>
16
+ <th scope="col" @text="$data.copy.practice.colSheet"></th>
17
+ <th scope="col" @text="$data.copy.practice.colFor"></th>
18
+ </tr>
19
+ </thead>
20
+ <tbody>
21
+ <tr webc:for="entry of sheets($data.collections.practice)">
22
+ <th scope="row">
23
+ <a :href="entry.url" @text="entry.data.worksheet?.heading ?? entry.data.title"></a>
24
+ </th>
25
+ <td>
26
+ <span @text="entry.data.worksheet?.lede"></span>
27
+ </td>
28
+ </tr>
29
+ </tbody>
30
+ </table>
31
+ </div>
@@ -0,0 +1,145 @@
1
+ <script webc:setup>
2
+ /**
3
+ * The schedule page's header: the meeting line, the key dates, and a row
4
+ * of jump links (Today, then one per month). Props are read in the
5
+ * template, since a setup script cannot see them.
6
+ * @prop {{ title: string, items: object[] }[]} [groups] `scheduleKeyDates`
7
+ * output; built from the page's lessons, project and exam slot when left out
8
+ * @prop {object[]} [weeks] `scheduleWeeks` output, for the month links;
9
+ * built from the page when left out
10
+ */
11
+ const defaultGroups = scheduleKeyDates($data.lessons, $data.project, $data.schedule?.finalExam, $data.copy);
12
+ const defaultWeeks = scheduleWeeks($data.lessons, $data.schedule?.weeks, $data.collections?.deck, $data.demos);
13
+ </script>
14
+ <header webc:root="override" class="schedule-overview">
15
+ <today-marker></today-marker>
16
+ <eyebrow class="separators">
17
+ <span @text="$data.term.label"></span>
18
+ <span @text="$data.course.code"></span>
19
+ </eyebrow>
20
+ <h1 @text="$data.copy.scheduleOverview.schedule"></h1>
21
+ <p class="meets" webc:if="$data.schedule?.meetings?.days?.length">
22
+ <span @text="$data.schedule.meetings.days.length > 1 ? `${$data.schedule.meetings.days.slice(0, -1).join(', ')} & ${$data.schedule.meetings.days.at(-1)}` : $data.schedule.meetings.days[0]"></span>
23
+ <span webc:if="$data.schedule.meetings.time" @text="$data.schedule.meetings.time"></span>
24
+ <span webc:if="$data.instructor?.office" @text="$data.instructor.office"></span>
25
+ </p>
26
+
27
+ <section class="key-dates" aria-labelledby="schedule-key-dates" webc:if="(groups ?? defaultGroups)?.length">
28
+ <h2 id="schedule-key-dates" @text="$data.copy.scheduleOverview.keyDates"></h2>
29
+ <div class="group" webc:for="group of (groups ?? defaultGroups)">
30
+ <h3 @text="group.title"></h3>
31
+ <ul role="list">
32
+ <li webc:for="item of group.items">
33
+ <strong @text="item.label"></strong>
34
+ <span class="when" @text="item.date"></span>
35
+ <span class="note" webc:if="item.note" @text="item.note"></span>
36
+ </li>
37
+ </ul>
38
+ </div>
39
+ </section>
40
+
41
+ <nav class="schedule-jump" :aria-label="$data.copy.scheduleOverview.jumpTo" webc:if="scheduleMonths(weeks ?? defaultWeeks).length">
42
+ <h2 @text="$data.copy.scheduleOverview.jumpTo"></h2>
43
+ <ul role="list">
44
+ <li><today-link :@label="$data.copy.schedule.today"></today-link></li>
45
+ <li webc:for="entry of scheduleMonths(weeks ?? defaultWeeks)"><a :href="`#week-${entry.week}`" @text="entry.name"></a></li>
46
+ </ul>
47
+ </nav>
48
+ </header>
49
+
50
+ <style webc:scoped>
51
+ /* The page header: key dates as stacked groups of label/date rows (they
52
+ wrap, so nothing scrolls sideways on a phone) and a "Jump to" row of
53
+ tap-sized links (Today, then one per month). */
54
+ :host > :where(.meets) {
55
+ max-inline-size: 70ch;
56
+ }
57
+
58
+ .meets {
59
+ display: flex;
60
+ flex-wrap: wrap;
61
+ gap: 0 1em;
62
+ color: var(--color-text-muted);
63
+ }
64
+
65
+ .key-dates {
66
+ display: grid;
67
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 18em), 1fr));
68
+ gap: var(--content-space) calc(var(--content-space) * 1.5);
69
+ max-inline-size: none;
70
+
71
+ > h2 {
72
+ grid-column: 1 / -1;
73
+ margin-block-end: 0;
74
+ }
75
+
76
+ /* A group's name is a label for the rows under it, in the text face. */
77
+ h3 {
78
+ margin-block: 0 0.25em;
79
+ font-family: var(--sans-font);
80
+ font-size: var(--font-size-6);
81
+ font-weight: var(--font-weight--semi-bold);
82
+ letter-spacing: 0.06em;
83
+ text-transform: uppercase;
84
+ color: var(--color-text-muted);
85
+ }
86
+
87
+ ul {
88
+ list-style: none;
89
+ margin: 0;
90
+ padding: 0;
91
+ }
92
+
93
+ li {
94
+ display: flex;
95
+ flex-direction: column;
96
+ padding-block: 0.4em;
97
+ border-block-start: var(--thin-border-width) solid var(--color-border);
98
+ }
99
+
100
+ .when,
101
+ .note {
102
+ color: var(--color-text-muted);
103
+ }
104
+
105
+ .note {
106
+ font-size: max(var(--base-font-size), 0.9em);
107
+ font-style: italic;
108
+ }
109
+ }
110
+
111
+ .schedule-jump {
112
+ ul {
113
+ display: flex;
114
+ flex-wrap: wrap;
115
+ gap: 0.4rem;
116
+ list-style: none;
117
+ margin: 0;
118
+ padding: 0;
119
+ }
120
+
121
+ a {
122
+ display: flex;
123
+ align-items: center;
124
+ justify-content: center;
125
+ min-block-size: 2.75rem;
126
+ min-inline-size: 2.75rem;
127
+ padding-inline: 1em;
128
+ border: var(--thin-border-width) solid var(--color-border);
129
+ border-radius: var(--standard-border-radius);
130
+ font-weight: var(--font-weight--semi-bold);
131
+ text-decoration: none;
132
+
133
+ &:is(:hover, :focus-visible) {
134
+ background-color: var(--color-surface);
135
+ border-color: var(--color-accent);
136
+ }
137
+ }
138
+ }
139
+
140
+ @media print {
141
+ .schedule-jump {
142
+ display: none;
143
+ }
144
+ }
145
+ </style>