Skip to content

feat(web-video-presentation): optional slides.ts + slide-data.json export - #29

Open
dy2651 wants to merge 1 commit into
ConardLi:mainfrom
dy2651:feat/web-video-slide-export
Open

feat(web-video-presentation): optional slides.ts + slide-data.json export#29
dy2651 wants to merge 1 commit into
ConardLi:mainfrom
dy2651:feat/web-video-slide-export

Conversation

@dy2651

@dy2651 dy2651 commented Aug 1, 2026

Copy link
Copy Markdown

Summary

Add an optional slides.ts data layer to the web-video-presentation skill and a slide-data.json export, so presentations can be consumed/edited by a generic web viewer/editor (not just the React recording project).

What changed

  • templates/src/registry/types.ts: new SlideStepType (14 named types + custom), SlideStepMeta (loose string | string[] field bag), ChapterSlidesSegment, SlideDataExport; ChapterDef.slides? optional field with length-lock docs.
  • templates/src/chapters/01-example/slides.ts (new): example slides declaration (hero/fact/highlight) matching the existing example narrations.
  • templates/scripts/export-slide-data.ts (new): reads each chapter's narrations.ts (required) + optional slides.ts, merges them into a single slide-data.json at project root. Drift guard: if slides.length !== narrations.length it throws.
  • templates/src/registry/slide-config.ts (new): top-level { title, subtitle } source.
  • templates/src/registry/chapters.ts: wire example chapter's slides + doc comments.
  • scripts/scaffold.sh: copy the new templates, add export-slide-data npm script, mention in completion notes.
  • SKILL.md / references/CHAPTER-CRAFT.md: document the slides.ts convention (length-lock, supported types, optional fallback).

Why optional / backward compatible

Chapters without slides.ts still export fine — the script auto-infers a coarse step type per narration (empty→transition, index 0→hero, numbers→study, question marks→question, short→highlight, else fact). So existing projects don't break; the real visual structure is only editable in a web editor when slides.ts is present.

Usage

cd presentation
npm run export-slide-data            # merge chapters + slides + narrations → slide-data.json
npm run export-slide-data -- --print # also print to stdout

Verified end-to-end: scaffold → add slides.ts → export → 3-step demo produces valid slide-data.json; missing-slides chapter auto-infers; length mismatch (4 vs 3) throws the drift-guard error.

…n export

- Add SlideStepType/SlideStepMeta to registry types (14 types + custom)
- Add per-chapter optional slides.ts (length locked to narrations.ts)
- Add export-slide-data.ts: merges chapters+slides+narrations -> slide-data.json
- Add slide-config.ts for top-level title/subtitle
- scaffold.sh copies new templates + adds export-slide-data npm script
- Auto-infers coarse step type when a chapter omits slides.ts (no breakage)
- Docs: SKILL.md + CHAPTER-CRAFT.md cover the slides.ts convention
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant