From d1ef43dd7567228207732e5a4ce0c6f9475fca28 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Tue, 17 Dec 2024 05:31:45 +0200 Subject: Decouple org-roam: Add custom funcs to get data from. * Add custom functions to decouple org-roam-ui from org-roam. --- org-roam-ui.el | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'org-roam-ui.el') diff --git a/org-roam-ui.el b/org-roam-ui.el index e13349b..07e276b 100644 --- a/org-roam-ui.el +++ b/org-roam-ui.el @@ -40,26 +40,19 @@ (defgroup org-roam-ui nil "UI in Org-roam." - :group 'org-roam + :group 'org-roam-ui :prefix "org-roam-ui-" :link '(url-link :tag "Github" "https://github.com/org-roam/org-roam-ui")) -(defvar org-roam-ui-root-dir - (concat (file-name-directory - (expand-file-name (or - load-file-name - buffer-file-name))) - ".") - "Root directory of the org-roam-ui project.") - -(defvar org-roam-ui-app-build-dir - (expand-file-name "./out/" org-roam-ui-root-dir) - "Directory containing org-roam-ui's web build.") +(defcustom org-roam-ui-directory org-gnosis-dir + "Directory of org-roam-ui notes." + :group 'org-roam-ui + :type 'directory) -;; TODO: make into defcustom -(defvar org-roam-ui-port - 35901 - "Port to serve the org-roam-ui interface.") +(defcustom org-roam-ui-port 35901 + "Roam UI Port." + :group 'org-roam-ui + :type 'number) (defcustom org-roam-ui-sync-theme t "If true, sync your current Emacs theme with `org-roam-ui'. @@ -68,6 +61,11 @@ Ignored if a custom theme is provied for variable 'org-roam-ui-custom-theme'." :group 'org-roam-ui :type 'boolean) +(defcustom org-roam-ui-dailies-directory org-gnosis-journal-dir + "Dailies/Journaling directory." + :group 'org-roam-ui + :type 'directory) + (defcustom org-roam-ui-custom-theme nil "Custom theme for `org-roam-ui'. Blocks 'org-roam-ui-sync-theme from syncing your current theme, @@ -131,6 +129,21 @@ Defaults to #'browse-url." :group 'org-roam-ui :type 'function) +(defcustom org-roam-ui-tags-function #'org-roam-ui-get-tags + "Function that returns all tags as a list." + :group 'org-roam-ui + :type 'function) + +(defcustom org-roam-ui-nodes-function #'org-roam-ui-get-nodes + "Function that returns nodes." + :group 'org-roam-ui + :type 'function) + +(defcustom org-roam-ui-links-function #'org-roam-ui-get-links + "Function that returns links." + :group 'org-roam-ui + :type 'function) + ;;Hooks (defcustom org-roam-ui-before-open-node-functions nil -- cgit v1.2.3