Skip to main content
# Ankdown

A simple way to write Anki decks in Markdown.

## What This Is

[Anki](https://apps.ankiweb.net) is awesome, in many ways.
However, its card editor is... a little bit uncomfortable.
I really wanted to write Anki cards in Markdown. So I made
a tool to convert Markdown (+ standard MathJAX math notation)
into Anki decks that can be easily imported. This way, it's
possible to use any fancy markdown (and MathJAX) tools to build
your decks.

## How to use it

**NOTE** This program requires _Python 3_, along with the
packages in requirements.txt

## Installing

Ankdown can be installed by doing `pip3 install ankdown`.

## Writing Cards

Cards are written in the following format:

```markdown
Expected Value of $f(x)$

%

$$\mathbb{E}[f(x)] = \sum_x p(x)f(x)$$

%

math, probability

---
```

Each of the solitary `%` signs is a field separator: the first
field is the front of the card by default, the second field is
the back of the card, and subsequent fields can contain whatever
you want them to (all fields after the second are optional).

Each of the `---` (or double `%%`) signs represent a card boundary.

The tool only needs these separators to be alone on their own lines,
but most markdown editors will work better if you separate them from
other text with empty lines, so that they're treated as their own
paragraphs.

## Running Ankdown

To compile the cards, put them in a file (e.g. `notes.md`), and run
`ankdown -p notes.apkg -d Notes -i notes.md`. This will create a file,
"notes.apkg", containing a deck called "Notes".

You can also specify a directory (by passing `-r DIR`) to walk
recursively, accumulating cards from all files named "*.md".

To add them to Anki, go to File > Import, and select the file you created
(e.g. `notes.apkg`).

**IMPORTANT**: When using the text format rather than the .apkg
(not recommended) make sure that the separator is set to `\t`,
you've selected the deck you want to modify, and that "Allow HTML"
is checked.

Press "Import", and you should be good to go.

## Updating Cards

When you want to modify a card, just run your deck through the above
process after changing the markdown file. Anki should notice, and update
the card. This is done by giving the cards in your deck sequential IDs.
This breaks down when you want to _remove_ a card, though. In that
case, you'll want to delete the whole deck and reload it.

Release files for ankdown 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ankdown 0.3.0
File Size Uploaded
ankdown-0.3.0.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ankdown 0.3.0
File Interpreter ABI Platform
ankdown-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.2 kB

Release files / ankdown-0.3.0.tar.gz

Download URL ankdown-0.3.0.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8dcda7909767f1f9cbd7b5b44ae64f63405285f108ffc13b61d417721467ddbb
BLAKE2b-256 checksum
How to use checksums
9233f743ed29520c7b35302eb0e5c2c97dfdb6b512e3963166060956adc2009e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ankdown-0.3.0-py3-none-any.whl

Download URL ankdown-0.3.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48645f678c6604e5e82bad3d4d6af0655517fb1d1f7ed8396de28ca1a0c6561a
BLAKE2b-256 checksum
How to use checksums
cd2ccc5bcf99359d5e36fc63d093f6ffdeea034dd6bc4d3b2720258a3aec497d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.7.1

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page