An experiment to use GitHub Copilot Coding agent to generate a Toki Pona Anki deck using Sitelen Pona
This repository contains a script to generate an Anki deck for learning Toki Pona using Sitelen Pona (the logographic writing system for Toki Pona). The deck includes all standard Toki Pona words with their definitions and their Sitelen Pona representations.
- Python 3.6 or higher
- Required Python packages:
genanki
,Pillow
(install usingpip install -r requirements.txt
) nasin-nanpa-4.0.2-UCSUR.otf
font file (should be included in the repository)- Anki desktop application (to import the generated deck)
The latest version of the Anki deck is automatically built and released whenever changes are merged to the main branch. Each release is tagged with a date and time stamp (format: YYYY.MM.DD-HH.MM.SS). You can download the most recent deck from the Releases page.
-
Clone this repository:
git clone https://github.com/johnkord/toki-pona-anki.git cd toki-pona-anki
-
Install the required Python packages:
pip install -r requirements.txt
-
Generate the Sitelen Pona images (if not already present):
python generate_images.py
-
Run the script to generate the Anki deck:
python generate_anki_deck.py
-
Import the generated
toki_pona_sitelen_pona.apkg
file into Anki.
The generated Anki deck contains four card types for each Toki Pona word:
- Word to Sitelen Pona + Definition: Shows the Toki Pona word on the front and its Sitelen Pona character, image, and definition on the back.
- Definition to Word + Sitelen Pona: Shows the definition on the front and you have to guess the word and Sitelen Pona representation on the back.
- Image to Word + Definition: Shows only the Sitelen Pona image on the front and you have to guess the word and its definition on the back.
- Word to Definition + Image: Shows the Toki Pona word on the front and you have to guess the definition and Sitelen Pona image on the back.
These card variants ensure comprehensive learning from different angles while maintaining the constraint that no card shows both the word and image together on the front side.
The deck uses authentic Sitelen Pona hieroglyphic images generated using the nasin nanpa font with proper Unicode character mappings (UCSUR F1900-F19FF).
To generate the images:
- Ensure
nasin-nanpa-4.0.2-UCSUR.otf
is in the repository root - Run
python generate_images.py
The script will:
- Use the nasin nanpa font with proper Unicode codepoints for authentic sitelen pona characters
- Fall back to placeholder images if the font is not available
- Generate optimized 200x200 PNG images for all 137 Toki Pona words
- Optimize images for web compatibility (including AnkiApp support)
- All Sitelen Pona images use authentic Unicode character mappings from the official UCSUR standard
- Images are pre-generated and embedded in the Anki deck for consistent display
- Images are optimized for web compatibility, ensuring they work in both Anki desktop and AnkiApp
- The nasin nanpa font provides the most accurate Sitelen Pona representations
- If images appear as squares with X's, the Unicode font approach failed and placeholders were used
If the Sitelen Pona images aren't showing in your Anki cards after importing the deck:
- In Anki, go to Tools > Check Media to ensure all media files are properly recognized
- Close and restart Anki to refresh the media cache
- If that doesn't work, try the following:
- Make sure you have a Sitelen Pona font installed on your system
- In Anki, edit the card template to ensure the
<img>
tags are properly formatted - Look for any error messages in Anki's browser console (Ctrl+Shift+I or Cmd+Option+I on Mac)
If images appear as broken or don't load in AnkiApp but work fine in Anki desktop:
- This has been fixed in recent versions - try downloading the latest deck from the releases page
- The images are now optimized for web compatibility with better compression and HTML attributes
- If you're building the deck yourself, make sure to regenerate both images and the deck:
python generate_images.py python generate_anki_deck.py
If the Sitelen Pona images are showing as squares with X's or generic placeholders:
- Ensure
nasin-nanpa-4.0.2-UCSUR.otf
is in the repository root directory - Regenerate the images by running:
python generate_images.py
- Regenerate the Anki deck:
python generate_anki_deck.py
- Re-import the deck into Anki
If the nasin nanpa font is not available, the script will generate placeholder images with the word names. To get authentic sitelen pona hieroglyphs:
- Obtain the
nasin-nanpa-4.0.2-UCSUR.otf
font file - Place it in the repository root directory
- Regenerate images and deck as described above
- Toki Pona language created by Sonja Lang
- nasin nanpa font by jan Same
- Unicode sitelen pona character mappings from UCSUR (F1900-F19FF)