kovetskiy / mark

Sync your markdown files with Confluence pages.
https://samizdat.dev
Other
972 stars 143 forks source link

Possibility to insert images keeping the original image size automatically in Confluence #445

Open cmeresse opened 1 month ago

cmeresse commented 1 month ago

Problem

I am generating images automatically from plantuml files. So I don't know their original size and it can vary overtime when the plantuml is modified.

Confluence resizes the image by default if no width is provided which make them appear a bit blurry or too small. I would like to display the images with their original size.

I have seen the following macro is possible:

<!-- Macro: \!\[.*\]\((.+)\)\<\!\-\- width=(.*) \-\-\>
     Template: ac:image
     Attachment: ${1}
     Width: ${2} -->
![Example](../images/example.png)<!-- width=300 -->

But that does not give the possibility to insert the image with Width:

Solution I'd like

I would like to be able to use the macro like this for instance (or any other appropriate solution):

<!-- Macro: \!\[.*\]\((.+)\)\<\!\-\- width=original \-\-\>
     Template: ac:image
     Attachment: ${1}
     Width: original -->
![Example](../images/example.png)<!-- width=original -->

And that mark would retrieve the original image width and insert it

Alternatives I've considered

I made different tries with "100%" or other css values but the result is not what I want.