-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Extra JS API functionality by silidev
silidev edited this page Jun 12, 2024
·
5 revisions
For my own project I wrote for the AnkiDroid JS API:
- TypeScript type definitions: https://github.com/silidev/HelgeUtils/blob/main/Anki.d.ts
- A wrapper for the API which does many things, including fixing bugs and checking types: https://github.com/silidev/HelgeUtils/blob/main/AnkiUtils.ts or compiled: https://github.com/silidev/HelgeUtils/blob/main/dist/AnkiUtils.js
- I offer only very limited support for this, when I find time. Use at your own risk. I license it under the same license as AnkiDroid. If you are interested in this, please write about it here: https://forums.ankiweb.net/t/js-api-discussion/44907 . Because as long as nobody is using this anyway, I will be pretty careless with breaking changes and probably forget to push my updates to GitHub.
I also have a wrapper around the TTS API. Most of it is in AnkiUtils.ts (link above). Some I have not published it yet, b/c it is currently tightly coupled with code not suitable for publishing. If any developer is interested to do something with this, I will try to find the time to publish more. It has these features:
- Speak only text, all html tags are not spoken.
- Pause after each sentence.
- Correct bad pronunciation by replacing a list of words with phonetic spelling.
- Set the correct language for each note by tags.
- Speak the card forever in a loop.
- Blacken the screen and option lock inputs while speaking.
- Semi automatic build from IDE: https://forums.ankiweb.net/t/mostly-automatic-build-into-anki-with-preprocessor-from-ide-and-testing-in-browser/35262