How to quickly covert an org-roam-dailies item to new org-roam node

Sometimes after quickly adding something in org-roam-dailies, I found out it more suitable to keep it as an independent node in org-roam, is there any quick and simple workflow to do this beyond just copying and pasting the whole subtree to a new org-roam node?

Have you tried org-roam-extract-subtree?

Convert current subtree at point to a node, and extract it into a new file.

2 Likes

thanks a lot

you created this function. it can optionally receive a filter-function (similar to org-roam-node-find). It uses org-refile and refiles the current node and its children to the desired destionation. In theory you can change the call to org-roam-node-find to remove the requirement that the node exists before it is created. In my case, I usually file to a node already existing.

(defun dmg-org-roam-refile (&optional p-visit filter-function)
  "refile current node to a project using the tags of the node.
Possible candidates must have at least one tag in common with current node

If P_VISIT is t, place point a destination.

FILTER-FUNCTION allows you to narrow the potential destinations. See
org-roam-node-find for an explanation of how it works.
"
  (interactive)
  (let* (  ;
        (node   (org-roam-node-read nil filter-function nil 'require-match))
        (file   (org-roam-node-file node))
        (title   (org-roam-node-title node))
        (point  (org-roam-node-point node))
        )
    (org-refile nil nil (list title file nil point))
    (save-excursion
      (let (
            (buf (current-buffer))
            )
        (org-refile-goto-last-stored)
        (save-buffer)
        (switch-to-buffer buf)
        )
      )
    (if p-visit
        ;; go to location of last refile
        (org-refile '(16) ))
  ))