Stuff for my Anki cards
|
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 |
||
|---|---|---|
| assets | Russian: Show stress marks on question side of card | |
| .gitignore | Initial version | |
| build.mjs | Add Russian | |
| env.example | Add an example .env file | |
| Justfile | Fix sync | |
| LICENSE | Add some initial bits | |
| package.json | Add Russian | |
| pnpm-lock.yaml | Initial version | |
| README.md | push -> deploy | |
| tsconfig.json | Explicitly type markdown-it-mark | |
| untyped.d.ts | Explicitly type markdown-it-mark | |
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.