From 6f05efdcc861d8d3a0ef374ceafe91f735da10cf Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Tue, 20 Feb 2024 13:29:53 +0200 Subject: Add gnosis-dashboard-output-note --- gnosis.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gnosis.el b/gnosis.el index 538b4e6..1ef8b0b 100644 --- a/gnosis.el +++ b/gnosis.el @@ -1357,6 +1357,16 @@ review." (:foreign-key [id] :references notes [id] :on-delete :cascade))) +;; Dashboard +(defun gnosis-dashboard-output-note (id) + "Output note contents formatted for gnosis dashboard." + (cl-loop for item in (append (gnosis-select '[main options answer tags] 'notes `(= id ,id) t) + (gnosis-select 'suspend 'review-log `(= id ,id) t)) + if (listp item) + collect (mapconcat #'identity item ", ") + else + collect (prin1-to-string item))) + (defun gnosis-db-init () "Create gnosis essential directories & database." (unless (length= (emacsql gnosis-db [:select name :from sqlite-master :where (= type table)]) 6) -- cgit v1.2.3