Previous: , Up: Roam Protocol   [Contents]


11.3 The ‘roam-ref’ Protocol

This protocol finds or creates a new note with a given ‘ROAM_KEY’ (see Anatomy of an Org-roam File):

images/roam-ref

To use this, create a Firefox bookmarklet as follows:

javascript:location.href =
'org-protocol://roam-ref?template=r&ref='
+ encodeURIComponent(location.href)
+ '&title='
+ encodeURIComponent(document.title)

or as a keybinding in ‘qutebrowser’, adding the following to the ‘autoconfig.yml’ file:

settings:
  bindings.commands:
    global:
      normal:
        gc: open javascript:void(location.href='org-protocol://roam-ref?template=r&ref='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title))

where ‘template’ is the template key for a template in ‘org-roam-capture-ref-templates’ (see The Templating System). These templates should contain a ‘#+ROAM_KEY: ${ref}’ in it.