1
0
Fork
You've already forked anki
0
Stuff for my Anki cards
TypeScript 36.9%
Just 26.5%
CSS 22.1%
JavaScript 10.1%
HTML 4.4%
runiq 3750d18258 Fix sync
Anki only syncs external files (i.e. those with a `_` at the start) if
its ctime has changed [1]. Since we cannot easily update the ctime of an
existing file, we just delete all files from the target directory and
copy them anew.
This is wasteful for big files, so a future optimization could rely on
checksums to see whether a file has changed and should be recreated.
[1] https://docs.ankiweb.net/syncing.html#media 
2025年01月04日 16:51:12 +01:00
assets Russian: Show stress marks on question side of card 2025年01月04日 16:51:12 +01:00
.gitignore Initial version 2024年08月27日 16:11:34 +02:00
build.mjs Add Russian 2024年12月23日 18:37:55 +01:00
env.example Add an example .env file 2024年12月18日 19:21:48 +01:00
Justfile Fix sync 2025年01月04日 16:51:12 +01:00
LICENSE Add some initial bits 2024年08月26日 16:38:22 +02:00
package.json Add Russian 2024年12月23日 18:37:55 +01:00
pnpm-lock.yaml Initial version 2024年08月27日 16:11:34 +02:00
README.md push -> deploy 2024年12月23日 18:38:18 +01:00
tsconfig.json Explicitly type markdown-it-mark 2024年08月28日 13:58:55 +02:00
untyped.d.ts Explicitly type markdown-it-mark 2024年08月28日 13:58:55 +02:00

Javascript modules for my Anki cards, currently allowing Markdown rendering.

Prepare

This project uses the pnpm package manager. You can either install it manually:

npm install -g pnpm

Or you can have corepack install it on the fly:

npm install -g corepack
corepack enable

Build

npx just build

The built files are in the dist folder. They start with a _ to make them persistent when syncing with Anki.

All dependencies are bundled in a single module file roughly 1.2MiB in size. Anki will reload the whole 1.2 MiB of Javascript on every card flip.

Deploy

Have the ANKI_MEDIA_DIR variable in the .env file point to your Anki user's media directory:

ANKI_MEDIA_DIR="$HOME/.var/app/net.ankiweb.Anki/data/Anki2/Benutzer 1/collection.media/"

Then build the bundles and push them to the directory:

npx just deploy

Licensing

For this project's license, see LICENSE.md. The EuroScript font is licensed under the Open Font License.