Giter VIP home page Giter VIP logo

ankifier's Introduction

ankifier

Efficiently create Anki flashcards from your notes.

I created this package to facilitate faster creation of Anki cards while I study utilizing the fantastic text editing of Emacs.

Screencast

screencasts/ankifier-basic.gif

Contents

Installation

Dependencies:
  • expand-region.el (link).

Recommended package:

  • anki-editor While not required, this is the anki-editor package that allows the output of my package to be sent to Anki (utilizing the AnkiConnect addon).

Then put this file in your load-path, and put this in your init file:

Clone the repository.

git clone https://www.github.com/adham-omran/ankifier

Load the package.

(load! "/path/to/ankifier/ankifier.el")
(require 'ankifier)

Usage

Run one of these commands on an active region:

  • ankifier-create-basic-from-region: Create Basic question(s) from active region.
  • ankifier-create-cloze-from-region: Create Cloze question(s) from active region.
  • ankifier-create-from-region: Parse basic and cloze questions in the active region.

Variables

  • Set ankifier-insert-elsewhere to t if you want the questions to be created under a * Cards org heading (This is what I mostly do).

    The name of the heading can be modified through ankifier-cards-heading.

  • Set ankifier-context-question to t if you want to use contextual questions, see examples for uses.
  • Set ankifier-feedback to t if you notes you ankify to have ANKIFIED at the start of the text to indicate that this has been ankified. Useful when you return to your notes after a while and wonder if you Ankified something or not.
  • ankifier-anki-cloze-note-type sets the card type for cloze cards.
  • ankifier-anki-basic-note-type sets the card type for basic cards.

For a basic question, the questions must be separated by two newlines and have a single question mark to indicate the Question part and the Answer part.

For a cloze question, the sentences must be separated by two new lines.

Examples

Normal Format

What is Emacs?
An extensible, customizable, free/libre text editor — and more.

When was Emacs 27.2 released?
Mar 25, 2021.

Emacs is an {{c1::extensible}}, {{c2::customizable}}, free/libre {{c2::text
editor::application type}} — and more.

Contextual Question Format

Context: Question?
Context: Cloze.

Geography: What's the capital of France?
Paris.

Geography: {{c1::Paris}} is the capital of France.

This results in the “:” being replaced with two newline characters.

Example Config

This is the config I’m using at the moment.

(setq ankifier-insert-elsewhere t
      ankifier-anki-basic-note-type "E-Basic"
      ankifier-anki-cloze-note-type "E-Cloze"
      ankifier-feedback t
      ankifier-context-question t)

Tips

Development

Changelog

  • 1.4.2: Fix a bug where a space after :: broke cloze deletion cards.
  • 1.4.1: Fix bug with multiple ‘:’ in a question for the basic card type.
  • 1.4.0: Add the function ankifier-find-to-be-ankified. Remove dependency on cl-lib.
  • 1.3.0: Add the function ankifier-create-from-region.
  • 1.2.0: Add the ability to include feedback for ankified notes.
  • 1.1.0: Add the ability to format contextual questions.
  • 1.0.0: Initial release.

Acknowledgments

This package would not have been possible without anki-editor, which allows the flash cards to be sent to Anki in the first place.

Development

Bug reports, feature requests, suggestions are all welcome, keep in mind this is my first Emacs package!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.