summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-02-20 13:28:54 +0200
committerThanos Apollo <[email protected]>2024-02-20 13:28:54 +0200
commitf7c73b592069072d70cebdeac22ad7e0a9608b2f (patch)
treed4d4ef20470375d7c59bf7ab05ba6e492384e656 /gnosis.el
parentf94b733e3381c499073708f711e743ceffbb9bd5 (diff)
gnosis-export-note: Rewrite cleanly & with review-log
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el20
1 files changed, 14 insertions, 6 deletions
diff --git a/gnosis.el b/gnosis.el
index 6385e1a..538b4e6 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1210,18 +1210,26 @@ The final exported note is indented using the `indent-region' function
to improve readability."
(let ((values (append (gnosis-select '[id main options answer tags] 'notes `(= id ,id) t)
(gnosis-select '[extra-notes images extra-image] 'extras `(= id ,id) t)
- (gnosis-select '[ef ff] 'review `(= id ,id) t)))
- (fields '(:id :main :options :answer :tags :extra-notes :image :second-image :ef :ff)))
+ (gnosis-select '[ef ff] 'review `(= id ,id) t)
+ (gnosis-select 'suspend 'review-log `(= id ,id) t)))
+ (fields '(:id :main :options :answer :tags :extra-notes :image :second-image :ef :ff :suspend)))
+ (when export-for-deck
+ (setf values (append (gnosis-select 'type 'notes `(= id ,id) t)
+ (butlast (cdr values) 3)))
+ (setf fields (append '(:type) (butlast (cdr fields) 3))))
(cl-loop for value in values
for field in fields
do (insert
- (if (listp value)
- (format "\n%s '%s" (symbol-name field) (prin1-to-string value))
- (format "\n%s %s" (symbol-name field) (prin1-to-string value)))))))
+ (cond ((listp value)
+ (format "\n%s '%s" (symbol-name field) (prin1-to-string value)))
+ (t (format "\n%s %s" (symbol-name field) (prin1-to-string value))))))))
-(defun gnosis-export-deck (filename)
+;; TODO: Fix export of deck!
+(defun gnosis-export-deck (deck export-deck-name filename)
"Export notes for deck in FILENAME.
+WARNING: This function is not yet implemented.
+
FILENAME: The name of the file to save the exported deck.
This function prompts the user to provide a deck name and allows the