Looking for a workflow for notes in markdown

Hi,

I am looking for a way to take notes with Devonthink as the backend. So far, I am struggling specifically with the cumbersome way of handling media and reference links.

What I would like to do is drag and drop an image from Firefox to my editor and have that embedded. Problem is, DT doesn’t seem to be able to this at all. And I am not sure how to do it, to be honest.

Example:

  • Create markdown note in DT
  • Write in markdown note
  • Search for image in Firefox
  • Save image in Firefox to disk (presumably Inbox)
  • Wait until DT has imported the image
  • Copy image to the same group as the note
  • Then… what? what url can i use? if i use the image link, the markdown image cannot be viewed in any other app. If i use a relative path, that doesn’t work either because of the way DT stores the data in the backend.

So, not only is importing cumbersome, also the referencing doesn’t seem to play nicely with other apps.

Hence I thought of using another editor alltogether, completely taking DT out of the workflow. Use something like Ulysses and iCloud. Problem is that i haven’t found a good editor that i can use on both ios and osx that is quick to use and where I can index the external folder on my disk with DT.

Anyone has a suggestion? Please? :wink:

1 Like

Put the Markdown file in its own group.
Add the files to the group or a subgroup.
Use links per this example…

To export files, drag and drop the group.

However, be aware other Markdown editors may not be using MultiMarkdown so differences in rendering can occur.

I might be misunderstanding something but isn’t that exactly what i described, which is a horrendous, time-consuming solution?
I wanna drag and drop the file into DT (~1sec) and not do all the stuff you mentioned which is probably close to 60x slower and requires manual file management on my disk.

I don’t want to ‘export’ anything from DT, I don’t want to use DT as I find the editor and preview worse than the competition on the market.

I also don’t think that any of the external editors can render your example as the image referencing is wrong (at least i cannot make it work)

1 Like

requires manual file management on my disk.

It does not require file management on the disk.

I don’t want to use DT as I find the editor and preview worse than the competition on the market.

Then I don’t understand why you’re asking the question.

It does not require file management on the disk.

how do you get the media from firefox into dt?

I am asking the question because I want to have the notes available in DT. It doesn’t seem that DT->Editor is a viable, cross-platform option though.

That would be a Firefox question.
There are plenty of reports of issues dragging and dropping from various versions of Firefox.
Dragging images from Safari into a database worked as expected.

Same problem. I don’t have dt active as such. I want to drag and drop into the markdown file and dt should handle the file Management.
That is not happening. I don’t see being able to drag from the browser to the inbox as useful. And dragging it into a specific group requires me to have the group active

I grappled with the problem of adding images to markdown documents in DT3, as it is very time intensive.

Eventully I settled on using Keyboard Maestro to create a macro. Not sure if you have any experience with Keyboard Maestro, but it can automate any repetitive tasks.

For instance, My macro does the following:

After I select a image file on the desktop, I trigger the macro. The macro then…

  • Gives a prompt to rename the file
  • Creates a subdirectory called img (just used for storing referenced images) in Devonthink where the selected markdown file resides.
  • drags the image file into the new img subdirectory
  • Makes a markdown link to the image and then copies it to the system clipboard.

The whole process takes maybe 4 or 5 seconds, and I can quickly paste the markdown picture link in the document.

That’s effectively what I have done as well. The problem are that I haven’t found an editor which works with the markdown images properly.
Do you use the dt editor on both osx and iOS? If not, how do you embed images that work with external editors?

Yes it is a bit of a trade-off.

What I have done on os x to see the images in an external editor is structured the markdown links according to the second example in the screenshot:

If I ever want to edit the document, I drag the markdown file and the subfolder containing images out of Devonthink into Finder, then edit the document in an external editor (kind of hacky).

Or you can index in Devonthink any folders containing markdown along with their image subdirectories, and the markdown pictures will render in an external editor.

Thanks for the explanation. I just tried it but I am not sure how this should work.

Ulysses at least cannot resolve the image if my path is “group/item.jpeg” but that is probably an Ulysses problem.
The other issue is that it doesn’t automatically update back to DT (fair enough, I guess). So now I am forced to copy the Markdown back to DT :confused:

The indexing route is what I tried but I couldn’t find a good setup (mostly because of the editors). Most editors that support drag/drop of images and the like seem to have their own database (Ulysses, Bear). Do you have one in mind for ios/osx? I don’t mind having my notes synced via icloud/dropbox on top of the DT sync

Yes, Ulysses only supports images from external image URLs unfortunately.

For Mac, there are a few Markdown editors you could use in an embedded folder. I use BBEdit (if you need fancy text manipulations it is awesome), as it has a Markdown Preview. Or you could use Marked (part of Setapp) for previewing only. I also have Multimarkdown Composer, all of which you can use with the “group/item.jpeg” path.

For Mac & iOS, if you keep the markdown files in the same directory as the images, you can use iA Writer.

Ulysses supports local images but only if you use their database :confused:
I just downloaded iA Writer, but it also doesn’t seem to support drag&drop of images or URLs.
Typora seems to have that feature. When you drag an image URL into typora, though you need to manually alter the filenames, so that’s a no-go. It automatically puts it into an asset folder though. Normal URLs are not getting converted into actual markdown links.

Amazing how difficult it is to find a half-decent markdown editor.

In principle, I suppose, it should be possible to write a DT script or trigger of sorts, which would parse the markdown file for links to image files and import any such files into a designated DTPO folder, also updating the link in the markdown accordingly. Possibly possible, that is, and non-trivial.

@macula thanks. After thinking about it some more, I am going to give up on the DT editor for note taking. It is just way too rubbish to bother with.

I am therefor looking for a 3rd party ios/osx editor that produces indexable files on disk. Media is the problem to be honest. The other option would be to use DT as the backend and always open files in another editor. This doesn’t seem to work reliably at all on ios though.

Hi Bosie.
Please let us (me) know, when you found a working solution.
Thank you in advance.

If read-only support on the iOS side would be enough for you, consider checking out Quiver: HappenApps — Quiver (there’s a link on the top for the iOS app). It’s ostensibly a programmer’s notebook, but I use it for lots of other kinds of notes, too. It’s especially good for technical content. “Notebooks” hold collections of “notes.” A note consists of cells, and each cell can hold either plain text, Markdown, code, LaTeX, or diagrams (sequence or flowchart). The diagram support is via a text description (like here: WebSequenceDiagrams - Draw UML sequence diagrams online in seconds). Images are handled via drag-and-drop, and get stored locally with the note (in Quiver’s database bundle).

The online docs are here: Home · HappenApps/Quiver Wiki · GitHub.

I haven’t tried the iOS reader app, but I’ve heavily and happily used Quiver for a few years now, synced across my Macs.

-Tom

PS: For macros for automatically grabbing links from a browser in Markdown format, I use Alfred’s “workflow” support.

A further postscript re: Quiver: I once had a sync problem, when I’d left Quiver open on one Mac, displaying a note that I subsequently edited on another Mac. When I returned to the first Mac, there was a sync issue and I had to quit and restart. The problem may have been that I started editing the old displayed content on that first Mac; I don’t recall. Quiver uses iCloud (or Dropbox or Google Drive) for syncing; this may not offer as sophisticated a sync solution as DTP uses. Since then, I’ve been careful to close Quiver when I’m done with it, and I’ve never had a problem. For all I know, Quiver’s sync may have been improved since then. Just worth keeping in mind.

hi, thanks for the reply. I know of quiver since i am a software dev myself. I do rely heavily on ios input though, read only is definitely not enough for me on ios devices.
I evaluated quiver specifically for software dev (thought i might use it on the side for code specific stuff) but IIRC images aren’t really supported? This was a while ago when it was first introduced, I am not sure if that is still the case.

When you drag the image into the markdown file, where do you want the image to live? I think perhaps in the same group as the markdown file or in a sub-group?

I did a little testing…

I notice that if I try to drag images using a chrome based browser I get a different experience than if I use firefox.

I created a test group in my inbox and added a new markdown note.

Using firefox I could drag an image, from the devontechnologies site, to the markdown note source.

It converted the image to the URL for the source of the image.
44

This is clearly not what you want. Using firefox I was unable to drag the image to the group.

Using Brave, a chrome based browser, I was able to drag the image to the group. I could then drag the image from the group to the markdown source. This inserted the link to the image in the group. I then had to alter the markdown note source to use the link as part of a markdown image.

As bluefrog said, this drag behavior seems to be browser dependent.

It is not too difficult or time consuming to, rather than drag the image, capture the URL from the image in the browser.

51

Then the URL is in the clipboard. Then it seems reasonable to be able to create some AppleScript or something to:

  • Read the clipboard for an image URL
  • Fetch the image into the current group (or perhaps a sub-group) using the URL from the clipboard/pasteboard.
  • Update the markdown document at the cursor to include a markdown style image link that links back to the image resource, just now loaded to the group.

The idea would be to use the URL from the clipboard to eliminate browser differences, and eliminate manual steps to get the result you want.

I do not know AppleScript so I do not know how difficult such a script would be.