forked from EduCraft/curriculum-project-hub
feat(render): rebuild typst render package cph-render (WU-2)
Single entry `display(info, target, parts)` over an ordered parts array, the frozen contract the generated typst driver calls. Per-kind dispatch for segment/example/lemma/sop; student/teacher matrix derived internally from `target` (student hides example solution + lemma proof; teacher shows all). Content-field values are consumed as already-evaluated content (driver `include`s them ⇒ module body, ADR-0006), never imported/stringified. Optional fields (lemma proof, example source) handled gracefully; unknown kind/target degrade without crashing. Zero @preview deps (CI-robust); CJK + math styled. Smoke compiles to non-empty student/teacher PDFs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// segment: a stretch of textbook prose.
|
||||
//
|
||||
// Contract fields:
|
||||
// content: `textbook` (required)
|
||||
// scalar: none
|
||||
//
|
||||
// Rendered identically for all targets (textbook is always public). Not boxed
|
||||
// or numbered — it is the connective body text of the lesson.
|
||||
|
||||
/// Render a segment part. `show-textbook` is always true in MVP but kept for
|
||||
/// symmetry with the other kinds' show/hide flags.
|
||||
#let display-segment(part, show-textbook: true) = {
|
||||
if show-textbook {
|
||||
part.textbook
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user