Files
sjfhsjfh 7e15cf34f6 feat(render): export templates + render-lesson entry; template owns include loop (WU-C', ADR-0011)
Replace the display(parts) entry (which a generated driver called) with the
template model: real editable templates (render/templates/{student,teacher}.typ,
the framework defaults copied into an engineering file's exports/) read the
manifest via toml(sys.inputs.manifest) and assemble parts themselves.

Key finding (drives the engine): a dynamic `include` inside a package resolves
against the PACKAGE root, never --root — so the include loop must live in the
TEMPLATE (which sits under --root): `include "/" + part.path + "/" + field +
".typ"` (root-relative absolute, runtime-computed — legal per ADR-0011's verified
fact). cph-render exposes render-lesson(info, target, parts, heading-numbering)
(content-in, never includes) + part-fields (kind→fields) + default-heading-numbering.
Numbering (numbly per-level) is set in the template, editable per engineering file.

Surfaced OPEN point closed by the engine (WU-D'): typst has no file-exists
primitive, so optional content (lemma proof) presence comes from a per-part
`fields` array the engine computes from disk. Manifest injected as root-relative
absolute (--input manifest=/...). numbly stays vendored/offline. display removed.

local-packages symlink (test-only @local resolution) gitignored — regenerable,
self-referential; the embedded engine mounts cph-render directly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 09:57:51 +08:00

19 lines
945 B
TOML

[package]
name = "cph-render"
version = "0.1.0"
entrypoint = "lib.typ"
compiler = "0.15.0"
authors = ["curriculum-project-hub"]
license = "MIT"
description = "Curriculum lesson render package: `render-lesson` entry over an ordered list of typed parts (segment/example/lemma/sop), called by export templates (ADR-0011), targeting student/teacher handouts."
# External @preview dependencies (resolved via the typst package registry):
# @preview/numbly:0.1.0 — per-level heading numbering (src/style.typ).
# numbly is dependency-free (pure typst). For network-free CI the package is
# VENDORED in-repo at:
# render/vendor/typst-packages/preview/numbly/0.1.0/
# mirroring the typst preview-cache layout
# ({cache}/typst/packages/preview/numbly/0.1.0/). Point typst's package cache /
# resolver at render/vendor/typst-packages (e.g. TYPST_PACKAGE_CACHE_PATH or the
# embedded World's preview dir) so `@preview/numbly:0.1.0` resolves offline.