feat: concatenate output and support base64 image encoding #57
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.
Summary
This PR introduces the ability to concatenate output from multiple files, including support for base64-encoded images. This enhancement improves the functionality of the
see
command when redirecting output to a file, especially for markdown documents with embedded images.Key Changes
render_image
function to support base64-encoded image data.ImageViewer
to visualize both file paths and base64 image data.Implementation Details
base64
crate as a new dependency.main.rs
, images are now encoded to base64 and output as markdown image tags when redirecting.render.rs
now includes logic to decode and render base64 image data.viewers.rs
has been updated to handle base64-encoded images in theImageViewer
.Impact
These changes allow users to:
Example Usage
see file1.md image.png file2.md > output.md
This command will now produce a single markdown file with the content of
file1.md
, the image embedded as a base64-encoded markdown image tag, and the content offile2.md
.