Card Types¶
anki_deck_from_text ships with two built-in card models. You can also add your own.
Built-in models¶
basic¶
The default model. Shows the question on the front and reveals the answer on the back.
- Fields: Question, Answer
- Template: Front shows
{{Question}}, back shows{{FrontSide}}+{{Answer}}
sound¶
A model designed for audio-based cards. The front shows the question with a type-in answer field, and the back can include a sound file.
- Fields: Question, Answer, Sound
- Template: Front shows
{{Question}}with{{type:Answer}}, back includes{{Sound}}
Note
The Sound field is currently populated as an empty string. To use audio, you would need to manually add sound files to the cards in Anki after import, or extend the tool to support media files.
Adding a custom card model¶
You can add new card types by editing models.py:
-
Define a new
genanki.Modelwith a hardcoded unique model ID: -
Add it to the
MODELSdict: -
Add any extra fields (beyond Question and Answer) to
EXTRA_FIELDS: -
Done -- the CLI
--card_modeloption dynamically reads fromMODELS, so your new model is automatically available: