/-! # 富内容 element schema 的叶子可以是 content 类型:一段源文本,按 format 决定语义 (ADR-0006、ADR-0015)。 两种 format: - typst:一段 typst 源,求值后得到讲义/教案用的内容。 - markdown:一段 markdown + KaTeX 源,原样保留,不经 typst 求值(slides 大纲、 逐字稿口播)。直接用 markdown 写,公式一开始就是 KaTeX(`$…$`),绕开了 typst→markdown 的公式转换这个难题(ADR-0014)。 约束:typst 内容必须挂在一个虚拟路径上(原因见 ADR-0006 的考据)。markdown 内容 不经 typst 求值,但同样用虚拟路径定位,供 markdown 装配按序读取。 本模块只钉两条关系:富内容由一个虚拟路径定位、叶子带 format。typst 的 Content/Module 内部结构、JSON Schema 形状、format 怎么判别,都是实现细节,不进契约。 -/ namespace Spec.Courseware /-- 富内容在工程文件里的虚拟路径(ADR-0006)。落盘后是真实相对路径(ADR-0007), 这层不承诺,所以 opaque。 -/ opaque VPath : Type /-- 富内容的 format(ADR-0015)。 -/ inductive ContentFormat where /-- typst 源:求值后得到讲义/教案用的内容。 -/ | typst /-- markdown + KaTeX 源:原样保留,不经 typst 求值(slides、逐字稿)。 -/ | markdown /-- 对一段富内容的引用:它挂在一个虚拟路径上(ADR-0006),带一个 format(ADR-0015)。 不建模源文本,也不建模求值出的内容——那是实现的事;这里只钉"富内容由虚拟路径定位 + 带 format",作为 ElementData 里 content 叶子的语义锚点。 -/ structure RichContentRef where vpath : VPath format : ContentFormat end Spec.Courseware