test(examples): TH-141 to template model — exports/*.typ + manifest v2 (WU-E')

Acceptance fixture for ADR-0011's template build model. TH-141 gains
exports/student.typ + exports/teacher.typ (the framework default templates,
copied from render/templates/ — these should be auto-seeded at project creation,
out of scope this round). manifest.toml [targets.*] converted to v2: artifact =
{type="single-file", filepath} + a typst-compile step naming the template;
numbering removed (it now lives in the template).

Verified end-to-end through the new path (template compiled as main + augmented
manifest, no generated driver): `cph check` → 0 errors/0 warnings; `cph build`
student → 9pp PDF, teacher → 12pp PDF; numbering correct (一、 / 2.1 / 2.2, zero
"二、一"); real content rendered.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-22 10:06:31 +08:00
parent d76f9f9a54
commit cadf8ad0d3
3 changed files with 155 additions and 10 deletions
+14 -10
View File
@@ -162,16 +162,20 @@ path = "segments/各模型对水的预测对照"
kind = "segment"
path = "segments/算不准背后的真实物理"
# Export targets (ADR-0009): each is a build producing a typed artifact, with
# file-resident presentation config that overrides the framework defaults.
# Heading numbering is given explicitly per level (level-1 一、, level-2 1.1,
# level-3 1.1.1) — overriding the render package's default via the in-file path.
# Export targets (ADR-0009/0011): each target is a build producing a typed
# artifact, run as an ordered list of typed steps. A `typst-compile` step names a
# real template file under `exports/` — the framework compiles it as the main
# file with the manifest injected, and the template reads the manifest and renders
# the lesson. Presentation (heading numbering, styling) lives in the template
# file, NOT here (ADR-0011 moved it off the manifest).
[targets.student]
artifact = "single-file"
[targets.student.numbering]
heading = ["{1:一}、", "{1:1}.{2:1}", "{1:1}.{2:1}.{3:1}"]
artifact = { type = "single-file", filepath = "build/student.pdf" }
[[targets.student.steps]]
type = "typst-compile"
template = "exports/student.typ"
[targets.teacher]
artifact = "single-file"
[targets.teacher.numbering]
heading = ["{1:一}、", "{1:1}.{2:1}", "{1:1}.{2:1}.{3:1}"]
artifact = { type = "single-file", filepath = "build/teacher.pdf" }
[[targets.teacher.steps]]
type = "typst-compile"
template = "exports/teacher.typ"