diff options
author | Thomas F. K. Jorna <[email protected]> | 2021-07-25 13:57:17 +0200 |
---|---|---|
committer | Thomas F. K. Jorna <[email protected]> | 2021-07-25 13:57:17 +0200 |
commit | 24799ec72c39183c7aa156994077e0d5370388e0 (patch) | |
tree | 9974a76787f5491632556a9dab3f55fd5c0206bd | |
parent | 73b720c2cb024a034914ff850c60a326efc992b1 (diff) |
readded theme servlet
-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 |