feat(cli): props injection and batch rendering over the variables system#56
Merged
Conversation
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
This was referenced Jul 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #46.
Goal: unlock data-driven/personalized videos (Wrapped-style) — the typed
$namevariable system existed in core (variables.rs) with nothing feeding it.--props file.json+ repeatable--var key=valueonrender,still,validate;--varwins; values JSON-typed (--var n=42stays a number). Unknown override against a declaredconfig→ error listing the declared set._with_varsvariants (existing APIs delegate withNone); HTML dialect works via post-transpilation substitution — and since HTML has nowhere to declareconfig, 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 Ncross-video parallelism, summary + non-zero exit on failure.ffmpeg_integrationfeature 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 ✓