summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-08-03 19:03:29 +0300
committerThanos Apollo <[email protected]>2024-08-03 19:03:29 +0300
commitcafca38b4dd5fc2150f6f326aa31f5feec224107 (patch)
tree4ed7ef98198112bb25707812112a3a87833ece0a
parentf13137a789e57117ef4e72b77e8ba1c5adfe8bfb (diff)
New function: Add dashboard-output-tags.
* Output all tags with total notes.
-rw-r--r--gnosis-dashboard.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el
index ad5d821..89692b6 100644
--- a/gnosis-dashboard.el
+++ b/gnosis-dashboard.el
@@ -306,6 +306,22 @@ Optionally, use when using multiple months."
"Mode for dashboard output of tags."
:keymap gnosis-dashboard-tags-mode-map)
+(defun gnosis-dashboard-output-tags (&optional tags)
+ "Format gnosis dashboard with output of TAGS."
+ (let ((tags (or tags (gnosis-get-tags--unique))))
+ (pop-to-buffer-same-window "*gnosis-dashboard*")
+ (gnosis-dashboard-mode)
+ (gnosis-dashboard-tags-mode)
+ (setf gnosis-dashboard--current '(:type 'tags))
+ (setq tabulated-list-format [("Name" 35 t)
+ ("Total Notes" 10 gnosis-dashboard-sort-total-notes)])
+ (tabulated-list-init-header)
+ (setq tabulated-list-entries
+ (cl-loop for tag in tags
+ collect (list (car (gnosis-dashboard-output-tag tag))
+ (vconcat (gnosis-dashboard-output-tag tag)))))
+ (tabulated-list-print t)))
+
(defun gnosis-dashboard-output-deck (id)
"Output contents from deck with ID, formatted for gnosis dashboard."
(cl-loop for item in (append (gnosis-select