Skip to main content

A utility for converting Markdown into Anki cards

Project description

# 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ankdown-0.4.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

ankdown-0.4.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file ankdown-0.4.1.tar.gz.

File metadata

  • Download URL: ankdown-0.4.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for ankdown-0.4.1.tar.gz
Algorithm Hash digest
SHA256 f02cda2baaec6a872a0f6ef45ece65f685e519c5679fc5337c6fbb5fecfcc618
MD5 61355bb9958dacb8f3de7ed6319a4a3a
BLAKE2b-256 84f91fd3a2fc018e198d173d6ac2b07962d4459fb61b39a4e139cb8147b2a25a

See more details on using hashes here.

File details

Details for the file ankdown-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: ankdown-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for ankdown-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 01ac310ea58826816b3d50f1034b85a8098ba8a9041c34a72cc3a0e637a19a9e
MD5 b006afc9a0256321ab2367b54e8e1057
BLAKE2b-256 25171f815fdaf9ffff2941c83744fa50fc6756648fe1aa8665bb408847941c55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page