summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-02-20 13:29:53 +0200
committerThanos Apollo <[email protected]>2024-02-20 13:29:53 +0200
commit6f05efdcc861d8d3a0ef374ceafe91f735da10cf (patch)
tree9b4b85d76cd180559b2889d46c013103b5fc5022 /gnosis.el
parentf7c73b592069072d70cebdeac22ad7e0a9608b2f (diff)
Add gnosis-dashboard-output-note
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el10
1 files changed, 10 insertions, 0 deletions
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)