Today I got this installed as a Spacemacs layer and thought I'd quickly share what I found, since it was not trivial. Most of the mess and time I took were because quelpa didn't like polyfill. I've never made my own package for distribution so maybe there is a quick fix without this hack:
git clone <org-roam.git url> /path/to/layer/local/org-roam.git
In org-roam-polyfill.el:
Prepend:
;;; org-roam-polyfill.el --- Roam Research replica with Org-mode
;;; Commentary:
;;
;;; Code:
Append:
;;; org-roam-polyfill.el ends here
Then, in /path/to/layer/packages.el
(defconst my-packages
'(
;; Must load polyfill manually or the require within org-roam.el doesn't work
(org-roam-polyfill :location
(recipe :fetcher file :path "/path/to/layer/local/org-roam.git/org-roam-polyfill.el")
:update nil)
(org-roam :location
(recipe :fetcher local)
:update nil)
)
;; Do this to get org-roam-polyfill to load, otherwise its discarded
(defun my/init-org-roam-polyfill () '())
(defun my/init-org-roam ()
(use-package org-roam
:after org
:hook (org-mode . org-roam-mode)
:custom
(org-roam-directory org-directory)
:init
(progn
(spacemacs/declare-prefix-for-mode 'org-mode "mr" "org-roam")
(spacemacs/set-leader-keys-for-major-mode 'org-mode
"rl" 'org-roam
"rt" 'org-roam-today
"rf" 'org-roam-find-file
"ri" 'org-roam-insert
"rg" 'org-roam-show-graph)
)))
Thanks for the effort! I think I'll move the polyfill into the main file to avoid this mess.
You shouldn't need those hacks now. It'd be really helpful if you could PR the spacemacs installation instructions into the README!
Thanks! That will make this a lot simpler. I'll come back to it next time I have to update the package and PR if I can; ran out of time for now.
Just for reference: I posted pull request #133 that adds some instructions on how to install org-roam as a spacemacs user.
Most helpful comment
Thanks! That will make this a lot simpler. I'll come back to it next time I have to update the package and PR if I can; ran out of time for now.