AsciidocFX icon indicating copy to clipboard operation
AsciidocFX copied to clipboard

Use imagesdir when pasting images

Open widle opened this issue 3 years ago • 2 comments
trafficstars

When pasting images from clipboard, it would be nice to look if the imagesdir attribute is set. If it is, the image should be placed in that directory and the link adjusted accordingly.

Alternatively, setting the pasting directory manually (somewhere in the settings) could work too.

Discussed in https://github.com/asciidocfx/AsciidocFX/discussions/564

Originally posted by widle September 22, 2022 Hello, I have a question about the feature that allows pasting an image from clipboard to the doc (#219). Is there a way to set up the target directory? It seems to automatically paste to /images and also appends images/ to the path pasted in the document, but that only works if the image directory is the default one (same as the doc). I'd like to set an imagesdir for my document and paste into that, but setting the attribute does not change the pasting behaviour.

I have found the setting to change the generated image name, but not the folder. Am I missing something, or is it not implemented?

widle avatar Sep 26 '22 09:09 widle

Hi, I implemented the feature. I hope it works as you expected. You can test it here https://github.com/asciidocfx/AsciidocFX/releases/tag/v1.8.4

rahmanusta avatar Jan 11 '23 15:01 rahmanusta

Hello and thank you. I am trying out the feature now and it's looking good, the image is pasted in the correct directory and displayed in the document.

I am wondering about the inserted path, though. It is relative to the document, as it was before, but I am thinking that maybe a path relative to the image directory (i. e. none) would make more sense here. So that the path doesn't need to be repeated with each image.

Both paths seem to work fine, it is just a matter of convenience. What do you think?

widle avatar Jan 12 '23 09:01 widle