Skip to content

feat(cli): props injection and batch rendering over the variables system#56

Merged
LeadcodeDev merged 1 commit into
mainfrom
feat/props-and-batch
Jul 18, 2026
Merged

feat(cli): props injection and batch rendering over the variables system#56
LeadcodeDev merged 1 commit into
mainfrom
feat/props-and-batch

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Closes #46.

Goal: unlock data-driven/personalized videos (Wrapped-style) — the typed $name variable system existed in core (variables.rs) with nothing feeding it.

  • --props file.json + repeatable --var key=value on render, still, validate; --var wins; values JSON-typed (--var n=42 stays a number). Unknown override against a declared config → error listing the declared set.
  • Loader _with_vars variants (existing APIs delegate with None); HTML dialect works via post-transpilation substitution — and since HTML has nowhere to declare config, overrides without a config block do raw substitution (accepted design decision, documented in the crate header; unused vars are silently unused, like exported-but-unreferenced env vars).
  • rustmotion batch: -f template.json --data data.jsonl --output-dir out/ --name-template "{id}.mp4" — full preflight (JSONL parse, name resolution, unknown vars) before any render, {index} always available, --jobs N cross-video parallelism, summary + non-zero exit on failure.
  • Housekeeping: declares the ffmpeg_integration feature that feat(encode): extract and mix embedded video audio #55's test referenced without declaring (clippy cfg warning on main).

Tests: 16 new (type-preserving overrides, HTML substitution, var parsing ×5, precedence, name templates ×5, batch integration ×2). 252 total, all green. Manual end-to-end: 2-row JSONL → Alice.mp4 + Bob.mp4

Verify: cargo test --workspace → 252 passed ✓ · cargo fmt --check ✓ · clippy 0 warnings ✓

The typed $name variable system existed in core with nothing feeding
it. Now:

- --props file.json and repeatable --var key=value on render, still
  and validate (--var wins; values JSON-parsed, else raw strings);
  unknown override with a config block errors naming the declared set
- loader gains _with_vars variants (existing signatures delegate);
  the HTML path substitutes post-transpilation, and scenarios without
  a config block accept raw substitution (documented: HTML has no
  place to declare definitions; unused vars are silently ignored)
- new batch command: one render per JSONL row with {field}/{index}
  name templates, full preflight before any render, --jobs N video
  parallelism, non-zero exit on any failure
- declares the ffmpeg_integration feature left undeclared by #55
@LeadcodeDev
LeadcodeDev merged commit df55b70 into main Jul 18, 2026
@LeadcodeDev
LeadcodeDev deleted the feat/props-and-batch branch July 18, 2026 23:15
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.

feat(cli): props injection and batch rendering over the variables system

1 participant