AnkiWeb
- Rating
- 1 (π 0 Β· π 1)
- Updated
- 2025-12-26
- Anki versions
- 2.1.50~
- Description language
- en
AnkiWeb addon 1035866113
Brings AnkiDroid's JavaScript template API to Anki Desktop, enabling interactive card templates with programmatic control over reviewer, text-to-speech, card actions, tags, and UI.
Open on AnkiWeb GitHub Ask about alternatives
stale
| Min Anki | Max Anki | Updated |
|---|---|---|
| 2.1.1 | 2.1.50+ | 2025-12-26 |
Loadingβ¦
Build sentences by arranging interactive word tiles in Anki, with customizable layout, keyboard shortcuts, answer checking, automatic reveal, and cross-platform card support.
Reveals Anki cloze deletions progressively one at a time or with nearby context visible, adding optional images, audio, info, explanations, and customizable controls across Anki clients.
Renders Markdown in Anki Front/Back fields as interactive quizzes with fill-in, multiple choice, reveals, collapsible sections, tabs, highlighting, code, KaTeX, audio, and floating review controls.
Creates interactive multiple-choice dropdown quizzes in Anki with shuffled answer choices, customizable distractors, optional hints, and cross-device review.
Turns compatible MCQ note types into a UWorld-style question bank with answer-once retirement, recovery, analytics dashboard, diagnostics, and responsive mobile review.
Brings experimental spaced-repetition schedulers including SM-2, SM-15, SM-19, SM-20, FSRS v6, and an Arena ensemble to Anki Desktop for scheduling experiments.
A desktop Anki add-on that brings AnkiDroid's powerful JavaScript template API to Anki Desktop, enabling advanced interactive card templates with programmatic control over the reviewer, TTS, card actions, and more.
Tags: javascript api ankidroid templates tts interactive programming developer mobile-compatibility text-to-speech card-templates reviewer-control
This add-on implements the AnkiDroidJS API for desktop Anki, providing:
This add-on requires Anki Desktop to be installed separately. It is designed to work with:
Important: This add-on extends Anki Desktop and does not include Anki itself. You must download and install Anki separately from apps.ankiweb.net.
License Note: Anki Desktop is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). However, per Anki's plugin policy, add-ons may use any license and are not subject to the AGPL requirements.
1035866113.ankiaddon fileClone this repository:
git clone https://github.com/gallaway-jp/AnkiJSApi.git
cd AnkiJSApi
Create a symbolic link to your Anki addons folder:
Windows:
mklink /D "%APPDATA%\Anki2\addons21\ankidroid_js_api" "path\to\ankidroid-js-api-desktop\src\ankidroid_js_api"
macOS/Linux:
ln -s "$(pwd)/src/ankidroid_js_api" "$HOME/.local/share/Anki2/addons21/ankidroid_js_api"
Restart Anki
Initialize the API in your card template's script section:
<script>
// Initialize the API
const api = AnkiDroidJS.init({
developer: "your-email@example.com",
version: "0.0.3"
});
// Use the API
async function loadCardInfo() {
const cardId = await api.ankiGetCardId();
const reps = await api.ankiGetCardReps();
console.log(`Card ${cardId} has been reviewed ${reps} times`);
}
loadCardInfo();
</script>
<!-- Front Template -->
<div class="question">{{Front}}</div>
<button onclick="playTTS()">π Speak</button>
<div id="stats"></div>
<script>
const api = AnkiDroidJS.init({
developer: "learner@example.com",
version: "0.0.3"
});
async function playTTS() {
await api.ankiTtsSpeak("{{Front}}", 0);
}
async function showStats() {
const newCards = await api.ankiGetNewCardCount();
const revCards = await api.ankiGetRevCardCount();
const eta = await api.ankiGetETA();
document.getElementById('stats').innerHTML =
`${newCards} new, ${revCards} review, ${eta} min remaining`;
}
showStats();
</script>
<!-- Back Template -->
{{FrontSide}}
<hr>
<div class="answer">{{Back}}</div>
<button onclick="markDifficult()">Mark Difficult</button>
<script>
async function markDifficult() {
await api.ankiToggleFlag("red");
await api.ankiShowToast("Flagged as difficult");
}
</script>
See the API documentation for complete reference, or browse the full documentation.
ankidroid-js-api-desktop/
βββ src/
β βββ ankidroid_js_api/
β βββ __init__.py # Add-on entry point
β βββ api_bridge.py # JavaScript API bridge
β βββ card_info.py # Card information APIs
β βββ card_actions.py # Card action APIs
β βββ reviewer_control.py # Reviewer control APIs
β βββ tts_control.py # Text-to-speech APIs
β βββ ui_control.py # UI control APIs
β βββ tag_manager.py # Tag management APIs
β βββ utils.py # Utility functions
β βββ js/
β β βββ ankidroid-api.js # JavaScript API implementation
β βββ manifest.json # Add-on manifest
β βββ config.json # Default configuration
βββ tests/ # Unit tests
βββ docs/ # Documentation
βββ LICENSE # MIT License
βββ README.md # This file
βββ setup.py # Package setup
βββ requirements-dev.txt # Development dependencies
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
python -m pytest tests/
# Run with coverage
python -m pytest --cov=src/ankidroid_js_api tests/
# Build the add-on package
python setup.py build_addon
# The .ankiaddon file will be in the dist/ directory
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see the LICENSE file for details.
This add-on is designed to extend Anki Desktop, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). However, per Anki's plugin policy, add-ons may use any license. This add-on does NOT distribute Anki and must be used with a separately installed copy of Anki Desktop.
For detailed license compliance information, see LICENSE_COMPLIANCE.md and NOTICE.
Runtime Dependencies: None (uses only Python standard library and Anki's built-in APIs)
Development Dependencies: See requirements-dev.txt - MIT, BSD, Apache-2.0 licenses
If you encounter any issues or have questions:
See CHANGELOG.md for version history.