org-roam-server icon indicating copy to clipboard operation
org-roam-server copied to clipboard

Reload Page Automatically

Open SidharthArya opened this issue 3 years ago • 1 comments

I am using this code to change the filters in the org roam server. But the change is not being reflected in the page right away. It needs to be explicitely reloaded. Is there a way to update the filter automatically in the page, or reload the page as soon as the update is made.

(setq org-roam-server-tags "")
(defun my-org-roam-server-tags()
  "Process org-roam-server-tags"
  (interactive)
  (let* (
         (tags (read-string "Tags: " org-roam-server-tags))
         (tags-temp (cdr (split-string tags "\ [\+]")))
         (plus (mapcar (lambda(a) (string-trim (car (split-string a "\ [\-]")))) tags-temp))
         (tags-temp (cdr (split-string tags "\ [\-]")))
         (minus (mapcar (lambda(a) (string-trim (car (split-string a "\ [\+]")))) tags-temp)))

    (setq org-roam-server-default-include-filters (json-encode (mapcar (lambda (tag) (list (cons 'id tag ) (cons 'parent "tags"))) plus)))
    (setq org-roam-server-default-exclude-filters (json-encode (mapcar (lambda (tag) (list (cons 'id tag ) (cons 'parent "tags"))) minus)))
    (setq org-roam-server-tags tags)
         ))

SidharthArya avatar Apr 02 '21 04:04 SidharthArya

Unfortunately, the filters are only loaded at the beginning. See https://github.com/org-roam/org-roam-server/blob/2122a61e9e9be205355c7e2c1e4b65986d6985a5/index.html#L309-L329

goktug97 avatar Apr 02 '21 08:04 goktug97