Creating Wikilinks in plain text documents

Devonthink supports wikilinks in both plain and rich text documents. With wikilinks set to automatic in preferences, I can create a wikilink in the usual way by typing the name of another DT document. I can also create the wikilink by dragging and dropping a document name into the target document while holding down Option-Command. However, this only works when the target is a rich text document. In a plain text document that action makes a copy of the source document into the target instead. Is there any reason why Option-Command should create a wikilink only if the target is rich text?

Only rich texts can store links whereas automatic WikiLinks are applied on-the-fly but not stored.

Thanks, but is there any reason why the behaviour couldn’t be made consistent? i.e. create an on-the-fly WikiLink following an Option-Command drag and drop into a plain text document. I find drag and drop by far the most convenient way of creating WikiLinks to other DT documents.

Seems like a reasonable expectation. I agree with @khw. It’s not the plumbing in the background that matters, it’s the usability.

Maybe you want to clarify what you mean by “link”: By definition, a plain text file cannot contain “links”, as in “a bunch of control sequences such as , or worse, hidden control sequences” (well, the file can contain them, but they should not lead to any actionable situation). Plain text files are the epitome of the KISS principle, and I don’t want to see that compromised. If I want structure in the document other than simple ASCII characters, I’ll make it a rich document.

I assume that what you want is simply copying the URL into the plain text file when dragging with cmd-opt? You could then later select that URL and use a contextual menu item to open that URL. That would be useful, and I would support that. But: These references would look hideous, because in the spirit of plain text, the actual file system path would have to display, not a freely choosable link-name as in a rich doc.

By the way, when I tried dragging the links, I did not find any “inconsistency” in the behaviour. The “cmd-opt” option simply seems not to be available when dragging into a plain file, i.e. when pressing cmd-opt, the cursor will not switch its shape to the alias-arrow.

The original post was about wikilinks as defined by Devonthink. If I have a document (of any type) with the name “Source Doc”, then with the wikilink functionality enabled I can type “Source Doc” into a different plain text document and it will underline the words Source Doc, and if I click on the underlined words it will switch me to the Source Doc. What I would like is for Devonthink to create that same wikilink if I drag-drop the Source Doc in to the plain text document while holding opt-cmd. That action creates a wikilink if the target is a rich text document, and for consistency I think it would make sense if it did likewise for plain text documents.

Christian’s post stated “WikiLinks are applied on-the-fly but not stored”. It doesn’t matter that the file is not rich text. What matters is that one could drag a file name onto a text file and DEVONthink makes a WikiLink “on-the-fly but not stored”. The rest of the techno-stuff about how links are made is irrelevant.

All that @khw asked for is a simple change to the UI to drag-in WikiLinks. Reasonable request, IMO.

Apologies: I missed the part specific to Wiki links. I had only used the “copy item link” mechanism before for plain text files, which puts the UID in. The generalization of the dragging mechanism is indeed straightforward. I completely agree that dragging is the preferable method whenever applicable. I now realize what Christian meant by “on the fly”.

A slightly related question: I’ve now played a little with these “on the fly” wiki links, and at least to me they look very fragile. Unless I’m again missing something, they depend 100% on the filename. Once you touch a filename, all wiki links will be destroyed for good. That’s almost the opposite of the usual behaviour in DT, where things are identified via their UID, which stays intact when renaming items.

Another thing that confuses me: There can be more than one file in a database (and even in the same group) with exactly the same filename. They will differ by their UID. How can DT resolve Wiki links “on the fly” in a consistent manner in such an environment ?

Related, would it be possible to create the “on the fly” wikilinks in markdown documents?

I have set it so that markdown documents are displayed formatted in Devonthink and the possibility to have wikilinks added automatically would indeed be very useful.

I would like to second @biquini. I understand Markdown provides its own syntax for links. Double-brackets doesn’t conflict with Markdown, or even multi-Markdown, as far as I know.