CONSUME-AS-DATA-02: Read one section's prose two ways
What it demonstrates
Section titled “What it demonstrates”The same SectionView is reachable by camelCase key and by the exact .section(name) accessor.
Builds on: CONSUME-AS-DATA-01: Open the read() door for typed frontmatter
How it’s done
Section titled “How it’s done”A TypeScript program against the library API; inline comments show the resulting values and behavior.
const doc = c.read(src, { path: "notes/note.md" });
// Dual-key: dotted camelCase field...const a = doc.body.summary.text();// ...and the exact-heading accessor resolve the same SectionView.const b = doc.body.section("Summary").text();
console.log(a === b); // true — one view, two keysSurfaces exercised
Section titled “Surfaces exercised”Doc.body dual-key access (doc.body.summary and doc.body.section("Summary"))SectionView.text("prose")