A simple little tool to convert specifically formatted markdown to a format that can be imported by anki into flash cards.
# install
npm i -g markdown-to-anki
# print formatted cards to stdout
markdown-to-anki flashcards.md
# save cards as a file
markdown-to-anki flashcards.md > flashcards.txt
# then go open flashcards.txt with your anki app
When importing the cards, make sure the checkbox for "Allow HTML in fields" is checked.
This tool expects your markdown to be specifically formatted, and deviations from this format could cause it to break in unexpected ways, or produce "bad" output.
Each card has a front and a back. The front and back are separated by a newline, three dashes, and another newline:
---
And each card is separated by newlines surrounding three equals signs:
===
The front or back of a card can have any markdown you wish. This tool uses marked to parse the markdown and generate html. Here's an example:
Here is a question for the first card:
---
And here is the answer
===
This is a question on the second card
---
and yet another answer
===
Here's a card
with multiple paragraphs
---
- and
- a
- bulleted
- list