summaryrefslogtreecommitdiff
path: root/gnosis-dev.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-01-14 19:01:33 +0200
committerThanos Apollo <[email protected]>2024-01-14 19:01:33 +0200
commit8ca53e1a0e7f1cde295b2aab29893439be07a89a (patch)
tree3c9e667fe0a778e3954992bedd15a6106c5fe5f4 /gnosis-dev.el
parentfadc296ccca067a22a929524f62f5007de0d7e1f (diff)
parentf9f9c31bc38bb8b6475d59c5f6f6499ddf1619a8 (diff)
Merge branch version '0.1.0' into master0.1.0
This is marks the first "release" of gnosis, it's still under heavy development, but the fundamental use is there. More features will be added in the future, that should not affect notes created using this version.
Diffstat (limited to 'gnosis-dev.el')
-rw-r--r--gnosis-dev.el42
1 files changed, 23 insertions, 19 deletions
diff --git a/gnosis-dev.el b/gnosis-dev.el
index dadbe04..f5003fc 100644
--- a/gnosis-dev.el
+++ b/gnosis-dev.el
@@ -59,13 +59,21 @@ by the thoracodorsal nerve."
:hint "note"
:tags (gnosis-dev-random-items gnosis-dev-tags 2)
:extra "extra")))
- (when (y-or-n-p "Add mulit cloze type?")
+ (when (y-or-n-p "Add note with multiple clozes?")
(dotimes (_ num)
(gnosis-add-note--cloze :deck testing-deck
:note "this is a {c1:note} with multiple {c1:clozes}"
:hint "note"
:tags (gnosis-dev-random-items gnosis-dev-tags 2)
- :extra "extra")))))
+ :extra "extra")))
+ (when (y-or-n-p "Add note type y-or-n?")
+ (dotimes (_ num)
+ (gnosis-add-note--y-or-n :deck testing-deck
+ :question "Is Codeine recommended in breastfeeding mothers?"
+ :hint "hint"
+ :answer 110
+ :extra "extra"
+ :tags (gnosis-dev-random-items gnosis-dev-tags 2))))))
(defun gnosis-dev-test ()
"Begin/End testing env.
@@ -75,27 +83,23 @@ If ask nil, leave development env"
(let ((ask (y-or-n-p "Start development env?"))
(testing-dir (concat gnosis-dir "/testing")))
(if ask
- (progn (unless (file-exists-p testing-dir)
- (make-directory testing-dir))
- (setf gnosis-db (emacsql-sqlite (concat testing-dir "/testing.db")))
- (setf gnosis-testing t)
- (gnosis-db-init)
- (gnosis-dev-add-fields)
- (message "Adding testing values...")
- (message "Development env is ready for testing."))
+ (progn
+ (unless (file-exists-p testing-dir)
+ (make-directory testing-dir))
+ (setf gnosis-db (emacsql-sqlite (concat testing-dir "/testing.db")))
+ (setf gnosis-testing t)
+ (dolist (table '(notes decks review review-log extras))
+ (condition-case nil
+ (gnosis--drop-table table)
+ (error (message "No %s table to drop." table))))
+ (gnosis-db-init)
+ (gnosis-dev-add-fields)
+ (message "Adding testing values...")
+ (message "Development env is ready for testing."))
(setf gnosis-db (emacsql-sqlite (concat (file-name-as-directory gnosis-dir) "gnosis.db")))
(setf gnosis-testing nil)
(message "Exited development env."))))
-(defun gnosis-dev-retest ()
- "Redo database."
- (interactive)
- (dolist (table '(notes decks review review-log extras))
- (condition-case nil
- (gnosis--drop-table table)
- (error (message "No %s table to drop." table))))
- (gnosis-db-init)
- (gnosis-dev-test))
(provide 'gnosis-dev)
;;; gnosis-dev.el ends here