@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.
- package/LICENSE +373 -0
- package/README.md +90 -2
- package/assets/fonts/instrument-sans-italic-var.woff2 +0 -0
- package/assets/fonts/instrument-sans-var.woff2 +0 -0
- package/assets/fonts/pt-mono.woff2 +0 -0
- package/assets/scripts/copy.js +99 -0
- package/assets/scripts/deck.js +161 -0
- package/assets/scripts/email.js +19 -0
- package/assets/scripts/practice.js +545 -0
- package/assets/scripts/theme-panel.js +647 -0
- package/assets/scripts/theme-restore.js +17 -0
- package/assets/styles/base.css +2091 -0
- package/assets/styles/deck.css +968 -0
- package/assets/styles/font.css +36 -0
- package/assets/styles/notes.css +137 -0
- package/assets/styles/print.css +428 -0
- package/assets/styles/semantics.css +101 -0
- package/components/practice/check-controls.webc +50 -0
- package/components/practice/choice-list.webc +86 -0
- package/components/practice/cite-panel.webc +108 -0
- package/components/practice/practice-figure.webc +47 -0
- package/components/practice/practice-fill.webc +154 -0
- package/components/practice/practice-grid.webc +82 -0
- package/components/practice/practice-judge.webc +165 -0
- package/components/practice/practice-match.webc +178 -0
- package/components/practice/practice-question.webc +141 -0
- package/components/practice/practice-selfcheck.webc +40 -0
- package/components/practice/practice-terms.webc +95 -0
- package/components/practice/practice-tree.webc +91 -0
- package/components/practice/practice-worksheet.webc +369 -0
- package/components/site/copyright.webc +13 -0
- package/components/site/course-documents.webc +27 -0
- package/components/site/course-now.webc +393 -0
- package/components/site/course-summary.webc +136 -0
- package/components/site/demo-weeks.webc +91 -0
- package/components/site/glossary-entry.webc +31 -0
- package/components/site/glossary-panel.webc +1482 -0
- package/components/site/glossary.webc +45 -0
- package/components/site/grading.webc +50 -0
- package/components/site/instructor.webc +432 -0
- package/components/site/masthead.webc +147 -0
- package/components/site/nav-links.webc +174 -0
- package/components/site/policies.webc +17 -0
- package/components/site/practice-index.webc +31 -0
- package/components/site/schedule-overview.webc +145 -0
- package/components/site/schedule-weeks.webc +589 -0
- package/components/site/site-footer.webc +119 -0
- package/components/site/slide-timetable.webc +152 -0
- package/components/site/syllabus.webc +370 -0
- package/components/ui/arrow-link.webc +19 -0
- package/components/ui/assigned-list.webc +101 -0
- package/components/ui/callout.webc +11 -0
- package/components/ui/card-list.webc +124 -0
- package/components/ui/codepen-embed.webc +123 -0
- package/components/ui/download-button.webc +49 -0
- package/components/ui/eyebrow.webc +18 -0
- package/components/ui/icons/github.webc +6 -0
- package/components/ui/icons/google.webc +9 -0
- package/components/ui/link-list.webc +130 -0
- package/components/ui/link-section.webc +40 -0
- package/components/ui/meeting-card.webc +73 -0
- package/components/ui/meeting-decks.webc +38 -0
- package/components/ui/table-rubric.webc +251 -0
- package/components/ui/today-link.webc +43 -0
- package/components/ui/today-marker.webc +149 -0
- package/components/ui/week-block.webc +53 -0
- package/examples/starter/_data/course.json +20 -0
- package/examples/starter/_data/dates.json +16 -0
- package/examples/starter/_data/grading.json +6 -0
- package/examples/starter/_data/instructor.json +7 -0
- package/examples/starter/_data/policies.json +9 -0
- package/examples/starter/_data/scale.json +8 -0
- package/examples/starter/_data/schedule.json +22 -0
- package/examples/starter/_data/theme.json +17 -0
- package/examples/starter/content/index.webc +12 -0
- package/examples/starter/content/schedule.webc +12 -0
- package/examples/starter/content/slides/index.11tydata.js +5 -0
- package/examples/starter/content/slides/index.webc +12 -0
- package/examples/starter/content/slides/week-1-day-1.md +40 -0
- package/examples/starter/eleventy.config.js +8 -0
- package/glue/deck-notes.data.js +41 -0
- package/glue/deck-notes.webc +32 -0
- package/glue/lesson-day.data.js +17 -0
- package/glue/lesson-day.webc +0 -0
- package/glue/lesson-plans.data.js +13 -0
- package/glue/lesson-plans.webc +2 -0
- package/index.js +6 -0
- package/layouts/base.webc +79 -0
- package/layouts/deck.webc +46 -0
- package/layouts/demo.webc +16 -0
- package/layouts/document.webc +10 -0
- package/layouts/lesson-detail.webc +109 -0
- package/layouts/lesson.webc +71 -0
- package/layouts/notes.webc +23 -0
- package/layouts/worksheet.webc +52 -0
- package/lib/assets.js +42 -0
- package/lib/bundles.js +79 -0
- package/lib/check.js +110 -0
- package/lib/components.js +19 -0
- package/lib/copy.js +656 -0
- package/lib/data/build.js +22 -0
- package/lib/data/fonts.js +16 -0
- package/lib/data/glossary.js +304 -0
- package/lib/data/index.js +8 -0
- package/lib/data/lessons.js +173 -0
- package/lib/data/project.js +22 -0
- package/lib/data/read.js +61 -0
- package/lib/data/site.js +70 -0
- package/lib/data/term.js +80 -0
- package/lib/extensions.js +70 -0
- package/lib/files.js +14 -0
- package/lib/filters.js +584 -0
- package/lib/fit.js +106 -0
- package/lib/glue.js +26 -0
- package/lib/lesson-materials.js +66 -0
- package/lib/markdown.js +568 -0
- package/lib/minify.js +53 -0
- package/lib/paths.js +5 -0
- package/lib/pdf.js +134 -0
- package/lib/plugin.js +231 -0
- package/lib/plugins.js +34 -0
- package/lib/postcss.js +93 -0
- package/lib/theme-server.js +88 -0
- package/lib/theme.js +185 -0
- package/lib/worksheet-dialect.js +415 -0
- package/lib/worksheets.js +276 -0
- package/package.json +119 -4
- package/schemas/course.schema.json +161 -0
- package/schemas/dates.schema.json +165 -0
- package/schemas/grading.schema.json +59 -0
- package/schemas/instructor.schema.json +76 -0
- package/schemas/policies.schema.json +90 -0
- package/schemas/project.schema.json +209 -0
- package/schemas/scale.schema.json +68 -0
- package/schemas/schedule.schema.json +260 -0
- package/schemas/theme.schema.json +704 -0
- package/schemas/worksheet.schema.json +449 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* The page footer: course, institution, term, copyright and the links. Reads `course`, `site` and `term`.
|
|
4
|
+
*/
|
|
5
|
+
</script>
|
|
6
|
+
<div webc:root="override">
|
|
7
|
+
<div class="brand">
|
|
8
|
+
<p class="course"><a href="/"><span @text="$data.course.code"></span>: <span @text="$data.course.name"></span></a></p>
|
|
9
|
+
<p class="meta separators">
|
|
10
|
+
<span @text="$data.site.institution"></span>
|
|
11
|
+
<span @text="$data.term.label"></span>
|
|
12
|
+
</p>
|
|
13
|
+
<copyright></copyright>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="group">
|
|
16
|
+
<p class="label" id="footer-pages" @text="$data.copy.siteFooter.pages"></p>
|
|
17
|
+
<nav-links column aria-labelledby="footer-pages" @context="footer" :@navigation="eleventyNavigation($data.collections.all)"></nav-links>
|
|
18
|
+
</div>
|
|
19
|
+
<nav class="group" aria-labelledby="footer-policies" webc:if="$data.policies">
|
|
20
|
+
<p class="label" id="footer-policies" @text="$data.copy.siteFooter.policies"></p>
|
|
21
|
+
<ul role="list">
|
|
22
|
+
<li webc:for="(key, policy) in Object.fromEntries(Object.entries($data.policies).filter(([name]) => name !== '$schema'))">
|
|
23
|
+
<a :href="policy.href?.startsWith('/') ? policy.href : `/#policy-${key}`" @text="policy.title"></a>
|
|
24
|
+
</li>
|
|
25
|
+
</ul>
|
|
26
|
+
</nav>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<style webc:scoped>
|
|
30
|
+
/* Three groups: who and when, where to go, what the rules are. The policy
|
|
31
|
+
links point at the landing page's policy disclosures (each carries a
|
|
32
|
+
`policy-<key>` id) except where a policy has its own page on this site. */
|
|
33
|
+
:host {
|
|
34
|
+
--context: footer;
|
|
35
|
+
|
|
36
|
+
text-align: start;
|
|
37
|
+
display: grid;
|
|
38
|
+
grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
|
|
39
|
+
gap: var(--section-space) calc(var(--section-space) * 1.5);
|
|
40
|
+
align-items: start;
|
|
41
|
+
|
|
42
|
+
@media screen and (width <= 768px) {
|
|
43
|
+
grid-template-columns: minmax(0, 1fr);
|
|
44
|
+
gap: var(--section-space);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.brand {
|
|
48
|
+
display: grid;
|
|
49
|
+
gap: calc(var(--content-space) * 0.4);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.course {
|
|
53
|
+
margin: 0;
|
|
54
|
+
max-inline-size: none;
|
|
55
|
+
font-weight: var(--font-weight--semi-bold);
|
|
56
|
+
|
|
57
|
+
a {
|
|
58
|
+
color: var(--color-text);
|
|
59
|
+
text-decoration: none;
|
|
60
|
+
|
|
61
|
+
&:is(:hover, :focus-visible) {
|
|
62
|
+
color: var(--color-link-hover);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.meta {
|
|
68
|
+
margin: 0;
|
|
69
|
+
color: var(--color-text-muted);
|
|
70
|
+
font-size: max(var(--base-font-size), 0.85em);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.label {
|
|
74
|
+
margin: 0 0 calc(var(--content-space) * 0.5);
|
|
75
|
+
font-size: var(--font-size-6);
|
|
76
|
+
font-weight: var(--font-weight--semi-bold);
|
|
77
|
+
letter-spacing: 0.08em;
|
|
78
|
+
text-transform: uppercase;
|
|
79
|
+
color: var(--color-text-muted);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
ul {
|
|
83
|
+
list-style: none;
|
|
84
|
+
margin: 0;
|
|
85
|
+
padding: 0;
|
|
86
|
+
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
align-items: start;
|
|
90
|
+
gap: 0;
|
|
91
|
+
|
|
92
|
+
@media screen and (width <= 768px) {
|
|
93
|
+
flex-direction: row;
|
|
94
|
+
flex-wrap: wrap;
|
|
95
|
+
align-items: center;
|
|
96
|
+
column-gap: calc(var(--content-space) * 1.25);
|
|
97
|
+
row-gap: 0;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
li {
|
|
102
|
+
font-size: 1em;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
nav.group a,
|
|
106
|
+
.course a {
|
|
107
|
+
display: inline-flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
min-block-size: var(--target-min);
|
|
110
|
+
font-size: max(var(--base-font-size), 1em);
|
|
111
|
+
color: inherit;
|
|
112
|
+
text-decoration: none;
|
|
113
|
+
|
|
114
|
+
&:is(:hover, :focus-visible) {
|
|
115
|
+
color: var(--color-link-hover);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
</style>
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* Every slide deck as a timetable: one row per week, one column per meeting
|
|
4
|
+
* day.
|
|
5
|
+
* @prop {{ days: string[], weeks: object[] }} [timetable] `slideTimetable`
|
|
6
|
+
* output; built from the page's decks, lessons and meeting days when left out
|
|
7
|
+
*/
|
|
8
|
+
const defaultTimetable = slideTimetable($data.collections?.deck, $data.lessons, $data.schedule?.meetings?.days);
|
|
9
|
+
</script>
|
|
10
|
+
<table webc:root="override" class="slide-timetable" data-today-host="timetable" webc:if="(timetable ?? defaultTimetable)?.weeks?.length">
|
|
11
|
+
<today-marker></today-marker>
|
|
12
|
+
<caption class="sr-only" @text="$data.copy.slideTimetable.everySlideDeckFor"></caption>
|
|
13
|
+
<thead>
|
|
14
|
+
<tr>
|
|
15
|
+
<th scope="col" @text="$data.copy.slideTimetable.week"></th>
|
|
16
|
+
<th scope="col" webc:for="day of (timetable ?? defaultTimetable).days" @text="day"></th>
|
|
17
|
+
</tr>
|
|
18
|
+
</thead>
|
|
19
|
+
<tbody>
|
|
20
|
+
<tr webc:for="week of (timetable ?? defaultTimetable).weeks">
|
|
21
|
+
<th scope="row">
|
|
22
|
+
<span class="week-title" @text="fill($data.copy.schedule.weekHeading, { week: week.week })"></span>
|
|
23
|
+
<span class="week-of" @text="week.dates"></span>
|
|
24
|
+
</th>
|
|
25
|
+
<td webc:for="cell of week.cells" :data-day="cell.weekday" :data-date="cell.iso">
|
|
26
|
+
<p class="empty" webc:if="cell.missing" @text="$data.copy.slideTimetable.noMeeting"></p>
|
|
27
|
+
<p class="empty no-class" webc:if="cell.noClass" @text="fill($data.copy.slideTimetable.noClass, { reason: cell.noClass })"></p>
|
|
28
|
+
<template webc:nokeep webc:if="!cell.missing && !cell.noClass">
|
|
29
|
+
<p class="date" @text="cell.date"></p>
|
|
30
|
+
<p class="deck-title" webc:if="cell.deck"><arrow-link :href="cell.deck.url"><span @text="cell.deck.title"></span></arrow-link></p>
|
|
31
|
+
<p class="empty" webc:if="!cell.deck" @text="$data.copy.slideTimetable.noDeck"></p>
|
|
32
|
+
<p class="draft" webc:if="cell.deck?.draft" @text="$data.copy.slideTimetable.draftNotInThe"></p>
|
|
33
|
+
<p class="notes" webc:if="cell.deck && $data.audience.instructor"><a :href="cell.deck.notesUrl" @text="$data.copy.slideTimetable.speakerNotes"></a></p>
|
|
34
|
+
<p class="deck-title" webc:if="cell.addendum"><arrow-link :href="cell.addendum.url"><span @text="cell.addendum.title"></span></arrow-link></p>
|
|
35
|
+
<p class="draft" webc:if="cell.addendum?.draft" @text="$data.copy.slideTimetable.addendumDraftNotIn"></p>
|
|
36
|
+
<p class="notes" webc:if="cell.addendum && $data.audience.instructor"><a :href="cell.addendum.notesUrl" @text="$data.copy.slideTimetable.addendumSpeakerNotes"></a></p>
|
|
37
|
+
</template>
|
|
38
|
+
</td>
|
|
39
|
+
</tr>
|
|
40
|
+
</tbody>
|
|
41
|
+
</table>
|
|
42
|
+
|
|
43
|
+
<style webc:scoped>
|
|
44
|
+
/* A timetable: every week is one row of identical shape, one cell per
|
|
45
|
+
meeting weekday, so the eye can read down a column or across a row
|
|
46
|
+
and nothing leaves a hole. On narrow screens each row becomes a week
|
|
47
|
+
band with its cells stacked beneath, the weekday restored as a label. */
|
|
48
|
+
:host {
|
|
49
|
+
inline-size: 100%;
|
|
50
|
+
border-collapse: separate;
|
|
51
|
+
border-spacing: 0;
|
|
52
|
+
border: var(--thin-border-width) solid var(--color-border);
|
|
53
|
+
border-radius: var(--standard-border-radius);
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
margin-block: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host :is(th, td) {
|
|
59
|
+
border: 0;
|
|
60
|
+
border-block-start: var(--thin-border-width) solid var(--color-border);
|
|
61
|
+
padding: 0.7em 1em;
|
|
62
|
+
text-align: start;
|
|
63
|
+
vertical-align: top;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host thead th {
|
|
67
|
+
border-block-start: 0;
|
|
68
|
+
border-block-end: var(--border-width) solid var(--color-accent);
|
|
69
|
+
background-color: var(--color-surface);
|
|
70
|
+
font-weight: var(--font-weight--semi-bold);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host tbody th {
|
|
74
|
+
inline-size: 11em;
|
|
75
|
+
background-color: var(--color-surface);
|
|
76
|
+
font-weight: var(--font-weight);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host tbody td + td {
|
|
80
|
+
border-inline-start: var(--thin-border-width) solid var(--color-border);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host .week-title {
|
|
84
|
+
display: block;
|
|
85
|
+
font-weight: var(--font-weight--semi-bold);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host .week-of,
|
|
89
|
+
:host .date,
|
|
90
|
+
:host .empty,
|
|
91
|
+
:host .draft,
|
|
92
|
+
:host .notes {
|
|
93
|
+
color: var(--color-text-muted);
|
|
94
|
+
font-size: max(var(--base-font-size), 0.9em);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host .week-of {
|
|
98
|
+
display: block;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host td p {
|
|
102
|
+
margin: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host .deck-title {
|
|
106
|
+
margin-block-start: 0.15em;
|
|
107
|
+
font-size: max(var(--base-font-size), 1.05em);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:host .draft,
|
|
111
|
+
:host .notes {
|
|
112
|
+
margin-block-start: 0.25em;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@media screen and (width <= 640px) {
|
|
116
|
+
:host,
|
|
117
|
+
:host tbody,
|
|
118
|
+
:host tr,
|
|
119
|
+
:host th,
|
|
120
|
+
:host td {
|
|
121
|
+
display: block;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:host thead {
|
|
125
|
+
position: absolute;
|
|
126
|
+
inline-size: 1px;
|
|
127
|
+
block-size: 1px;
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
clip-path: inset(50%);
|
|
130
|
+
white-space: nowrap;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host tbody th {
|
|
134
|
+
inline-size: auto;
|
|
135
|
+
border-block-end: var(--border-width) solid var(--color-accent);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host tbody tr + tr th {
|
|
139
|
+
border-block-start: var(--thin-border-width) solid var(--color-border);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:host tbody td + td {
|
|
143
|
+
border-inline-start: 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
:host td::before {
|
|
147
|
+
content: attr(data-day);
|
|
148
|
+
display: block;
|
|
149
|
+
font-weight: var(--font-weight--semi-bold);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
</style>
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* The syllabus: outcomes, text, technology, coursework and grading, with a
|
|
4
|
+
* contents list of its parts: a row of links above the document on a narrow
|
|
5
|
+
* screen and, from 1100px, a sticky column beside it that marks the part on
|
|
6
|
+
* screen. Reads the `course`, `grading`, `scale`, `schedule` and `project`
|
|
7
|
+
* data. The list is built from the parts that render, so a part the course
|
|
8
|
+
* leaves out is not listed.
|
|
9
|
+
* @prop {'false'} [contents] `false` leaves the contents list out; shown otherwise. `"syllabusContents": false` in `course.json` does the same for every syllabus, and this prop wins over it
|
|
10
|
+
*/
|
|
11
|
+
const copy = $data.copy.syllabus;
|
|
12
|
+
/** The project's due date and time: "Thursday, December 3, 2026, 11:59PM". */
|
|
13
|
+
const projectWhen = (project) => (project.dueTime ? fill(copy.projectDue, { date: fullDate(project.due), time: timeOfDay(project.dueTime) }) : fullDate(project.due));
|
|
14
|
+
/** The parts that render, in page order, for the contents list: the same conditions as the articles below. Takes the page's data, which a setup script's own `$data` is not. */
|
|
15
|
+
const partsOf = (data) =>
|
|
16
|
+
[
|
|
17
|
+
{ id: "outcomes", label: copy.learningOutcomes },
|
|
18
|
+
data.course?.additionalOutcomes?.length && { id: "additional-outcomes", label: copy.additionalOutcomes },
|
|
19
|
+
{ id: "text", label: copy.text },
|
|
20
|
+
{ id: "technology", label: copy.technology },
|
|
21
|
+
data.grading && { id: "coursework", label: copy.coursework },
|
|
22
|
+
data.grading && { id: "grading", label: copy.grading },
|
|
23
|
+
data.term?.keyDates?.length && { id: "key-dates", label: copy.keyDates },
|
|
24
|
+
].filter(Boolean);
|
|
25
|
+
/** The prop wins over the course's `syllabusContents`; anything but `false` shows the list. */
|
|
26
|
+
const showContents = (data, prop) => (prop === undefined ? data.course?.syllabusContents !== false : prop !== false && prop !== "false");
|
|
27
|
+
const escape = (text) => String(text).replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
28
|
+
/** "Full requirements, milestone dates, and the grading rubric are on the project page." with the link in place. */
|
|
29
|
+
const projectPage = (project) => fill(copy.projectPage, { link: `<a href="${escape(project?.url ?? "/projects/final/")}">${escape(copy.projectPageLink)}</a>` });
|
|
30
|
+
</script>
|
|
31
|
+
<section id="syllabus" aria-labelledby="syllabus-heading" webc:root="override">
|
|
32
|
+
<h2 id="syllabus-heading" @text="copy.syllabus"></h2>
|
|
33
|
+
|
|
34
|
+
<nav class="syllabus-contents screen-only" aria-labelledby="syllabus-contents-label" :style="`--parts: ${partsOf($data).length}`" webc:if="showContents($data, typeof contents === 'undefined' ? undefined : contents)">
|
|
35
|
+
<p class="rail-label" id="syllabus-contents-label" @text="$data.copy.document.contents"></p>
|
|
36
|
+
<ol role="list">
|
|
37
|
+
<li webc:for="part of partsOf($data)"><a :href="`#${part.id}`" @text="part.label"></a></li>
|
|
38
|
+
</ol>
|
|
39
|
+
</nav>
|
|
40
|
+
|
|
41
|
+
<article>
|
|
42
|
+
<h3 id="outcomes" @text="copy.learningOutcomes"></h3>
|
|
43
|
+
<p @text="copy.uponCompletingThisCourse"></p>
|
|
44
|
+
<ul>
|
|
45
|
+
<li webc:for="outcome of $data.course?.outcomes" @text="outcome"></li>
|
|
46
|
+
</ul>
|
|
47
|
+
</article>
|
|
48
|
+
|
|
49
|
+
<article webc:if="$data.course?.additionalOutcomes?.length">
|
|
50
|
+
<h3 id="additional-outcomes" @text="copy.additionalOutcomesInThis"></h3>
|
|
51
|
+
<ul>
|
|
52
|
+
<li webc:for="outcome of $data.course?.additionalOutcomes" @text="outcome"></li>
|
|
53
|
+
</ul>
|
|
54
|
+
</article>
|
|
55
|
+
|
|
56
|
+
<article>
|
|
57
|
+
<h3 id="text" @text="copy.text"></h3>
|
|
58
|
+
<p webc:if="!$data.course?.textbook?.required" @text="copy.noTextIsRequired"></p>
|
|
59
|
+
<p webc:if="$data.course?.textbook?.required"><strong @text="copy.required"></strong> <span @text="$data.course?.textbook.required"></span></p>
|
|
60
|
+
<ol webc:if="$data.course?.textbook?.access?.length">
|
|
61
|
+
<li webc:for="step of $data.course?.textbook.access" @raw="step"></li>
|
|
62
|
+
</ol>
|
|
63
|
+
</article>
|
|
64
|
+
|
|
65
|
+
<article>
|
|
66
|
+
<h3 id="technology" @text="copy.technology"></h3>
|
|
67
|
+
<p><span @text="fill(copy.bringALaptopMeeting, { institution: $data.site.institution || copy.theCollege })"></span> <span webc:for="req of $data.course?.requirements ?? []" @text="req"></span> <span webc:if="$data.grading?.homework" @text="fill(copy.accessIsRequired, { lms: $data.site.lms })"></span></p>
|
|
68
|
+
</article>
|
|
69
|
+
|
|
70
|
+
<article webc:if="$data.grading">
|
|
71
|
+
<h3 id="coursework" @text="copy.coursework"></h3>
|
|
72
|
+
<div class="course-item" webc:for="entry of Object.entries($data.grading).filter(([key]) => key !== '$schema')">
|
|
73
|
+
<h4><span @text="entry[1].title"></span> <span class="weight screen-only" webc:if="entry[1].weight" @text="entry[1].weight"></span></h4>
|
|
74
|
+
<p @text="expandTokens(entry[1].body, $data)"></p>
|
|
75
|
+
<template webc:nokeep webc:if="entry[0] === 'final' && $data.schedule?.finalExam">
|
|
76
|
+
<p><strong @text="copy.exam"></strong> <span @text="examSlot($data.schedule.finalExam)"></span></p>
|
|
77
|
+
<callout :type="'warn'" webc:if="$data.schedule.finalExam?.note">
|
|
78
|
+
<p @text="$data.schedule.finalExam.note"></p>
|
|
79
|
+
</callout>
|
|
80
|
+
</template>
|
|
81
|
+
<template webc:nokeep webc:if="entry[0] === 'project'">
|
|
82
|
+
<p>
|
|
83
|
+
<strong @text="copy.due"></strong>
|
|
84
|
+
<span webc:if="$data.project?.due" @text="`${projectWhen($data.project)}.`"></span><span webc:if="!$data.project?.due" @text="`${fill(copy.atTheLastClassMeeting, { lastMeeting: lastMeeting($data.lessons) })}.`"></span>
|
|
85
|
+
</p>
|
|
86
|
+
<p @raw="projectPage($data.project)"></p>
|
|
87
|
+
<ul class="print-only" webc:if="$data.projectStages">
|
|
88
|
+
<li webc:for="stage of $data.projectStages.components">
|
|
89
|
+
<strong @text="stage.name"></strong> — <span @text="fill(copy.points, { display: stage.display, points: stage.points })"></span>
|
|
90
|
+
</li>
|
|
91
|
+
</ul>
|
|
92
|
+
</template>
|
|
93
|
+
</div>
|
|
94
|
+
</article>
|
|
95
|
+
|
|
96
|
+
<article webc:if="$data.grading">
|
|
97
|
+
<h3 id="grading" @text="copy.grading"></h3>
|
|
98
|
+
<grading></grading>
|
|
99
|
+
</article>
|
|
100
|
+
|
|
101
|
+
<article webc:if="$data.term.keyDates?.length">
|
|
102
|
+
<h3 id="key-dates" @text="copy.keyDates"></h3>
|
|
103
|
+
<ul>
|
|
104
|
+
<li webc:for="item of $data.term.keyDates"><strong @text="item.label"></strong><span class="print-only"> — </span><span @text="item.display"></span></li>
|
|
105
|
+
<li webc:if="$data.schedule?.finalExam"><strong @text="copy.thisSectionsFinalExam"></strong><span class="print-only"> — </span><span @text="examSlot($data.schedule.finalExam)"></span></li>
|
|
106
|
+
</ul>
|
|
107
|
+
</article>
|
|
108
|
+
</section>
|
|
109
|
+
|
|
110
|
+
<style>
|
|
111
|
+
#syllabus article {
|
|
112
|
+
border: none;
|
|
113
|
+
border-radius: 0;
|
|
114
|
+
padding: 0;
|
|
115
|
+
margin-block-end: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* Screen layout only: a single stacked column with a reading measure,
|
|
119
|
+
coursework as a card grid with the weight on each card, and key dates
|
|
120
|
+
as a stacked list. print.css keeps its own hooks (`#syllabus > article`,
|
|
121
|
+
`#coursework ~ div`, `#grading`, `#key-dates`), none of which this
|
|
122
|
+
markup changes. */
|
|
123
|
+
@media screen {
|
|
124
|
+
/* The section's row-gap is the only vertical rhythm between
|
|
125
|
+
articles: each article's first heading and last block drop their
|
|
126
|
+
own outer margins so nothing stacks on top of the gap. */
|
|
127
|
+
#syllabus {
|
|
128
|
+
display: grid;
|
|
129
|
+
row-gap: var(--section-space);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
#syllabus > h2 {
|
|
133
|
+
margin-block-end: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
#syllabus > article > :first-child {
|
|
137
|
+
margin-block-start: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
#syllabus > article > :last-child {
|
|
141
|
+
margin-block-end: 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
#syllabus > article > :where(p, ul, ol) {
|
|
145
|
+
max-inline-size: 70ch;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* Cards wrap as a centered flex row rather than a grid, so a short
|
|
149
|
+
last row (two cards under three) is centered instead of hugging
|
|
150
|
+
the left; each card is capped at a third of the row so the
|
|
151
|
+
widths still match across rows. */
|
|
152
|
+
#syllabus article:has(> #coursework) {
|
|
153
|
+
display: flex;
|
|
154
|
+
flex-wrap: wrap;
|
|
155
|
+
justify-content: center;
|
|
156
|
+
gap: var(--content-space);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
#coursework {
|
|
160
|
+
flex: 1 0 100%;
|
|
161
|
+
margin-block-end: 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
#coursework ~ .course-item {
|
|
165
|
+
flex: 1 1 20em;
|
|
166
|
+
max-inline-size: calc((100% - 2 * var(--content-space)) / 3);
|
|
167
|
+
|
|
168
|
+
@media (width <= 60em) {
|
|
169
|
+
max-inline-size: none;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
#coursework ~ .course-item {
|
|
174
|
+
box-sizing: border-box;
|
|
175
|
+
display: flex;
|
|
176
|
+
flex-direction: column;
|
|
177
|
+
padding: calc(var(--content-space) * 1.1);
|
|
178
|
+
border: var(--thin-border-width) solid var(--color-border);
|
|
179
|
+
border-radius: var(--standard-border-radius);
|
|
180
|
+
|
|
181
|
+
h4 {
|
|
182
|
+
display: flex;
|
|
183
|
+
flex-wrap: wrap;
|
|
184
|
+
align-items: baseline;
|
|
185
|
+
justify-content: space-between;
|
|
186
|
+
gap: 0.25em 0.75em;
|
|
187
|
+
margin-block: 0 0.5em;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* Flex items do not collapse margins, so paragraphs keep only
|
|
191
|
+
their bottom margin. */
|
|
192
|
+
> p {
|
|
193
|
+
margin-block-start: 0;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
p:last-child {
|
|
197
|
+
margin-block-end: 0;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* A callout sits at the foot of its card, so the cards in a
|
|
201
|
+
row line up. */
|
|
202
|
+
.callout {
|
|
203
|
+
margin-block: auto 0;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
#coursework ~ .course-item .weight {
|
|
208
|
+
flex: none;
|
|
209
|
+
padding: 0.1em 0.6em;
|
|
210
|
+
border-radius: var(--pill-border-radius);
|
|
211
|
+
background-color: var(--color-surface-accent);
|
|
212
|
+
color: var(--color-accent-text);
|
|
213
|
+
font-size: var(--font-size-6);
|
|
214
|
+
font-weight: var(--font-weight--semi-bold);
|
|
215
|
+
letter-spacing: 0.03em;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* The contents list: the document layout's rail (`.rail-label`, and
|
|
219
|
+
base.css's `.syllabus-contents` rules for the line, the links and
|
|
220
|
+
the current part) as a row of links above the syllabus on a narrow
|
|
221
|
+
screen, and a sticky column beside it from 1100px. The current part
|
|
222
|
+
changes color and the edge beside it, never the type's weight or
|
|
223
|
+
size, so the list does not move when the script marks a part. */
|
|
224
|
+
#syllabus > .syllabus-contents {
|
|
225
|
+
padding: 0;
|
|
226
|
+
font-size: max(var(--base-font-size), 0.95em);
|
|
227
|
+
|
|
228
|
+
> .rail-label {
|
|
229
|
+
margin-block-end: 0.25em;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
> ol {
|
|
233
|
+
display: flex;
|
|
234
|
+
flex-wrap: wrap;
|
|
235
|
+
gap: 0 1.25em;
|
|
236
|
+
border-inline-start: 0;
|
|
237
|
+
|
|
238
|
+
li a[href] {
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
box-sizing: border-box;
|
|
242
|
+
/* An operable target: 44px each way (WCAG 2.5.5). */
|
|
243
|
+
min-block-size: var(--target-min);
|
|
244
|
+
min-inline-size: var(--target-min);
|
|
245
|
+
margin-inline-start: 0;
|
|
246
|
+
padding: 0;
|
|
247
|
+
border-inline-start: 0;
|
|
248
|
+
border-block-end: var(--border-width) solid transparent;
|
|
249
|
+
|
|
250
|
+
&[aria-current] {
|
|
251
|
+
border-block-end-color: var(--color-accent-secondary);
|
|
252
|
+
font-weight: inherit;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
@media (width > 1100px) {
|
|
259
|
+
#syllabus:has(> .syllabus-contents) {
|
|
260
|
+
display: grid;
|
|
261
|
+
grid-template-columns: 13rem minmax(0, 1fr);
|
|
262
|
+
column-gap: calc(var(--section-space) * 1.5);
|
|
263
|
+
clear: both;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
#syllabus:has(> .syllabus-contents) > h2 {
|
|
267
|
+
grid-column: 1 / -1;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
#syllabus:has(> .syllabus-contents) > article {
|
|
271
|
+
grid-column: 2;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
#syllabus > .syllabus-contents {
|
|
275
|
+
grid-column: 1;
|
|
276
|
+
/* One row per part, so the column spans the document and sticks beside it. */
|
|
277
|
+
grid-row: 2 / span var(--parts);
|
|
278
|
+
align-self: start;
|
|
279
|
+
position: sticky;
|
|
280
|
+
inset-block-start: var(--content-space);
|
|
281
|
+
max-block-size: calc(100vb - var(--content-space) * 2);
|
|
282
|
+
overflow-y: auto;
|
|
283
|
+
|
|
284
|
+
> ol {
|
|
285
|
+
flex-direction: column;
|
|
286
|
+
border-inline-start: var(--border-width) solid var(--color-border);
|
|
287
|
+
|
|
288
|
+
li a[href] {
|
|
289
|
+
margin-inline-start: calc(var(--border-width) * -1);
|
|
290
|
+
padding-inline: 0.9em;
|
|
291
|
+
border-inline-start: var(--border-width) solid transparent;
|
|
292
|
+
border-block-end: 0;
|
|
293
|
+
|
|
294
|
+
&[aria-current] {
|
|
295
|
+
border-inline-start-color: var(--color-accent-secondary);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
@media (forced-colors: active) {
|
|
303
|
+
#syllabus > .syllabus-contents > ol li a[href][aria-current] {
|
|
304
|
+
border-color: Highlight;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
#key-dates + ul {
|
|
309
|
+
list-style: none;
|
|
310
|
+
margin: 0;
|
|
311
|
+
padding: 0;
|
|
312
|
+
|
|
313
|
+
li {
|
|
314
|
+
display: flex;
|
|
315
|
+
flex-wrap: wrap;
|
|
316
|
+
gap: 0 0.75em;
|
|
317
|
+
padding-block: 0.4em;
|
|
318
|
+
border-block-start: var(--thin-border-width) solid var(--color-border);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
li > strong {
|
|
322
|
+
flex: 0 1 22em;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
li > span:last-child {
|
|
326
|
+
color: var(--color-text-muted);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
</style>
|
|
331
|
+
|
|
332
|
+
<script>
|
|
333
|
+
/**
|
|
334
|
+
* Marks the syllabus part on screen in the contents list with
|
|
335
|
+
* `aria-current="location"` as the page scrolls. The list is built when the
|
|
336
|
+
* page renders; this only moves the mark, so nothing shifts. With no list,
|
|
337
|
+
* or with it hidden, it does nothing.
|
|
338
|
+
*/
|
|
339
|
+
(() => {
|
|
340
|
+
const rail = document.querySelector("#syllabus > .syllabus-contents");
|
|
341
|
+
if (!rail || !rail.getClientRects().length) return;
|
|
342
|
+
const links = [...rail.querySelectorAll("a[href^='#']")];
|
|
343
|
+
const parts = links.map((link) => document.getElementById(link.hash.slice(1)));
|
|
344
|
+
if (parts.some((part) => !part)) return;
|
|
345
|
+
const section = rail.closest("#syllabus");
|
|
346
|
+
const mark = () => {
|
|
347
|
+
const line = window.innerHeight * 0.3;
|
|
348
|
+
const end = section.getBoundingClientRect().bottom;
|
|
349
|
+
// A page scrolled to its foot can leave the last part below the line: then it is the one on screen.
|
|
350
|
+
const bottomed = window.scrollY + window.innerHeight >= document.documentElement.scrollHeight - 2 && end <= window.innerHeight + 2;
|
|
351
|
+
// Nothing is marked before the first part reaches the line, or once the syllabus has scrolled past it.
|
|
352
|
+
const inside = (parts[0].getBoundingClientRect().top <= line || bottomed) && end > line;
|
|
353
|
+
const current = !inside ? null : bottomed ? parts.at(-1) : parts.filter((part) => part.getBoundingClientRect().top <= line).at(-1);
|
|
354
|
+
for (const [index, link] of links.entries()) {
|
|
355
|
+
if (parts[index] === current) link.setAttribute("aria-current", "location");
|
|
356
|
+
else link.removeAttribute("aria-current");
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
let queued = false;
|
|
360
|
+
addEventListener("scroll", () => {
|
|
361
|
+
if (queued) return;
|
|
362
|
+
queued = true;
|
|
363
|
+
requestAnimationFrame(() => {
|
|
364
|
+
queued = false;
|
|
365
|
+
mark();
|
|
366
|
+
});
|
|
367
|
+
}, { passive: true });
|
|
368
|
+
mark();
|
|
369
|
+
})();
|
|
370
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* A link with a trailing arrow. The label is the slot; `href` and any
|
|
4
|
+
* other attribute pass through to the `<a>`.
|
|
5
|
+
*/
|
|
6
|
+
</script>
|
|
7
|
+
<a webc:root="override" class="arrow"><slot></slot> <span aria-hidden="true">→</span></a>
|
|
8
|
+
|
|
9
|
+
<style webc:scoped>
|
|
10
|
+
:host {
|
|
11
|
+
color: var(--color-accent-text);
|
|
12
|
+
text-decoration: none;
|
|
13
|
+
font-weight: var(--font-weight--medium);
|
|
14
|
+
|
|
15
|
+
&:is(:hover, :focus-visible) {
|
|
16
|
+
text-decoration: underline;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
</style>
|