All Projects â†’ repeat-space â†’ anki-apkg-export

repeat-space / anki-apkg-export

Licence: other
📖 Generate decks for Anki (spaced repetition software)

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to anki-apkg-export

awesome-supermemo
A list of resources which can be used with SuperMemo.
Stars: ✭ 72 (-41.94%)
Mutual labels:  spaced-repetition, srs
Anki Android
AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
Stars: ✭ 4,425 (+3468.55%)
Mutual labels:  srs, anki
memanki-cli
CLI implementation of memanki
Stars: ✭ 21 (-83.06%)
Mutual labels:  srs, anki
inka
Command-line tool for adding flashcards from Markdown files to Anki
Stars: ✭ 30 (-75.81%)
Mutual labels:  spaced-repetition, anki
anki-md
A markdown to anki flash cards converter
Stars: ✭ 22 (-82.26%)
Mutual labels:  spaced-repetition, anki
roamsr
Spaced Repetition in Roam Research
Stars: ✭ 96 (-22.58%)
Mutual labels:  spaced-repetition, srs
speed-focus-mode
Speed Focus Mode add-on for Anki
Stars: ✭ 19 (-84.68%)
Mutual labels:  srs, anki
mpvacious
Adds mpv keybindings to create Anki cards from movies and TV shows.
Stars: ✭ 286 (+130.65%)
Mutual labels:  spaced-repetition, anki
ForgetMeNot
A flashcard app for Android.
Stars: ✭ 234 (+88.71%)
Mutual labels:  spaced-repetition, anki
cramkle
Web-based flashcard studying app
Stars: ✭ 26 (-79.03%)
Mutual labels:  spaced-repetition, srs
notes
A miscellany of thoughts.
Stars: ✭ 18 (-85.48%)
Mutual labels:  spaced-repetition, anki
LibraryNotes
Library Notes is an open source application to help you track and remember what you read.
Stars: ✭ 28 (-77.42%)
Mutual labels:  spaced-repetition
twsr
Standalone Spaced Repetition System for TiddlyWiki
Stars: ✭ 15 (-87.9%)
Mutual labels:  spaced-repetition
deepcourse
Learn the Deep Learning for Computer Vision in three steps: theory from base to SotA, code in PyTorch, and space-repetition with Anki
Stars: ✭ 117 (-5.65%)
Mutual labels:  anki
smashtraining
Spaced repetition trainer for Super Smash Bros. Ultimate techniques.
Stars: ✭ 18 (-85.48%)
Mutual labels:  spaced-repetition
Lazycard
A simple flashcard application where cards are formatted with Markdown.
Stars: ✭ 18 (-85.48%)
Mutual labels:  spaced-repetition
obsidian-spaced-repetition
Fight the forgetting curve by reviewing flashcards & entire notes on Obsidian.md
Stars: ✭ 667 (+437.9%)
Mutual labels:  spaced-repetition
spaced-inbox
A minimal spaced writing inbox
Stars: ✭ 30 (-75.81%)
Mutual labels:  spaced-repetition
ssmtool
Simple sentence mining tool for language learning
Stars: ✭ 92 (-25.81%)
Mutual labels:  spaced-repetition
alfred-anki
Create New Cards into any decks with any "Note Type".
Stars: ✭ 42 (-66.13%)
Mutual labels:  anki

anki-apkg-export

Build Status

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 = require('fs');
const AnkiExport = require('anki-apkg-export').default;

const apkg = new AnkiExport('deck-name');

apkg.addMedia('anki.png', fs.readFileSync('anki.png'));

apkg.addCard('card #1 front', 'card #1 back');
apkg.addCard('card #2 front', 'card #2 back', { tags: ['nice', 'better card'] });
apkg.addCard('card #3 with image <img src="anki.png" />', 'card #3 back');

apkg
  .save()
  .then(zip => {
    fs.writeFileSync('./output.apkg', zip, 'binary');
    console.log(`Package has been generated: output.pkg`);
  })
  .catch(err => console.log(err.stack || err));

browser

Intended to be used with webpack

const webpack = require('webpack');

module.exports = {
  entry: './index.js',
  module: {
    loaders: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel'
      },
    ]
  },
  plugins: [
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development')
      },
    })
  ],
  output: {
    path: __dirname,
    filename: 'bundle.js'
  }
};

Required loaders:

import { saveAs } from 'file-saver';
import AnkiExport from 'anki-apkg-export';

const apkg = new AnkiExport('deck-name');

// could be a File from <input /> or a Blob from fetch
// take a look at the example folder for a complete overview
apkg.addMedia('anki.png', file);

apkg.addCard('card #1 front', 'card #1 back');
apkg.addCard('card #2 front', 'card #2 back', { tags: ['nice', 'better card'] });
apkg.addCard('card #3 with image <img src="anki.png" />', 'card #3 back');

apkg
  .save()
  .then(zip => {
    saveAs(zip, 'output.apkg');
  })
  .catch(err => console.log(err.stack || err));

Examples

Changelog

  • v4.0.0 - expose template variables (frontside, backside and css)
  • v3.1.0 - make setting APP_ENV optional
  • v3.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

License

MIT © ewnd9

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].