mirror of
https://github.com/chrisbarrett/nursery
synced 2025-09-22 16:20:55 -05:00
Run org-roam-preview-postprocess-functions over org-roam-review previews
This commit is contained in:
@@ -330,16 +330,21 @@ When called with a `C-u' prefix arg, clear the current filter."
|
||||
str))
|
||||
|
||||
(cl-defun org-roam-review-insert-preview (node &optional (depth 0))
|
||||
(magit-insert-section preview (org-roam-preview-section)
|
||||
(magit-insert-section section (org-roam-preview-section)
|
||||
(let* ((start (org-roam-node-point node))
|
||||
(file (org-roam-node-file node))
|
||||
(content (org-roam-fontify-like-in-org-mode (org-roam-preview-get-contents file start))))
|
||||
(oset preview file file)
|
||||
(oset preview point start)
|
||||
(insert (org-roam-review-indent-string (if (string-blank-p (string-trim-left content))
|
||||
(preview (org-roam-fontify-like-in-org-mode (org-roam-preview-get-contents file start)))
|
||||
(post-formatters
|
||||
(append org-roam-preview-postprocess-functions
|
||||
(list (lambda (content)
|
||||
(org-roam-review-indent-string (if (string-blank-p (string-trim-left content))
|
||||
(propertize "(Empty)" 'font-lock-face 'font-lock-comment-face)
|
||||
content)
|
||||
depth))
|
||||
depth)))))
|
||||
(formatted-preview (seq-reduce (lambda (str fn) (funcall fn str)) post-formatters preview)))
|
||||
(oset section file file)
|
||||
(oset section point start)
|
||||
(insert formatted-preview)
|
||||
(insert "\n\n"))))
|
||||
|
||||
(defun org-roam-review--insert-node (node)
|
||||
|
Reference in New Issue
Block a user