/org-anki

Sync org sections to Anki via the AnkiConnect plugin

Primary LanguageEmacs LispBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

org-anki

Minor mode to synchronize your org-mode entries to Anki.

Works via AnkiConnect add-on to Anki.[fn:via]

How

  • creates “Basic” type of cards
  • heading of org entry is set as card front
  • text content until next heading is set as card back[fn:how]

See example.org and the resulting screenshots for how the cards look after being synced to Anki.

Both front and back are converted to html.[fn:html-export]

Exposes these commands:

org-anki-sync-entry
adds or updates the current org-entry under cursor
org-anki-delete-entry
deletes entry from Anki. Entry must have ANKI_NOTE_ID property

Setup

  • Start Anki with AnkiConnect installed
  • Add #+ANKI_DECK: my-target-deck to top of the .org file
    • Also, make sure this deck exists
  • Run anki-sync-entry on some heading with content

Note: the card browser must be closed while synchronizing, as it won’t update the note otherwise (issue).

You probably want to bind org-anki-sync-entry to a key sequence, but not org-anki-delete-entry – as accidentally deleting notes will become too easy.

In any case, don’t forget to create backups, as deleting notes will lose their scheduling information.

Why

.. as there are anki-editor, pamparam, org-drill, org-fc?

Anki-editor requires subheadings for fields, so existing .org notes need to be modified to be ankified.

The other three are emacs or org-mode only[fn:others], so no spaced repetition from your phone or web.

Todo

See issues.

Footnotes

[fn:via] AnkiConnect starts a HTTP server on localhost:8765 which the current package talks to.

[fn:how] It does this even if the next heading is a sub-heading (you probably don’t want subheadings in card contents anyway).

[fn:html-export] Plain org-mode can export to html too but there didn’t appear to be a plain string-to-basic-html function.

[fn:others] I mean, do you really want to use thes just to use Anki?? :p