Beginner - Create notes with images

I just came across this tip – this is pretty much what I want, and what I think a lot of people want, when they say “can I have images in my markdown?”

In short, not only does it work in DT3, it works better than most other solutions I’ve seen to this (which e.g. dump images in the top-level with folders etc).

Kudos! (and keep the hits coming :grinning:)

1 Like

Ok one thing to note here is that when you move the note to another group/folder that you also have to take the asset folder with you.

Otherwise it will just refer to /Assets and then it will not work anymore.
Eg.

I started noting down during a meeting added screenshots. and the note resided in my inbox so now I move it to a proper group but then you need to take into account to also copy the assets folder!

I like DT but you have to be quite alert as a beginner to make sure it does what you have in your mind :-)!

You’re right of course, but that has nothing to do with DT: It is the concept of MD (and HTML for that matter). They use links to refer to images and other external data, and if you move those data, the links will break.

One of the problems seems to be with the expectations here: If I see the image in my rendered MD file (which again is HTML in general), than it must be “there”. But all that is there is a link which is rendered as an image.

There are, of course, file formats that permit to add images as such, i.e. not as a link (aka reference) but by embedding the image data directly into the file itself. Think Word, Pages, PDF. With them, the images will always be displayed correctly (provided that the software does not have bugs) and users do not even have a chance to move the images to another place inadvertedly. On the down side, files are a lot bigger because they include the image data itself and not only a reference to them.

Finally, you can achieve the same result with MD/HTML by using data URIs instead of normal links. That’s what DT’s “formatted notes” do, too. So you get huge files with the image data included. And in the case of MD, the resulting file will be not very nice to edit because of the data URIs.

As I said before: there’s no silver bullet.

1 Like

Use an app that is designed to embed images in the files? Pages, Word, etc. seems to work well for that.

Sure. With the drawback that the files are huge and that it is difficult to replace images. Having only links to images makes it easy to change them (though I guess that’s not what the OP wants). Also, Pages, Word etc. make it hard(er) to use semantic markup than MD/HTML and the like. And they’re binary formats (seemingly, under the hood at least Word/StarOffice use XML, too).

Like you said, “no silver bullet”. (I replace images by select, delete, paste).

Hi Jim, if I’ve read this right it’s awesome! So at the moment if I want to add an image to Markdown (I’ve been converted by DT into keeping notes in this format too :grimacing:), I save the image in the right DT group, and then I add it into my Markdown file. Currently I file the image in the group where the Markdown file is stored.

If I’ve read your advice correctly, if I just drag and drop an image into my Markdown file and I have that preference ticked, are you saying that DT will do the manual work of saving the image file and linking to it for me? The only difference between my process and the DT process seems to be that there is one centralised group for images in the database, is that right? I can live with that :joy:

(I use DT exclusively for editing Markdown files.)

1 Like

(I’ve been converted by DT into keeping notes in this format too :grimacing:

… (I use DT exclusively for editing Markdown files.)

Yayy!!! A convert!! :heart: :stuck_out_tongue:

If I’ve read your advice correctly, if I just drag and drop an image into my Markdown file and I have that preference ticked, are you saying that DT will do the manual work of saving the image file and linking to it for me?

Indeed, that is the case. An Assets group will be made in the location of the Markdown file, the file imported to it, and the proper image link inserted in the document.

The only difference between my process and the DT process seems to be that there is one centralised group for images in the database, is that right? I can live with that :joy:

Yes and that’s a philosophical choice, not a requirement. You can easily just link to files in the same group or elsewhere, but for some (and admittedly, I like this structure for my journaling), it fits how they think about data organization.

2 Likes

This is awesome, thanks for sharing this, I will do this going forwards :blush: The more I learn, the more I love DT!

You’re welcome and thanks for the nice feedback. We are kinda in love with DEVONthink too :heart: :blush:

I have set the Preferences accordingly, even using the defaults Assets. When I try to create a Markdown note in Global Inbox and drag an image in Global Inbox into the note. There is no Group created.

Anything else that I need to do?

But an image link is created in the Markdown document when you drop the image into the file, correct?

Yes, the image link is created.

After doing the necessary editing, I want to move the note and the images (or Group of images) to another database. But I cannot find the Group.

Exactly where are you looking?

The group name will be “Assets” and a subgroup to the group where the MD file is kept. For example, I have a group in a database called “Energy” and for when I save images, they go into Energy/Assets.

Not there for you? Check again that’s what you set in preferences, I guess.

As you can see from the screenshots, I simply checked the Import Images to group, and use the default Assets.

I drag & drop this image in a MarkDown note “Testing Import Images to Group”. Both the image and MD note are in Global Inbox. I expect after drag & drop the image in the MD note, a Group Assets will be created with the image move under the Group Assets.

But you can see from the screenshots, it is not.

I don’t have time now to test this for you. But try putting your MD in a database other than the Global Inbox.

1 Like

@cgrunenberg, et al:

This behavior occurs if your add an image in DEVONthink via drag and drop or copy and paste.
The Assets group is not created unless the file comes from outside DEVONthink.

The image is already in the database and therefore just linked.

Okay. That’s what I expected but wanted to make sure.

There you go, @TonyLim :slight_smile:

OK. Thanks for reply.

All my images are auto imported to Global Inbox. I rarely drag and drop or copy and paste from outside DT. Thus, this Group feature is not really useful/applicable to me.

Another question, comparing this image link (correct term?) and item link (x-devonthink-item), can I say that the item link is more flexible/portable?

For item link, even if the image is not in the same database, the image will still appear in the Markdown preview. For the image link, if the image is not in the same database/location, the image will be a broken link in the Markdown preview.

In addition, the item link is clickable. I can jump to the item/image easily for future maintenance, say to delete the image is it is no longer needed.