I have a Markdown document with an image in a local folder/group.
I find the image is too large, so I open the image in Preview and resize it.
The preview of the Markdown doc still shows the image with its previous too large dimensions, it will not update! Even after switching Source/Preview it will not update!
The ONLY way to make it update seems to be to rename the image and then change the source code accordingly! However, if I change back to the old name, DevonThink appears to have cached the image so it will show the old too-large image before it was downscaled!
There must be a better way to make it “refresh” the preview so it respects the changed image! The refresh should be automatic, but I can live also with a manual refresh.
If I could do it in the MD doc (without full html code of course) it would be acceptable.
Ideally, I would want to scale down the image (perhaps even ALL images) a factor of 2, but there is no such thing in CSS as far as I know – only % relative containing box (i.e size of the column or div).
macOS development in Xcode has used a naming scheme where image filenames ending in @2x are rendered as high resolution images on retina displays. This is the same as a website image of say 200x200 px sized in html as:
Hoping that the browser (and DTs preview is just that) keeps an image at the exact pixel size you store it with might result in disappointment.
How the image appears depends very much on context (container, position, sizing). Your best bet is to use CSS to determine as many parameters as possible.
And keep in mind that MD is not HTML (nor is it meant to be). So trying to control all aspects of MD rendered as HTML is futile. If you need that, you’re better off with HTML.
What Apple does in Xcode, it’s neither here nor there – DT uses MultiMarkdown and is limited to its possibilities. You could try to abuse the image link by appending something like #small
and write CSS that works with that. No idea, if that would work or not here. Alternatively, you could abuse the alt or title parts of the image link in MD.
FYI: My alternative to MD is absolutely not HTML (or FrameMaker, or InDesign, or Pages or …) since I don’t use Devon to create documents to be published – I use it as a database of notes and documentation. So speed and convenience of editing is paramount, while at the same time being reasonably nice to read on macOS and iOS.
The alternative is to continue to use RTFD, which I have used for many many years and I have many hundreds of those. In RTFD, I can change the size of an image by double-clicking the image and change the DPI value. And I can add some annotation or draw a circle or something similar. Very simple and reasonably fast. That won’t work with MD of course, and there are no other ways to change the image, apart from resizing the pixel count, and then restart the whole DevonThink to refresh the preview! Or fiddling with tedious CSS hacks abusing Alt text etc for individual small images of different sizes copied from the net – that is not a realistic option for something that is intended as notes.
I have for some time experimented with MD since it does have many merits to create reasonably structured and consistent content with several formatting aspects automated by CSS (and it is at least somewhat WYSIWYG for the most basic primitive uses). I have fiddled considerably with CSS to make it nice and flexible for different kinds of uses for various notes. But images are definitely an obstacle! One can use a DIV tag with a class specification for certain uses, but it will be very tedious if it is overused.
I am not 100% sure I will totally switch to MD, but I have a few docs where I use it. The need to restart Devon just to refresh the preview is definitely a negative aspect. Another negative and annoying aspect is that the preview window (in side-by-side view) will not scroll automatically showing the part I am editing, and conversely, scrolling the preview will not scroll the source to make it easy to quickly make changes to what I see in the preview. But this is off-topic.