summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-05-18 05:47:38 +0300
committerThanos Apollo <[email protected]>2024-05-18 05:47:38 +0300
commit68f7b7046e0c8b00c492d8fcc1939c1fa58ac4ba (patch)
tree9e729ce46a95033465aac8df21a10b552c98818b /gnosis.el
parent9daaca28c61610e9266efbd6d93a02038c8d3e43 (diff)
Add gnosis-mcc-extract-options
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 5faa660..a8badb8 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -847,6 +847,16 @@ See `gnosis-add-note--cloze' for more reference."
:images (gnosis-select-images)
:tags (gnosis-prompt-tags--split gnosis-previous-note-tags)))
+(cl-defun gnosis-mcc-extract-options (str &optional (char gnosis-mcc-separator))
+ "Extract options for MCC note type from STR.
+
+CHAR: separator for mcc, default to `gnosis-mcc-separator'"
+ (cl-remove-if
+ #'null
+ (mapcar (lambda (s)
+ (when (string-match-p (regexp-quote char) s)
+ (split-string s (regexp-quote char))))
+ (split-string str " "))))
;;;###autoload
(defun gnosis-add-note (&optional deck type)
"Create note(s) as TYPE interactively.