New and Better- Question about Drafts Capabilites [[links]]

I read a story about Roam Research and was checking it out, and I really appreciated the linked notes structure they say they have.

Then I got to thinking, will drafts note-linking capabilities act in the same way? If I use the double brackets for [[notes]] that have a common thread, they will all link together, creating the same type of functionality?

Pretty much, actually. Out of the box, you won’t get (and will probably miss) the automated back-linking and summary of linked/unlinked references that you’ll get in Roam, and the ability to link at block level (i.e. reference a line/paragraph in a draft, rather than the entire draft), but with a few appropriate actions, you should be able close enough. Certain functions might require more manual intervention/attention.

I’m happy enough that, having played with Roam and having considered running a Roam instance alongside my note-taking in Drafts, I’m pretty confident that Drafts gives me everything I currently need. As with most things, YMMV. :wink:

1 Like

Could you in Drafts crosslink to a heading? I get the “not to a paragraph” thing - unless you’re prepared to (ab)use <span> with a name attribute.

1 Like

Recommend you first read this thread:

It contains my assessment of how to use Drafts for a Zettelkasten (a system of linked notes). In the thread I list a set of actions (available in the Drafts Directory) that I think are needed for this purpose.

With respect to links based on headings. There is currently (to my knowledge) no way to link to a heading - versus to the title. I agree that being able to do so would be a valuable enhancement to the current Drafts capability.

With that said, this method may provide a work-around:

Construct a heading using a UID, with the UID coming first or last. For example:

 ##  202008290319 My Heading 

Then use a search link to the UID:

[[s:202008290319]]
2 Likes

Further to @Bjb’s response: personally, I haven’t yet settled on the best way to do this between drafts. Cross-links are based on draft titles; would be brilliant if an update of the syntax allowed us to specify an “anchor” within the target draft, but I can imagine that being unwieldy (much as I would love to see it, or something similar!).

I had put together a very hacks mash-up of David Crandall’s double bracket search and @mattgemmell’s find next action to target specific instances of a double-bracketed term within a draft. I’m also pretty sure @sylumer offered a way of generating links to specific anchors in different drafts, though I can’t seem to find it now…

Also, I should say— while my work in Drafts isn’t canonically Zettlekasten, I’ve moved more toward embracing Zettlekasten’s characteristic atomisation of notes where possible/appropriate, meaning I’ve been a little less concerned with having single drafts containing lots of thinking and trying to link to specific thoughts within them…

1 Like

The only anchor-based actions I’ve posted that I know of are in these posts:

Greg’s transclude actions and my Exploded Markdown Preview action deal with incorporating one draft in the preview of another - which might be an option for some of the earlier section embed functionality that Roam Research is so good at.

But I don’t think that any of these fall into the option to link to a specific section of another draft

However, if I did want to create a link in one draft to a section in another draft, I would write an action that I could trigger using the wiki URL Markup and the Drafts URL scheme (I’m assuming everyone realised that the wiki URL links also support Draft URL scheme links - very useful!! :slight_smile:) , passing in the UUID of the draft and maybe say the number of the heading (first, second, third, etc.). The action would use the text passed in to load the specified draft into the editor and the navigation marker functions to place the cursor at the correct position.

That would produce something like this for the link, with a comma between the UUID and the position of the navigation marker, and an action called switch.

[[url:drafts://x-callback-url/runAction?text=D245C74F-ED96-4D21-99C6-1F7821EC31B1,5&action=switch]]

And something like this for the action:

Not exactly the prettiest URL, but functional. While the position of the desired navigation marker against it’s other markers is simply expedient as a demonstration, you could actually search for the navigation marker by its label too.

I’m not sure I’d favour it over adding in unique IDs at key locations as referenced above, as the “clutter” one could argue is presented by adding such unique ID’s I would say is equally as cluttered in terms of the readability and length of the URL needed to take the approach I’ve just set out.

2 Likes

Found the post I was thinking of, @sylumer. Add to your list: URL link to a spot in a draft

You’ve helped so many people with answers to their queries here it’s entirely forgivable that some slip your memory…

Triggering an action via the double-bracket link itself: nice!

Thanks, as always, for dropping in with a functional solution. Your generosity is appreciated.

Proposed Syntax for linking to a heading:

[[My Other Draft#myheadingidentifier]]

That’s not complex, apart from the need to emulate an HTML ID. If that’s not good enough then:

[[My Other Draft#My Heading]]

Which suffers (a little) from ambiguity. But then so does the note title.

1 Like

:laughing: I was looking for something for anchors specifically, and I barely remember things for a few weeks, 2018 would definitely be pushing the limits of my memory.

The approach is actually based on the same principle as @Bjb’s approach of using a unique reference, but the relatively recent availability of the wiki search option certainly does make it a lot simpler these days.

It wouldn’t take much at all to adapt the action to produce a wiki-style link.

1 Like

@martinpacker, I hope that you’ve seen something about this in the 21.5.33 beta :slight_smile:

I’ve included a number of cross-linking related actions in the latest update to the ThoughtAsylum Action Group, one of them being an action to insert a link to run an action (TAD-Link For Drafts Action in the new Cross-Linking section). It gives you a type-ahead search box that searches across all of your actions, URL encodes the selected action name, and inserts it as a wiki-style link. I’ve used it to add inline executable links to some step-by-step instruction lists I have in Drafts. Now, as I work through the list, instead of it telling me what action to run, I just have a step that says run this action, and gives me a clickable/tappable link.

2 Likes

In the words of my favorite movie (1967 Casino Royale) “don’t think that went unnoticed Mr Bond”. :slight_smile:

1 Like