Anki Add-on Template
Anki add-on template for my projects.
Overview
- The template is implemented using Copier.
- The ankiscripts project is used for various tasks, such as initializing the template, installing dependencies, generating forms and packaging the add-on.
- Source files are in the src folder. The add-on zip contains all contents of this folder.
- Qt Designer files (if any) are in designer folder. Generated Python forms are written to src/forms.
- An addon.json file is used for metadata, similar to Glutanimate's add-on builder. manifest.json is produced from this file.
- Uv is used to manage requirements in pyproject.toml.
- Ruff is used for linting and formatting.
- Tests are in the tests folder.
- a justfile is used to run build & lint commands.
- There's optional support for TypeScript/Svelte/SvelteKit under the ts folder.
- CHANGELOG.md follows the Keep a Changelog format.
- The description for the AnkiWeb listing is in ankiweb_page.html. ankiwebify-readme can be used to convert some sections of README.md to the HTML accepted by AnkiWeb.
- mdBook is used for docs generation. See the docs folder.
- The add-on is licensed under GNU AGPLv3.
Setup
- Install
ankiscripts:uv tool install git+https://github.com/abdnh/ankiscripts[template] - Create a new folder and run the following command to initialize the template:
uv run init_anki_addon. This runs Copier and asks you a few questions such as add-on name. It also sets up the.vscodefolder for VS Code. - Run the add-on using VS Code's launch configuration or manually using the command:
uv run -m ankiscripts.run -b ankidata. This creates a symlink to the add-on'ssrcfolder inside theankidataAnki data base folder and launches Anki.
On this page
Languages
Jinja40.6%Python25.7%JavaScript13.3%TypeScript9.9%Just8.2%HTML1.3%CSS0.7%Svelte0.3%
Created March 29, 2023
Updated February 28, 2026