Invoking jump-to-missing-node
picks a
random org-roam link which is of the [[roam:Some Text]]
form, i.e. a stub, so that
you can fill in missing parts of your graph. This paired with help:org-roam-refile is a helpful way to
flesh out your Knowledge Base.
defun one-random (list)
(elt list
(random (length list))))
(
defun one-missing-node ()
(let* ((from-db (org-roam-db-query [:select [source dest] :from links :where (= type "roam")]))
(#'cadr from-db))
(dest-names (-map cons (cadr it) (car it)) from-db))
(as-alist (--map (
(eln (one-random dest-names))) assoc eln as-alist #'equal)))
(
defun jump-to-missing-node ()
(
(interactive)
(pcase-let* ((`(,text . ,source-id) (one-missing-node))
(node (org-roam-node-from-id source-id)))
(org-roam-node-open node)
(goto-char (point-min))format "[[roam:%s]]" text))
(search-forward (
(outline-show-all)))
provide 'cce/missing-org-roam) (