2018-02-04 07:43:11 +01:00
|
|
|
[[http://melpa.org/#/anki-editor][file:http://melpa.org/packages/anki-editor-badge.svg]]
|
|
|
|
|
2018-06-10 15:13:00 +02:00
|
|
|
anki-editor -- Emacs minor mode for making Anki cards with Org
|
2017-12-27 17:20:01 +01:00
|
|
|
|
2018-07-01 06:29:39 +02:00
|
|
|
/Since I'm not a native English speaker, feel free to correct me if
|
|
|
|
there were any ambiguity or grammatical mistakes ;-)/
|
2018-07-06 15:10:03 +02:00
|
|
|
|
2018-01-22 10:46:08 +01:00
|
|
|
* Installation
|
2018-01-15 15:11:02 +01:00
|
|
|
|
2018-01-22 10:46:08 +01:00
|
|
|
*Requirements*
|
2018-01-15 15:11:02 +01:00
|
|
|
- [[https://github.com/FooSoft/anki-connect#installation][anki-connect]],
|
|
|
|
an Anki add-on required by this package to interact with Anki.
|
2018-01-07 10:24:57 +01:00
|
|
|
- curl
|
2017-12-27 17:20:01 +01:00
|
|
|
|
2018-01-22 10:46:08 +01:00
|
|
|
If you have [[http://melpa.org/][MELPA]] in your =package-archives=,
|
2018-04-15 09:52:26 +02:00
|
|
|
just =M-x package-install RET anki-editor RET=, or install it
|
2018-06-10 15:13:00 +02:00
|
|
|
manually by downloading and visiting [[./anki-editor.el][anki-editor.el]] in your
|
2018-04-15 09:52:26 +02:00
|
|
|
emacs buffer, and =M-x package-install-from-buffer RET=.
|
2018-01-15 15:11:02 +01:00
|
|
|
|
2018-01-22 10:46:08 +01:00
|
|
|
* Usage
|
2018-01-15 15:11:02 +01:00
|
|
|
|
2018-06-10 15:13:00 +02:00
|
|
|
** The Layout of Notes
|
2018-01-15 15:11:02 +01:00
|
|
|
|
|
|
|
Now you can compose Anki notes in Org syntax, e.g. lists, code
|
2018-06-10 15:13:00 +02:00
|
|
|
examples, tables, embedded latex, when being submitted to Anki,
|
|
|
|
they will be converted to HTML by Org-mode's HTML backend with
|
|
|
|
specific markers (e.g. latex) translated to Anki style.
|
|
|
|
|
|
|
|
The structure of a note is as follow, which is inspired by
|
|
|
|
=org-drill=. More examples can be found in [[./examples.org][examples.org]].
|
|
|
|
|
|
|
|
#+BEGIN_SRC org
|
|
|
|
,* Idiom :vocab:idioms:
|
2018-01-15 15:11:02 +01:00
|
|
|
:PROPERTIES:
|
2018-06-10 15:13:00 +02:00
|
|
|
:ANKI_DECK: English
|
2018-01-15 15:11:02 +01:00
|
|
|
:ANKI_NOTE_TYPE: Basic (and reversed card)
|
|
|
|
:END:
|
2018-06-10 15:13:00 +02:00
|
|
|
,** Front
|
2018-01-15 15:11:02 +01:00
|
|
|
(it's) raining cats and dogs
|
2018-06-10 15:13:00 +02:00
|
|
|
,** Back
|
2018-01-15 15:11:02 +01:00
|
|
|
it's raining very hard
|
2018-06-10 15:13:00 +02:00
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
- An Anki note is an Org entry with =ANKI_NOTE_TYPE= property
|
|
|
|
- Anki tags are just Org tags [fn:1]
|
|
|
|
- Other necessary information (e.g. deck, note type) of a note is
|
|
|
|
put in the property drawer of the entry
|
|
|
|
- As the value of =ANKI_DECK= is retrieved with inheritance, you
|
|
|
|
don't have to set it per note, instead, you could create a deck
|
|
|
|
entry with this property set and put note entries under it, or
|
|
|
|
set it per file by ~#+PROPERTY: ANKI_DECK YourDeck~
|
|
|
|
- Child entries of a note entry are fields
|
|
|
|
|
|
|
|
** Commands
|
|
|
|
|
|
|
|
| Command | Brief Description |
|
|
|
|
|--------------------------------------+--------------------------------------------------------------------------------------|
|
|
|
|
| =anki-editor-push-notes= | Push notes to Anki. Additional arguments can be used to restrict the range of notes. |
|
|
|
|
| =anki-editor-retry-failure-notes= | Same as above, except that it only pushes notes that have =ANKI_FAILURE_REASON=. |
|
|
|
|
| =anki-editor-insert-note= | Insert a note entry like =M-RET=, interactively. |
|
|
|
|
| =anki-editor-cloze-region= | Create a cloze deletion from region. |
|
|
|
|
| =anki-editor-export-subtree-to-html= | Export the subtree at point to HTML. |
|
|
|
|
| =anki-editor-convert-region-to-html= | Convert and replace region to HTML. |
|
2018-02-10 14:28:57 +01:00
|
|
|
|
2018-07-06 15:10:03 +02:00
|
|
|
** Functions
|
|
|
|
|
|
|
|
| Name | Description |
|
|
|
|
|------------------------------+------------------------------------------------------------|
|
|
|
|
| anki-editor-map-note-entries | Simple wrapper that calls =org-map-entries=. |
|
|
|
|
| anki-editor-note-at-point | Construct an alist representing a note from current entry. |
|
|
|
|
|
2018-07-01 06:29:39 +02:00
|
|
|
* Limitations
|
|
|
|
|
|
|
|
** Tags between Anki and Org
|
|
|
|
|
|
|
|
Because the set of characters allowed in tags is different between
|
|
|
|
Anki and Org, you have to make sure that tags from Anki are
|
|
|
|
compatible with Org and tags in Org could be recognized by Anki.
|
|
|
|
|
|
|
|
** Working with Anki add-ons
|
|
|
|
|
|
|
|
This package may not work well when you are using certain Anki
|
|
|
|
add-ons especially those who extend the builtin Anki note editor to
|
|
|
|
automatically fill note field content (e.g. ~Add note id~).
|
2018-01-15 15:11:02 +01:00
|
|
|
|
|
|
|
* Demo
|
|
|
|
|
|
|
|
[[./demo.gif]]
|
2018-01-28 10:29:35 +01:00
|
|
|
|
2018-02-04 04:27:58 +01:00
|
|
|
|
2018-06-10 15:13:00 +02:00
|
|
|
[fn:1] It should be noted that Org only allows letters, numbers, =_=
|
|
|
|
and =@= in a tag but Anki allows more, so you may have to edit you
|
|
|
|
Anki tags before they can be used in Org without any surprise.
|