From b374ab4f4e91f6beb6763be908bdf542e0ee3374 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 22 Feb 2024 13:50:23 +0200 Subject: cloze: Refactor creation of cloze type notes - Use read-string-from-buffer for note & extra - Use gnosis-hint-prompt - Use gnosis-prompt-tags--split for tag input --- gnosis.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gnosis.el') diff --git a/gnosis.el b/gnosis.el index fdf048c..dd5338e 100644 --- a/gnosis.el +++ b/gnosis.el @@ -678,11 +678,14 @@ See `gnosis-add-note--cloze' for more reference." (let ((deck (gnosis--get-deck-name))) (while (y-or-n-p (format "Add note of type `cloze' to `%s' deck? " deck)) (gnosis-add-note--cloze :deck deck - :note (read-string "Question: ") - :hint (gnosis-hint-prompt gnosis-previous-hint) - :extra (read-string "Extra: ") + :note (read-string-from-buffer "Cloze questions are formatted like this:\{c1:Cyproheptadine} is a(n) {c2:5-HT2} receptor antagonist used to treat {c2:serotonin syndrome} + +- For each `cX`-tag there will be created a cloze type note, the above + example creates 2 cloze type notes." "") + :hint (gnosis-hint-prompt gnosis-previous-note-hint) + :extra (read-string-from-buffer "Extra" "") :image (gnosis-select-image) - :tags (gnosis-tag-prompt))))) + :tags (gnosis-prompt-tags--split gnosis-previous-note-tags))))) ;;;###autoload (defun gnosis-add-note (type) -- cgit v1.2.3