docs(adr): cph 的 nested-manifest / batch-export 改号 0036/0037

上游 0029/0030 与本地 filelib 侧同号 ADR 相撞,cph 两份改到本地空闲号段,
代码锚点引用一并跟随。
This commit is contained in:
2026-08-06 00:51:33 +08:00
parent e878b46701
commit ecc92c9a87
27 changed files with 100 additions and 100 deletions
+8 -8
View File
@@ -2,7 +2,7 @@
//
// PUBLIC ENTRY: `render-lesson(info, target, outline, heading-numbering)`.
//
// MODEL (ADR-0011, outline shape per ADR-0029). A build compiles a *template
// MODEL (ADR-0011, outline shape per ADR-0036). A build compiles a *template
// file* (e.g. `exports/student.typ`) as the typst main, with the manifest
// injected via `--input manifest=<path>`. The template reads the manifest,
// loads each **element** entry's content, and calls `render-lesson` here.
@@ -25,7 +25,7 @@
// - an ELEMENT: `entry-type: "element"`, `kind` plus that kind's
// content/scalar fields. Content field VALUES are already-evaluated typst
// content (the template produced them via `include`).
// - a SECTION (ADR-0029): `entry-type: "section"`, `title` (heading text),
// - a SECTION (ADR-0036): `entry-type: "section"`, `title` (heading text),
// `depth` (1-based heading level). Contributes no element; it is a
// heading at its depth-first-open position in the outline.
//
@@ -109,14 +109,14 @@
}
}
/// Render one section-heading outline entry (ADR-0029): `entry.title` at
/// Render one section-heading outline entry (ADR-0036): `entry.title` at
/// `entry.depth` (1-based heading level).
#let _render-section(entry) = {
heading(level: entry.at("depth", default: 1))[#entry.at("title", default: "")]
}
/// Render one outline entry: an element dispatches on `kind` via
/// [`_render-part`]; a section (ADR-0029) renders its heading and contributes
/// [`_render-part`]; a section (ADR-0036) renders its heading and contributes
/// no element.
#let _render-entry(entry, flags) = {
if entry.at("entry-type", default: "element") == "section" {
@@ -132,7 +132,7 @@
/// Templates typically pass `manifest.at("info", default: (:))`.
/// - `target`: string. MVP: "student" | "teacher". Unknown => conservative.
/// Each template hardcodes its own target (student.typ => "student").
/// - `outline`: ordered array of outline-entry dicts (ADR-0029), ALREADY
/// - `outline`: ordered array of outline-entry dicts (ADR-0036), ALREADY
/// ASSEMBLED by the template (element content fields included,
/// scalars read; section entries carry `title`/`depth`). See file
/// header for the entry shapes.
@@ -183,7 +183,7 @@
entry
}
/// THE BUNDLE ENTRY POINT (ADR-0030) — called by a bundle target's template
/// THE BUNDLE ENTRY POINT (ADR-0037) — called by a bundle target's template
/// (`exports/<target>.typ` under a `bundle.toml` root) to assemble several
/// already-loaded lessons into one combined document.
///
@@ -195,14 +195,14 @@
/// bundle (ADR-0011 presentation-in-template stance; same knob as
/// `render-lesson`).
/// - `reset-counters`: whether `example`/`lemma` auto-counters reset at each
/// lesson boundary. **Default `true`** (ADR-0030's recommended default: a
/// lesson boundary. **Default `true`** (ADR-0037's recommended default: a
/// lesson's internal "例题3" means that lesson's 例题3, so cross-lesson
/// continuation would silently break author references). Pass `false` for
/// a genuine "全书连续编号" 合集.
///
/// Each lesson's own outline is rendered under a depth-1 heading naming that
/// lesson (`lesson.info.title`); the lesson's own section headings shift one
/// level deeper (ADR-0029's per-lesson depths are relative to that lesson, so
/// level deeper (ADR-0036's per-lesson depths are relative to that lesson, so
/// nesting under the lesson-title heading keeps the outline↔structure
/// correspondence meaningful in the combined document). `@label`/`@ref`
/// cross-references stay global across the whole compiled document (typst's