feat(generator): slide markdown image refs as labeled multimodal inputs #25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Slide authors need to embed images directly in slide markdown and attach intent to each one. Parsing
references from the slide file, assigning stable labels, and mapping surrounding prose to per-image instructions lets the generator act precisely on each image rather than treating all visual context as equivalent. Depends on hero_lib#128 (ImageRef abstraction).Goals
.md:,[](link), bare image URLs on their own line[IMAGE 1: "alt text"]) that survives prompt assemblyImageRefand attach toImageGenerationRequest(hero_lib#128)generator.rsFeasibility
Medium complexity, but with a significant cleanup component that the implementation must include — not defer.
The base64 round-trip in hero_slides exists purely as a transport mechanism:
discovery.rsreads image files, resizes and PNG-encodes them, then base64-encodes the result intoVec<(String, String)>.generator.rs:133-138immediately decodes that base64 back to bytes to pass toadd_image_data(). WithImageRef::Path, the discovery functions return file paths directly — no encode/decode needed.Code to remove as part of this issue:
discovery::image_file_to_png_base64()— fully superseded byimage_ioin hero_libgenerator.rs:133-138base64crate dep fromhero_slides_lib/Cargo.tomlSignature cascade — the following all change return type from
Vec<(String, String)>toVec<ImageRef>, requiring updates at every call site:collect_background_images(),collect_selected_background_images(),collect_selected_background_images_with_meta()indiscovery.rsgenerate_slide()parameterbackground_images: &[(String, String)]agent.rs:1004,deck_module.rs(3 sites)The markdown image-ref parsing work is self-contained and testable in isolation. Main risk remains prompt labeling — plan for iteration on the multi-image prompt format.