diff options
-rw-r--r-- | org-roam-ui.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/org-roam-ui.el b/org-roam-ui.el index e3a15db..0b4646e 100644 --- a/org-roam-ui.el +++ b/org-roam-ui.el @@ -117,5 +117,15 @@ This function is added to `post-command-hook'." (condition-case nil (org-roam-id-at-point) (error nil)) org-roam-ui-current-node-id))) +(defservlet* theme text/stream () + (progn + (when (boundp 'doom-themes--colors) + (let* + ((colors (butlast doom-themes--colors (- (length doom-themes--colors) 25))) ui-theme (list nil)) + (progn + (dolist (color colors) (push (cons (car color) (car (cdr color))) ui-theme)) + (insert (format "data: %s\n\n" (json-encode ui-theme)))))) + (httpd-send-header t "text/event-stream" 200 :Access-Control-Allow-Origin "*"))) + (provide 'org-roam-ui) ;;; org-roam-ui.el ends here |