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

38 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# cph 0.0.2 工程结构
```text
<project>/
├── .cph-version # 固定写 0.0.2
├── manifest.toml
├── outline.md
├── exports/
│ ├── student.typ
│ └── teacher.typ
├── segments/<名称>/
│ ├── element.toml # kind = "segment"
│ └── textbook.typ
├── lemmas/<名称>/
│ ├── element.toml # kind = "lemma"
│ ├── stmt.typ
│ └── proof.typ # 可选
├── examples/<名称>/
│ ├── element.toml # kind = "example";可有 source = "..."
│ ├── problem.typ
│ └── solution.typ
├── sop/<名称>/
│ ├── element.toml # kind = "sop"
│ └── sop.typ
└── build/
```
`manifest.toml` 中的 `[[parts]]` 顺序就是最终讲义顺序。每项只写 `kind` 与相对 `path`;可选字段是否存在由 cph 在构建时解析。目录名与清单路径必须逐字一致。
当前字段契约:
- segment:必需 `textbook.typ`
- lemma:必需 `stmt.typ`,可选 `proof.typ`
- example:必需 `problem.typ``solution.typ``element.toml` 可写字符串 `source`
- sop:必需 `sop.typ`
章节标题没有独立 kind。需要在讲义中显示章节过渡时,创建一个 segment,并在 `textbook.typ` 中用 Typst 标题表达。