diff options
author | Thanos Apollo <[email protected]> | 2024-08-27 02:24:21 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-08-27 02:24:21 +0300 |
commit | 56ed928045f20bb7e9a6840774d852599489a585 (patch) | |
tree | b5e05be70afca35b96075be0e25062c21bb5c329 | |
parent | bb1469aad5e488f1cf5ed1983feee3ee283a7152 (diff) |
export-deck: Add demo export.
-rw-r--r-- | gnosis.el | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -50,6 +50,8 @@ (require 'gnosis-string-edit) (require 'gnosis-dashboard) +(require 'gnosis-org) + (require 'animate) (defgroup gnosis nil @@ -2509,6 +2511,19 @@ If STRING-SECTION is nil, apply FACE to the entire STRING." :tags note-tags)) (error "Demo deck already exists")))) +;; Export +;; This is a demo! +(defun gnosis-export-deck (&optional deck) + "Export contents of DECK." + (interactive (list (gnosis--get-deck-id))) + (with-current-buffer (get-buffer-create "*test*") + (insert (format "#+GNOSIS_DECK: %s\n\n" (gnosis--get-deck-name deck))) + (cl-loop for note in (gnosis-select '[main answer id type] 'notes `(= deck-id ,deck)) + do (gnosis-org-insert-heading :main (car note) + :answer (cadr note) + :id (number-to-string (caddr note)) + :type (cadddr note))))) + ;; Gnosis mode ;; ;;;;;;;;;;;;;;;;; |