Files
curriculum-project-hub/hub/curated-skills-plugin/skills/lesson-project/templates.md
T

1.3 KiB
Raw Blame History

cph 0.0.2 最小模板

manifest.toml

[project]
id = "local-<stable-id>"
name = "<项目名>"

[info]
title = "<讲义标题>"
author = "范式教育教研组"

[[parts]]
kind = "segment"
path = "segments/<名称>"

[targets.student]
artifact = { type = "single-file", filepath = "build/student.pdf" }
[[targets.student.steps]]
type = "typst-compile"
template = "exports/student.typ"

[targets.teacher]
artifact = { type = "single-file", filepath = "build/teacher.pdf" }
[[targets.teacher.steps]]
type = "typst-compile"
template = "exports/teacher.typ"

项目 id 必须稳定且只含安全字符;已有 id 不得改。.cph-version 内容固定为 0.0.2 加换行。

element.toml

kind = "segment"

将 kind 替换为对应类型。example 有明确来源时增加:

source = "<来源>"

内容文件直接写 Typst,不加旧版 #let 包装:segment 写 textbook.typlemma 写 stmt.typ/可选 proof.typexample 写 problem.typ/solution.typsop 写 sop.typ

exports 模板

不要凭记忆手写长模板。优先保留项目已有的 exports/student.typexports/teacher.typ。如果新项目缺失,先向用户说明需要当前 cph 0.0.2 标准模板;不要回退到旧版 main.typ 架构。