- Plug Kindle into the computer.
- Open the terminal.
- Download this repository and navigate to its folder:
cd ./kindle-flashcards
. - Execute
./bin/export
. This will create files with words and quotes for each book and save them to./output
. - To add translations, run
FROM_LANG=de TO_LANG=en ./bin/translate output/Schachnovelle.txt > flashcards.txt
. - ...
- The flashcards are ready!
- Create a new deck or use an existing deck.
- Import the flashcards file (File -> Import).
The flashcards file looks like this:
staubig staubig Sein langer grüner Umhang war staubig und verschlissen. Sein langer grüner Umhang war {{c1::staubig}} und verschlissen. dusty
The file has five fields:
- The base form of the word (i.e. infinitive for verbs, nominative singular for nouns etc).
- The original word form.
- The sentence where the word was encountered.
- The same sentence with the word clozed out. See Cloze Deletion in the Anki manual.
- The translation of the word.
The final result may look like this:
You can also add recordings of words' pronunciations to your cards. Run the following command:
./bin/add-audio flashcards.txt > flashcards_with_audio.txt
The audio will be saved into ./output/audio
. Copy the audio files into the Anki media collection directory (typically ~/Documents/Anki/User 1/collection.media
).
Audio files are downloaded from Wiktionary and encoded from ogg to mp3. Please note that this requires ffmpeg
to be installed on your system (e.g. brew install ffmpeg
).
However, you can simply add this JavaScript to your card layout to enable the built-in text-to-speech:
<script>
var speech = new SpeechSynthesisUtterance();
speech.text = '{{Front}}';
speech.lang = 'de-DE';
speechSynthesis.speak(speech);
</script>