diff options
author | Thanos Apollo <[email protected]> | 2024-03-03 02:27:49 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-03-03 02:27:49 +0200 |
commit | cbf93bf3b216dc356184d59c05d07b8e6c76aa21 (patch) | |
tree | 86dc49170d4daeaa70319630b74db2ed52bb40c0 /gnosis.el | |
parent | cb391c6e86a17270ccb9735b8b1b91a7d0669c70 (diff) |
Add gnosis-dashboard-output-deck
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1549,6 +1549,16 @@ name and all notes formatted as nested lists" (let ((note-count (caar (emacsql gnosis-db (format "SELECT COUNT(*) FROM notes WHERE deck_id=%s" id))))) (when (gnosis-select 'id 'decks `(= id ,id)) (list (number-to-string note-count))))) + +(defun gnosis-dashboard-output-deck (id) + "Output deck contents formatted for gnosis dashboard." + (cl-loop for item in (append (gnosis-select '[name failure-factor ef-increase ef-decrease ef-threshold] + 'decks `(= id ,id) t) + (gnosis-dashboard-deck-note-count id)) + when (listp item) + do (cl-remove-if (lambda (x) (and (vectorp x) (zerop (length x)))) item) + collect (prin1-to-string item))) + (defun gnosis-dashboard-edit-note () "Get note id from tabulated list and edit it." (interactive) |