Posted on 30 May 2024

My first Anki addon is online!

tl;dr

I updated an addon for the flashcard software Anki. It allows the user to add cute icons to customize the main window of this game-changing study tool. Here what it looks like:

There should be
a picture showing how the addon modify the main window of Anki.
The icons are from flaticon and Freepik. The background was modified using Custom Background Image and Gear Icon by The AnKing. The background picture comes from Kiki's Delivery Service, a wonderful movie about burn-out.

Below is the (mostly not interesting) story behind its creation.

Flat icons

I love flaticon. Their icons super-cute and I find comfort in their design even though thes best word to describe the style may well be “corporate”.

Once you saw a few of them, you can spot them in a wild variety of settings: on your favorite YouTuber’s videos, on posters, and on social media of course. Every time I spot one of them, I give a mental wink to the creator. What make them so prevalent is the fact that they are free to use as long as you attribute the author and the website.1 Anyway, I love them and I had to say it even though this post is surprisingly not an ad for this wonderful website.2

Of course, I tried to use them every once in a while to pimp Anki flashcards or slides for work presentations.3

Beautiful Soup

To plan for my 4th, 5th, and 6th years of medical school, I wanted to extract data from a website containing most of the material we had to learn. The goal was to do some stats on this content to get a better grasp of the task at hand. Looking for a way to do that in a “clever” way, I discovered web scraping and Beautiful Soup that allows to do that with Python. At the end of the day, I’m not sure how I’m positioned on this wonderful table by xkcd I already cited on this website.

At some other point, I finally learnt and realized that some parts of Anki are basically web pages. This includes the main window on which the list of your decks is displayed.

Everything coming together

And finally the plan was emerging: I could scrap the main window’s HTML code, identify where the deck names were stored, modify the code to add cute icons just before the deck names, and then insert this updated version back into the main window.

Surprisingly, it was not that hard to implement in an addon: the main file only has 69 lines (comments included).

For a long time, the addon only lived on my computer. At some point, I shared a .zip file version on it on a Facebook group and that was it.

But today, now that my big residency exam is over, I decided to take thing a step further and properly share it for the Anki community. Given how quick that was to do, I could have it done way sooner, but I guess some mental walls you set are hard to overcome, even though walls are 30-centimers high…

This may be an insignificant contribution, but for now, this is the best I can do to try and give back Anki and its users for all they brought me in the last few years!

I hope it will be useful to some people!

  1. Of course, there is a premium version with which you don’t have to bother with attributions. 

  2. I do hope they are not AI-generated though. I’d be tempted to say no because the website was full of icons way before we heard of Dall-E, StableDiffusion, or ChatGPT. 

  3. The trick being to spend less time choosing icons than actually working on the content. But that’s a story for another post about how I use Beamer in the least optimal way possible.