anki-apkg-export
Universal module for generating decks for Anki.
Port of the Ruby gem https://github.com/albertzak/anki2
Install
$ npm install anki-apkg-export --save
Usage
server
const fs = ;const AnkiExport = default; const apkg = 'deck-name'; apkg; apkg;apkg;apkg; apkg ;
browser
Intended to be used with webpack
const webpack = ; moduleexports = entry: './index.js' module: loaders: test: /\.js$/ exclude: /node_modules/ loader: 'babel' plugins: 'process.env': NODE_ENV: JSON output: path: __dirname filename: 'bundle.js' ;
Required loaders:
;; const apkg = 'deck-name'; // could be a File from <input /> or a Blob from fetch// take a look at the example folder for a complete overviewapkg; apkg;apkg;apkg; apkg ;
Examples
- server from above
- browser from above
- browser usage with media attachments via ajax
- browser usage with media attachments via
Changelog
v4.0.0
- expose template variables (frontside, backside and css)v3.1.0
- make setting APP_ENV optionalv3.0.0
- add tags, ES6 refactor (breaking)v2.0.0
- add media support, update jszip dependency (breaking)v1.0.0
- initial rewrite
Tips
- issue#25 - Dealing with
sql.js
memory limits
Related
- apkg format documentation
- anki-apkg-export-cli - CLI for this module
- anki-apkg-export-app - Simple web app to generate cards online
License
MIT © ewnd9