知识消化系统 v1

同步数据到 anki 的部分是自己写的么?

我目前是用 anki-editor 在做这个事情,定义好和对应的 anki note 对应的 capture 模板,然后用 anki-editor-push-notes 同步到 anki 上去,类似这个样子

(add-to-list 'org-capture-templates
             '("c" "Cards"))

(defun generate-anki-note-body ()
  (interactive)
  (message "Fetching note types...")
  (let ((note-types (sort (anki-editor-note-types) #'string-lessp))
        (decks (sort (anki-editor-deck-names) #'string-lessp))
        deck note-type fields)
    (setq deck (completing-read "Choose a deck: " decks))
    (setq note-type (completing-read "Choose a note type: " note-types))
    (message "Fetching note fields...")
    (setq fields (anki-editor--anki-connect-invoke-result "modelFieldNames" `((modelName . ,note-type))))
    (concat "  :PROPERTIES:\n"
            "  :ANKI_DECK: " deck "\n"
            "  :ANKI_NOTE_TYPE: " note-type "\n"
            "  :END:\n\n"
            (mapconcat (lambda (str) (concat "** " str))
                       fields
                       "\n\n"))))

(add-to-list 'org-capture-templates
             `("cp" "Person"
               entry (file+headline "~/Dropbox/org/cards.org" "Person")
               ,(concat "* %^{heading|Item} :note:\n"
                        "%(generate-anki-note-body)\n"
               )))
1 个赞