I’m working on an extension to the syntax definition format which I have previously requested feedback about. Start with that RFC if you have not read it. The ability to customize and extend Drafts with these definitions is coming later in 2020, but for now, I’m going to start shipping some enhancements to the default Markdown syntaxes that ship with the app supporting the ability to create cross-links between drafts and other resources with a simple wiki-style markup. If you are interested in how these are defined and will be able to be extended in the future, read the updated link definition information on the preliminary syntax definition docs page.
What Link Definitions Can Do
The link definitions create a way to find particular match strings in your document and make them clickable links with a URL attached to them.
Basic Link Format
The extensions to the Markdown Syntax planned are will follow the [[ ]]
double-bracket style used in Wikis and a number of other notes apps, but have the slight twist that they will include a key and value in the format
[[key:value]]
The key
will be used to determine the URL template to use for the link. The value
can be dynamically inserted into the URL template to be a parameter in the URL.
Internal Drafts Link Types
The following keys are planned to support links within Drafts:
-
[[d:Title of Draft]]
: This will create a clickable link with will open another draft with the specified title. -
[[s:Search Term]]
: Open quick search to “Search Term” query. -
[[u:UUID-OF-DRAFT]]
: For fixed link to a specific Draft by UUID. -
[[w:Workspace Name]]
: Open a named workspace.
Each of these, when typed in draft text, generates a link to a URL that uses Drafts URL schemes to actually navigate.
External Link Types
This format is not limited to URLs that are using the drafts:
URL scheme. These definitions can support external URLs as well. I’m going to leave more extensive options out there for customizations later this year but will ship a couple of handy ones. Currently planned:
[[google:Search Term]]
[[wikipedia:Search Term]]
[[bear:Title of Bear Note]]
The first two open web searches, pretty self-explanatory. The bear:
one takes advanced of Bear’s URL schemes which support lookup of a note by title. Not sure there are other apps that have URL schemes with that sort of deep linking.
Conclusion
Thoughts on these options and formats as defaults? Nothing is set in stone, just roughing things out.