forked from bai/curriculum-project-hub
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:
@@ -0,0 +1,14 @@
|
||||
// Smoke test — exercises the per-target presentation `config` override path
|
||||
// (ADR-0009). Here the engineering-file-supplied `config.numbering.heading`
|
||||
// overrides the framework-default heading numbering. The patterns happen to
|
||||
// match the correct per-level scheme (level-1 `一、`, level-2 `1.1`), proving
|
||||
// the override is wired AND yields correct (NOT `二、一、`) output.
|
||||
#import "../lib.typ": display
|
||||
#import "smoke-parts.typ": info, parts
|
||||
|
||||
#display(
|
||||
info: info,
|
||||
target: "teacher",
|
||||
parts: parts,
|
||||
config: (numbering: (heading: ("{1:一}、", "{1:1}.{2:1}"))),
|
||||
)
|
||||
@@ -8,13 +8,26 @@
|
||||
)
|
||||
|
||||
#let parts = (
|
||||
// segment
|
||||
// segment — with NESTED headings so per-level numbering is visible:
|
||||
// level-1 `=` should render `一、`, level-2 `==` should render `1.1`
|
||||
// (NOT the old buggy `二、一、`).
|
||||
(
|
||||
kind: "segment",
|
||||
textbook: [
|
||||
= 平面向量的数量积
|
||||
|
||||
本节研究平面向量的基本运算。设 $arrow(a)$、$arrow(b)$ 为平面内两个向量,
|
||||
其数量积定义为 $arrow(a) dot arrow(b) = |arrow(a)| |arrow(b)| cos theta$,
|
||||
其中 $theta$ 为两向量的夹角。
|
||||
|
||||
== 坐标表示
|
||||
|
||||
在直角坐标系下,若 $arrow(a) = (x_1, y_1)$、$arrow(b) = (x_2, y_2)$,则
|
||||
$arrow(a) dot arrow(b) = x_1 x_2 + y_1 y_2$。
|
||||
|
||||
== 几何意义
|
||||
|
||||
数量积等于一个向量的模与另一向量在其方向上投影之积。
|
||||
],
|
||||
),
|
||||
// example WITH source
|
||||
|
||||
Reference in New Issue
Block a user