forked from EduCraft/curriculum-project-hub
c17af60bb0
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>
20 lines
438 B
Typst
20 lines
438 B
Typst
// sop: a "standard operating procedure" — a methods/steps block.
|
|
//
|
|
// Contract fields:
|
|
// content: `sop` (required)
|
|
// scalar: none
|
|
//
|
|
// Shown for all targets. Lightly boxed for visual separation; not numbered.
|
|
|
|
#import "common.typ": element-box, tag-line, hue-of
|
|
|
|
/// Render a sop part.
|
|
#let display-sop(part, show-sop: true) = {
|
|
if show-sop {
|
|
element-box(hue-of.sop, {
|
|
tag-line[方法]
|
|
part.sop
|
|
})
|
|
}
|
|
}
|