forked from EduCraft/curriculum-project-hub
9927d38c18
ADR-0029 — nested outline manifest, supersedes ADR-0008's flat [[parts]]:
- cph-model: recursive loader over manifest.toml containers / element.toml
leaves; Lesson.parts (pure elements, DFS order) + Lesson.outline (elements
interleaved with section headings at their DFS-open position); rejects
ambiguous/incomplete folders and root-vs-container table misplacement
- cph-diag: new DiagCode::ManifestMalformed for carrier-document structure
errors (discharges an existing TODO)
- cph-typst: augmented manifest now serializes the outline (element/section
entries) instead of a flat parts array
- render/lib.typ: render-lesson renders section headings at their depth
- examples/TH-141 migrated to 5 nested section containers + 3 root segments,
byte-identical element order; smoke-verified via cph check/build + pdftotext
ADR-0030 — batch & combined export, extends ADR-0009/0011:
- cph build with no --target batches every declared target (repeatable
--target for an explicit subset); any target failure => non-zero exit,
per-target ledger, independent per-target execution
- cph-model: bundle.toml loader (directory + [info]/[targets.*]/ordered
lessons with per-lesson target overrides)
- cph-typst: augmented bundle manifest (path-prefixed member outlines),
Engine::{compile_check_bundle,build_bundle_pdf}
- render/lib.typ: render-bundle assembles member lessons under per-lesson
headings, depth-shifts their own section headings, resets example/lemma
counters at each lesson boundary by default
- cph-cli: `cph bundle <path> --target <name>` subcommand, same batching
contract as `cph build`
- new bundle fixtures/tests (cph-model unit + cph-typst through-template PDF
compile), smoke-verified via a real 2-lesson merged PDF
Verification: cargo fmt/clippy/test clean across the workspace (68 tests);
real cph check/build/bundle runs against TH-141 and a bundle fixture, PDF
content inspected via pdftotext.
85 lines
2.3 KiB
TOML
85 lines
2.3 KiB
TOML
# Throwaway smoke engineering file for the cph-render template round
|
|
# (ADR-0011, outline shape ADR-0029). Exercises all 4 kinds + a section heading
|
|
# + nested headings (per-level numbering) + an example with a `source` scalar
|
|
# and one without + a lemma with proof and one without.
|
|
#
|
|
# This file is compiled DIRECTLY via `typst compile --input manifest=/manifest.toml`
|
|
# (see README below), bypassing the Rust engine's augmented-manifest builder
|
|
# (`cph_typst::build_augmented_manifest`). So the `[[outline]]` shape here is
|
|
# hand-authored to already be what that builder would produce: an ordered array
|
|
# of `type = "element"` (kind, path, fields — the content fields present on
|
|
# disk, since typst has no file-exists primitive) and `type = "section"`
|
|
# (kind, title, depth) entries.
|
|
|
|
[project]
|
|
id = "smoke-eng"
|
|
name = "cph-render template smoke"
|
|
|
|
[info]
|
|
title = "向量与几何 · 示例讲义"
|
|
author = ["张老师", "李老师"]
|
|
|
|
# segment — exercises per-level numbering (一、 / 1.1 / 1.1.1) alongside the
|
|
# section heading below.
|
|
[[outline]]
|
|
type = "element"
|
|
kind = "segment"
|
|
path = "segments/向量数量积"
|
|
fields = ["textbook"]
|
|
|
|
# A section heading (ADR-0029): opens depth-1, groups the two examples that
|
|
# follow. Contributes no element to the sequence.
|
|
[[outline]]
|
|
type = "section"
|
|
kind = "section"
|
|
title = "数量积的坐标计算"
|
|
depth = 1
|
|
path = "examples"
|
|
|
|
# example WITH source scalar
|
|
[[outline]]
|
|
type = "element"
|
|
kind = "example"
|
|
path = "examples/坐标数量积"
|
|
fields = ["problem", "solution"]
|
|
|
|
# example WITHOUT source scalar
|
|
[[outline]]
|
|
type = "element"
|
|
kind = "example"
|
|
path = "examples/求模长"
|
|
fields = ["problem", "solution"]
|
|
|
|
# lemma WITH proof (proof.typ present on disk; declared in fields)
|
|
[[outline]]
|
|
type = "element"
|
|
kind = "lemma"
|
|
path = "lemmas/柯西不等式"
|
|
fields = ["stmt", "proof"]
|
|
|
|
# lemma WITHOUT proof (proof.typ absent; fields omits it)
|
|
[[outline]]
|
|
type = "element"
|
|
kind = "lemma"
|
|
path = "lemmas/垂直判据"
|
|
fields = ["stmt"]
|
|
|
|
# sop
|
|
[[outline]]
|
|
type = "element"
|
|
kind = "sop"
|
|
path = "sops/求夹角步骤"
|
|
fields = ["sop"]
|
|
|
|
[targets.student]
|
|
artifact = "single-file"
|
|
[[targets.student.steps]]
|
|
type = "typst-compile"
|
|
template = "exports/student.typ"
|
|
|
|
[targets.teacher]
|
|
artifact = "single-file"
|
|
[[targets.teacher.steps]]
|
|
type = "typst-compile"
|
|
template = "exports/teacher.typ"
|