chenyanming / anki.el

Emacs Anki Client
90 stars 3 forks source link

+TITLE: Anki.el

+DATE: September 19, 2020

+SINCE:

+STARTUP: inlineimages nofold

Anki Search Mode:

+attr_org: :width 600px

[[file:img/anki.png]]

Anki Mode:

+attr_org: :width 600px

[[file:img/anki.gif]]

** require

+BEGIN_SRC emacs-lisp

(add-to-list 'load-path "~/.emacs.d/lisp/anki/") (require 'anki) (setq sql-sqlite-program "/usr/bin/sqlite3") (setq anki-collection-dir "/Users/damonchan/Library/Application Support/Anki2/Android & Mac") (setq anki-audio-player (or (executable-find "aplay") (executable-find "afplay"))) ;; (require 'shrface) ; If you use shrface, require it here (setq anki-shr-rendering-functions (append anki-shr-rendering-functions shr-external-rendering-functions))

+END_SRC

** use-package

+BEGIN_SRC emacs-lisp

(use-package anki :defer t :load-path "~/.emacs.d/lisp/anki/" :init (add-hook 'anki-mode-hook #'shrface-mode) (add-hook 'anki-card-mode-hook #'shrface-mode) (autoload 'anki "anki") (autoload 'anki-browser "anki") (autoload 'anki-list-decks "anki") :config ;; (require 'shrface) ; If you use shrface, require it here (setq anki-shr-rendering-functions (append anki-shr-rendering-functions shr-external-rendering-functions)) (setq sql-sqlite-program "/usr/bin/sqlite3") ;; Set up the collection directory, which should contain a file - collection.anki2 and a folder - collection.media (setq anki-collection-dir "/Users/chandamon/Library/Application Support/Anki2/User 1"))

+END_SRC

Start from deck lists:

+BEGIN_SRC emacs-lisp

M-x anki-list-decks

+END_SRC

Enter anki search mode:

+BEGIN_SRC emacs-lisp

M-x anki-browser

+END_SRC

Notice:

  1. ~anki.el~ does not modify the original anki database (at this moment), therefore, the review feature uses its own database: ~anki-core-database-file~.
  2. If you modify the anki database through the official anki app, you have to close the official app(Important), then ~M-x anki-search-update~ to re-read the anki database.
  3. If you want to insert/update/delete cards, please use official anki app (at this moment).
  4. ~M-x anki-db-current-deck-reschedule~ to reschedule the current deck (Delete all review logs of current deck).

* =2020-10-13= Version 0.3.0*:

* =2020-09-19= Version 0.2.0*:

* =2020-09-14= Version 0.1.0*: