Render Emacs org-roam nodes on your Obsidian Canvas!
This is the Obsidian canvas, showing a single markdown file (yellow) and five Emacs Orgmode / Org-roam nodes:
This is a FastAPI server which talks to a running Emacs process via emacsclient
and offers the following endpoints:
You will typically only interact with the first /select/
endpoint, the rest are used by Obsidian.
Ensure you have pipx installed, and then:
# install org-roam-canvas (once)
pipx install git+https://github.com/cpbotha/org-roam-canvas.git
# now start the server
orserve
Ensure that you have poetry installed, and then:
git clone https://github.com/cpbotha/org-roam-canvas.git
cd org-roam-canvas && poetry install
poetry run orserve
... alternatively, use the ors-get-link
method from the next section.
Instead of using the select
link above, you can also just add the following function to your init.el
and invoke it with the org-roam node open that you would like to embed. If successful, it will copy the link to your clipboard so that you can Ctrl/Cmd-V on the Obsidian Canvas.
This works for file and heading nodes.
(defun ors-get-link()
"Get org-roam-canvas link to org-roam node containing point. After invoking this, Ctrl-V on the Obsidian Canvas."
(interactive)
(let ((node (org-roam-node-at-point)))
(if node
(progn
(message "Placed org-roam-canvas link on clipboard for node: %s" (org-roam-node-title node))
(kill-new (url-encode-url (format "http://localhost:3813/node/?id=%s" (org-roam-node-id node)))))
(message "No org-roam node found."))))
The following screen capture shows ors-get-link
in action:
Click on the [name_of_file.org]
link at the top of the embedded page:
This started as a half-working prototype for serving HTML exports of org-roam nodes so that the frontend can show them on an infinite canvas.
What worked:
During development, we
fnm use 18
cd fe
pnpm install
pnpm run dev
# in another terminal
poetry run uvicorn serve:app --reload