anki.el
anki.el copied to clipboard
Emacs Anki Client
#+TITLE: Anki.el
#+DATE: September 19, 2020
#+SINCE:
- Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#features][Features]]
- [[#installation][Installation]]
- [[#clone-to-path][Clone to path]]
- [[#require][require]]
- [[#use-package][use-package]]
- [[#usage][Usage]]
- [[#header][Header]]
- [[#related-packages][Related Packages]]
- [[#newslogs][News/Logs]]
- [[#2020-10-13][=2020-10-13=]]
- [[#2020-09-19][=2020-09-19=]]
- [[#2020-09-14][=2020-09-14=]]
- Description Yet another [[https://apps.ankiweb.net/][Anki]] Emacs Client.
Anki Search Mode: #+attr_org: :width 600px [[file:img/anki.png]]
Anki Mode: #+attr_org: :width 600px
[[file:img/anki.gif]]
- Features Current status:
- Anki Mode: Card Study Mode
- Anki Search Mode: Anki Cards Browser
- List and switch decks
- Preview Card
- Preview Card's Front
- Preview Card's Back
- (Re)Play audio
- Support [[https://github.com/chenyanming/shrface][shrface]]
- Installation ** Clone to path #+BEGIN_SRC sh git clone [email protected]:chenyanming/anki.el.git ~/.emacs.d/lisp/anki/ #+END_SRC
** 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
- Usage Enter anki mode: #+BEGIN_SRC emacs-lisp M-x anki #+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
- ~f~ Flip Card (Toggle between Question and Answer)
- ~r~ (Re)play audio
- ~l~ List and switch deck
- ~n/p~ Next Card (Only works if the current card is Blue Card. For Red or Green cards, you have to answer Red or Green Cards before studying Blue cards.)
- ~q~ Quit
- ~1~ Answer with "Again" (Review again after 1 minute: Hard coded)
- ~2~ Answer with "Hard" (Review again after 10 minutes: ~anki-learn-sm2-steps~, default 10 minutes)
- ~3~ Answer with "Good" (Graduating interval in days: ~anki-learn-sm2-graduating-interval~, default 1 day)
- ~4~ Answer with "Easy" (More Easy interval in days: ~anki-learn-sm2-more-easy-interval~, default 4 days)
Notice:
- ~anki.el~ does not modify the original anki database (at this moment), therefore, the review feature uses its own database: ~anki-core-database-file~.
- 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.
- If you want to insert/update/delete cards, please use official anki app (at this moment).
- ~M-x anki-db-current-deck-reschedule~ to reschedule the current deck (Delete all review logs of current deck).
- Header The header in ~anki-mode~ shows the current card status:
- Blue: New Cards
- Red: Due Cards to be reviewed again (< 1 day)
- Green: Due Cards to be reviewed (>= 1 day)
- Related Packages
- [[https://github.com/chenyanming/shrface][shrface]]: Enable org features on shr-rendered buffers, without the heaviness of org.
- News/Logs
** =2020-10-13= Version 0.3.0:
- Add Review Feature using SM2 algorithm.
** =2020-09-19= Version 0.2.0:
- New Features: ~anki~
** =2020-09-14= Version 0.1.0:
- New Features: ~anki-browser~, ~anki-list-decks~