Set square bracket Wikilink displayed text

Is there a way to use the square bracket wikilink while setting its displayed text to something differenet than the file name?

e.g. in Markdown : [some custom string](file-name)

No this is not possible. Square brackets match the exact filename. Changing the text will break the WikiLink as that’s not the name of the document.

You could perhaps try using the Names & Aliases option and add an alias to the document…

OK. Thanks.

Wikilinks based on square brackets use aliases too.

Obsidian has solved this with the ‘Display Text’ feature. Wouldn’t that also be a solution for DevonThink?

1 Like

Obsidian has a certain reputation for “improving” on MD by inventing their own syntax to solve perceived “issues”. Which appears to be nice as long as one is only living inside the Obsidianoverse.

But what is the point in deforming a standard so that it only works with one app (or in this case, two, if DT were to follow Obsidian)? If you ever move away from Obsidian, you’re left with a notation that no other app understands.

1 Like

Exactly, this is the way standards are evolving. The double square bracket syntax for Wikilinks was not part of the original Markdown specification as well, but a widespread extension that has been adopted by many tools – including DevonThink. The blueprint here is primarily Wikipedia, which also uses the feature I mentioned in the same implementation.

Standards are standards. It’s easy to determine if something is part of a published standard. What is constantly evolving is one’s own expectation.

3 Likes

Just to clarify: WikiLinks weren’t implemented for Markdown. They were implemented for rich text and later found their way into Markdown. And neither WikiLinks nor the double square bracket syntax is part of the Markdown specification.

5 Likes

Where there’s a will, there’s a way.

You can make a wikilink appear any way you want - if you first move it off of the wikilink.

In a Markdown document, type [[Plan for world domination]] to link wiki-style to your master plan.

Now use Tools->Item Links->Convert WikiLinks to Item Links. Your wikilink will change to something like:

[Plan for world domination](x-devonthink-item://19096BC2-4F1C-4392-A307-47C5AA03580F).

The text in the square brackets can be changed to anything you want without breaking the link, e.g.:

[First, rehab all the lawyers](x-devonthink-item://19096BC2-4F1C-4392-A307-47C5AA03580F).

The convert links feature operates on the current document, if you’re in the editor. Otherwise it works on a selection.

A smart group for all Markdown and RTF files is handy. Go into the smart group, hit Command-A, and use Convert WikiLinks to Item Links from the menus. That will act on every relevant file in your database.

Of course, a smart rule executing a script on demand would work, too.

2 Likes

Funny! I was just going to suggest using item links instead of WikiLinks.
Good tip on the smart group and converting WikiLinks to item links en masse. :slight_smile:

1 Like

A similar feature is in the pipeline for future releases.

2 Likes