diff options
author | Thanos Apollo <[email protected]> | 2024-01-14 13:00:23 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-01-14 13:02:53 +0200 |
commit | 7c9a1ad6f27c00f6882171ba17e67a18cb2d8b3a (patch) | |
tree | bad5a5e858fe2aba529599affa80fd65ca9111b1 /gnosis.el | |
parent | f585d83f6df1498b9fa93eac7e4e37663bafb8f2 (diff) |
Add gnosis-add-note--y-or-n & gnosis-add-note-y-or-n
Functions to add note type y-or-n,
gnosis-add-note--y-or-n is the hidden function that interacts with
gnosis-add-note-fields & gnosis-add-note-y-or-n that passes values interactively
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -535,6 +535,35 @@ Refer to `gnosis-add-note--double' for more." :extra (read-string "Extra: ") :tags (gnosis-tag-prompt))))) +(cl-defun gnosis-add-note--y-or-n (&key deck question hint answer extra (image nil) tags (suspend 0) (second-image nil)) + "Add y-or-n type note. + +DECK: Deck name for note. +QUESTION: Quesiton to display for note. +ANSWER: Answer for QUESTION, either `121' (char value for yes) or `110' + (char value for no). +HINT: Hint to display during review, before user-input. +EXTRA: Extra information to display after user-input/giving an answer. +IMAGE: Image to display before user-input. +TAGS: Tags used to organize notes +SUSSPEND: Binary value of 0 & 1, when 1 note will be ignored. +SECOND-IMAGE: Image to display after user-input." + (gnosis-add-note-fields deck "y-or-n" question hint answer extra tags suspend image second-image)) + +(defun gnosis-add-note-y-or-n () + "Add note(s) of type `y-or-n' interactively to selected deck. + +refer to `gnosis-add-note--y-or-n' for more information about keyword values." + (let ((deck (gnosis--get-deck-name))) + (while (y-or-n-p (format "Add note of type `y-or-n-p' to `%s' deck? " deck)) + (gnosis-add-note--y-or-n :deck deck + :question (read-string "Question: ") + :answer (read-char-choice "Answer: [y] or [n]? " '(?y ?n)) + :hint (read-string "Hint: ") + :extra (read-string "Extra: ") + :tags (gnosis-tag-prompt))))) + + (cl-defun gnosis-add-note--cloze (&key deck note hint tags (suspend 0) extra (image nil) (second-image nil)) "Add cloze type note. |