Skip to content

Synchronization with Anki

sysid edited this page Feb 25, 2024 · 1 revision

After the cards are added to Anki, inka2 will add an html comment to each card with the Anki card ID:

---

Deck: Default

Tags: learning life-questions

<!--ID:1615298747303-->
1. What is the answer to the Ultimate Question of Life, the Universe, and Everything?

> 42

<!--ID:1615298747314-->
2. If it looks like a duck, swims like a duck, and quacks like a duck, then what is it?

> It is a duck!

---

If you then use inka2 on the same file, it will send all changes (if any) in cards to Anki.

⚠️ Sync from Anki to your markdown file is not implemented and probably won't be, because there are many pitfalls in the process. This means that any changes to card in Anki will be overwritten during next sync. If you delete a card in Anki but not in a file, the next time you sync, you will receive an error that the card was not found by its ID.

If you already have some of your cards from markdown file in Anki and want to enable sync for them (or you accidentally deleted IDs yourself), use -u/--update-ids flag with collect command:

inka2 collect --update-ids path/to/file.md

The IDs of the cards that were found in Anki will be added to the file (cards are searched for by the front field).

Clone this wiki locally