GithubHelp home page GithubHelp logo

rickity-cricket / org_to_anki Goto Github PK

View Code? Open in Web Editor NEW

This project forked from c-okelly/org_to_anki

0.0 2.0 0.0 91 KB

Python3 module to convert Org files into Anki notes

License: MIT License

Python 100.00%

org_to_anki's Introduction

org_to_anki

Build Status codecov

Python module to convert org files into Anki question decks.

Provides two command line scripts to upload org files and take new basic notes quickly.

Based on AnkiConnect. An addon for Anki that provides a HTTP api for Anki.

Contents

  1. Requirements
  2. Installation
  3. Comannd line scripts
  4. Org file syntax
  5. Default values
  6. Running tests
  7. Future features

Requirements

  1. Have Anki app installed.

  2. Installing the Anki plugin AnkiConnect.

    i. For OSX users of anki-connect see note for OSX users

    ii. For Windows users of anki-connect see notes for Windows users

Installation

To install this module from source.

  1. git clone https://github.com/c-okelly/org_to_anki
  2. cd into the module directory
  3. python3 setup.py install

Command line scripts

org_to_anki

org_to_anki
  • Upload the default org file to Anki
org_to_anki /path/to/your/org/file.org
  • Upload the specified file to Anki

ankiq

  • New questions are added to the default file stored at ~/orgNotes/quickOrgNotes.org
  • This file is created by default if it does not already exist
ankiq
  • Will start a Python input reply.
  • Takes a questions and a series of anwers
  • Empty line add a new question to the default org file

Org file syntax

  • Currently supports two different types of org files
  • All questions and answers should start with an asterix
  • All comment lines start with a #
# Line comments
* Question
** Answer
  • Each org file will be converted into its own deck in Anki

Global Parameters

  • Parameters to be inherited by all questions / decks should be specified at the top file.
  • These will be overwritten by parameters lower down the tree.
# Basic Example
# type=Basic

* Question
** Answer
* Second Question
# type=Basic (and reversed card)
** Second Answer

Basic org file syntax

  • Sample answer and question in org file
* What is the capital of Ireland?
** Dublin

Topics file syntax

  • Each topic will be turned into its own subdeck. The name of this deck is given by the first line. E.G Capitals cities and Spoken languages.

  • Allows for a group of related topics to be managed in a single file.

  • Sample answer and questions for topics org file.

* Capital cities
** What is the capital of Ireland?
*** Dublin
* Spoken languages
** What are the main spoken languages in Ireland?
*** English
*** Irish

Parameters

  • Supported parameter syntax.
  1. Each line must start with a hashtag
# type=Basic
# type = Basic
  • Currently supported parameters are questions type
  1. Org file type
  • By default all org files will be of basic type.
  • If you want to use a topics layout must be specified at the top of the file.
# Comment line
# fileType=topics

* Topics 1
** Questions 1
*** Answer 1
  1. Question type. Used to set the type of the Anki note. i. Default value is Basic
# type=Basic
# type=Basic (and reversed card)

Parameter inheritance

  • Questions and decks will inhert parameters from parent Decks
  • Parameters inhereted will not override existing parameters.

Config values

  • Config in project root contains all the default values for running
  • Default org file is located at ~/orgNotes/quickOrgNotes.org
  • Default anki-connect url is http://127.0.0.1:8765/

Testing

A number of extra libraries are used in testing

  • To run unittests
python3 setup.py nosetests

Future features

  • Check to see if note exists before sending to Anki
  • Expanded support for different paramters types
  • If you have a feature you would like to see please open an issue!

org_to_anki's People

Contributors

c-okelly avatar rickity-cricket avatar

Watchers

 avatar  avatar

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.