I did some more exploration on this front. The MultiMarkdown syntax used by DEVONthink defines a meaning for plain [something]
typed in a Markdown document. This is explained in the MMD user’s guide – here’s the example used:
In order to create valid [HTML], you need properly
coded syntax that can be cumbersome for
"non-programmers" to write. Sometimes, you just want
to easily make certain words **bold**, and certain
words *italicized* without having to remember the
syntax. Additionally, for example, creating lists:
* should be easy
* should not involve programming
[HTML]: http://en.wikipedia.org/wiki/HTML
This is just speculation on my part, but I think the reason that automatic wiki linking to names & aliases don’t work for a bare [something]
(which is what would be needed to make [@anything]
work to reference another document) is that the parser in DEVONthink is designed to support the MMD meaning of [something]
. Obviously I don’t know the details of DEVONthink’s implementation – so this is just some annoying second-guessing on my part – but perhaps the parser switches from looking for external documents to looking in the current document for the target reference when it encounters a bare [something]
. In any case, the need to support this MMD functionality would explain why DEVONthink doesn’t link to another document upon encountering [something]
or even [@something]
.
Just speculating, but supporting [@something]
seems like it would require one of the following:
- Extend the syntax such that
[something]
is defined to link to another document if no definition for [something]
is found in the current document and something
exists as the name or alias of something elsewhere (and automatic wiki links are enabled).
- Switch behaviors if the next character after
[
is not alphanumeric, and assume that the destination is outside the current document. This is made difficult by the fact that MMD already defines meanings for [#something]
, [^something]
, and [%something]
. But, one can imagine defining [@something]
to have the definition "link to an external document whose name or alias is something
".
3. Define a (new) syntax for @something
that works anywhere in a document (not just inside square brackets), to mean "link to an external document whose name or alias is something
". In this context, it is worth noting that @something
does not have a definition in Gruber’s Markdown or in MMD (as far as I can see), so at first blush it seems like this would not collide with other Markdown syntaxes. Still, it would probably be a good idea to put some limitations on this, such as that the @
must not be preceded by an alphanumeric character, to avoid triggering in cases like someone@gmail.com
, and of course it would only make sense for MashedWords names or aliases and not for names/aliases having multiple words.
IMHO option #3 has the most potential. It has some similarity to syntaxes in (e.g.) online forums like this one, where @person
is a way to link to a person’s handle in a discussion. In addition, it would solve another problem for people trying to do Pandoc-style citation syntax, which is that the syntax actually defines more than just [@something]
. Indeed, I often cite more than one reference at a time, and would find myself wanting to type [@Someone2001; @Another1989]
as well as the unbracketed form in contexts such as in their 1990 book, @Someone1990 wrote blah blah blah
. If DEVONthink supported @something
as the linking syntax, then all of these other forms would work, and at the same time, for people who never heard of Pandoc or used citations, having the option to type @something
as a way to make a link might seem kind of natural.
Still, option #3 would require changing the single bracket MMD interpretation to be overriden if the text inside the square brackets could be interpreted as a @something
style link to another document. (Otherwise, we’re back at the problem that [@something]
doesn’t work.) This may or may not be easy to do, depending on when in the software pipline the interpretation of @something
had to be done. If it came after the MMD parser did its work, then it might not be too bad to implement.
Well, duh, I just noticed #3 is not different from what DEVONthink already does: if something
exists and you type @something
, it links the something
part already.
So, never mind. The problem really just boils down to the way single brackets turn off wiki linking, which is what @lyndondrake wrote about in the first place.