fix(render): per-level heading numbering via numbly; config-driven, offline (WU-C)

Fixes the numbering bug (single pattern "一、" reused across levels → level-2
rendered "二、一、…"). display now takes a `config` dict; heading numbering uses
numbly per level — framework default ("{1:一}、","{1:1}.{2:1}","{1:1}.{2:1}.{3:1}")
→ 一、 / 1.1 / 1.1.1 — overridable via config.numbering.heading from the
engineering file (ADR-0009's file-resident override path, the layer whose absence
caused the bug). Verified: grep "二、一" = 0 across all smoke PDFs.

Adds @preview/numbly:0.1.0 (pure typst, zero transitive deps), VENDORED in-repo
at render/vendor/typst-packages/preview/numbly/0.1.0/ for network-free CI;
resolve via --package-cache-path render/vendor/typst-packages. parts contract +
student/teacher field visibility unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-22 08:42:15 +08:00
parent b5bf9d60d1
commit 6f46aa708a
9 changed files with 187 additions and 10 deletions
+10
View File
@@ -6,3 +6,13 @@ compiler = "0.15.0"
authors = ["curriculum-project-hub"]
license = "MIT"
description = "Curriculum lesson render package: single `display` entry over an ordered list of typed parts (segment/example/lemma/sop), 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.