summaryrefslogtreecommitdiff
path: root/org-roam-ui.el
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-10-04 15:34:56 +0200
committerThomas F. K. Jorna <[email protected]>2021-10-04 15:34:56 +0200
commitb0ddf286f087b31dc75626f709cfce3889de25dd (patch)
tree480c65853ef0a8e2de44f567ec95e367fc634a04 /org-roam-ui.el
parent90820ca13a51b8a7e77d15896b0d34f9aba829fd (diff)
feat(preview): changed text-retrieval to http
Diffstat (limited to 'org-roam-ui.el')
-rw-r--r--org-roam-ui.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/org-roam-ui.el b/org-roam-ui.el
index df21f7c..6fbb279 100644
--- a/org-roam-ui.el
+++ b/org-roam-ui.el
@@ -206,8 +206,8 @@ This serves the web-build and API over HTTP."
(org-roam-capture-
:node (org-roam-node-create :title (alist-get 'title data))
:props '(:finalize find-file))))
- ((string= command "getText")
- (org-roam-ui--send-text (alist-get 'id data) oru-ws))
+ ;((string= command "getText")
+ ; (org-roam-ui--send-text (alist-get 'id data) oru-ws))
(t (message "Something went wrong when receiving a message from Org-Roam-UI")))))
:on-close (lambda (_websocket)
(remove-hook 'after-save-hook #'org-roam-ui--on-save)
@@ -236,6 +236,14 @@ This serves the web-build and API over HTTP."
(websocket-send-text ws
(json-encode `((type . "orgText") (data . ,text))))))
+(defservlet* note/:id text/plain ()
+ (let* ((node (org-roam-populate (org-roam-node-create :id id)))
+ (file (org-roam-node-file node)))
+ (insert-file-contents-literally file)
+(httpd-send-header t "text/html" 200
+ :Access-Control-Allow-Origin "*")))
+
+
(defun org-roam-ui--on-save ()
"Send graphdata on saving an org-roam buffer."
(when (org-roam-buffer-p)