Allow the specification of alt-text on images when using CLI.#247
Allow the specification of alt-text on images when using CLI.#247PeterGrace wants to merge 2 commits intoatrium-rs:mainfrom
Conversation
|
Thank you for the pull-request! It is curious that I see that it also takes into account cases where the number of images does not match, such as For example, how about the following? let alt = match args.alt_text.get(idx).filter(|s| !s.is_empty()) {
...
}; |
| @@ -87,6 +87,9 @@ pub struct CreatePostArgs { | |||
| /// Images to embed | |||
| #[arg(short, long)] | |||
| pub(crate) images: Vec<PathBuf>, | |||
There was a problem hiding this comment.
It is OK to change this to image.
| images.push( | ||
| api::app::bsky::embed::images::ImageData { | ||
| alt: image | ||
| let alt= match args.alt_text.get(idx) { |
There was a problem hiding this comment.
I suggest adding .filter(|s| !s.is_empty()) or something like that, since an empty string will be assumed to be unspecified and the default filename will be used.
This PR adds the ability to specify alt-text on images to help give descriptive values to them. It is written so that the alt-text input is a one-to-one map of strings based on the image filename input.
Let me know what I need to do to help get this approved and merged! I'm not sure what level of documentation is required since I assume
bsky-cliis a proof-of-implementation tool, however it works just fine for me for what I need it to do so figured I'd improve it!