Git Product home page Git Product logo

server's Introduction

2anki/server

The goal of the 2anki.net project is to provide a good way to make Anki flashcards easier, better and faster. The dream is to have powerful and easy ways to produce high quality flashcards. This project is a complement to Anki and Notion.

For the frontend code, please see 2anki/web.

Strategy

My Thoughts on The Future of Anki Collaborative Deck Creation

What We Are Not

If you are looking for a Anki or Notion replacement then this project is probably not right for you. Watch this video Notion + Anki to understand the project's goal. We are never going to compete against Anki in this project. We are building bridges 🌁

When that is said, if you are not content with Anki, you might want to checkout SuperMemo.

Benefits

  • No technical skills required and free to use by anyone anywhere 🤗 *
  • You can convert your Notion toggle lists to Anki cards easily.
  • Support for embeds, audio files, images and more.

* Please note that due to server costs, there are quota limits in place but you can workaround this and self-host

🎁 Support the Project

This project is brought to you by our amazing patrons and GitHub sponsors 🤩 Thank you!

Patreon ko-fi Buy Me A Coffee

GitHub Sponsor Paypal

You can also support the project financially and receive exclusive member benefits ✨

How it works

We treats toggle lists on the top level as Anki flashcards. The toggle list line is the front of the card and everything inside in the details is the back. That's the main feature but you can customize the behaviour via card options.

Considering how powerful cloze deletions are, they are enabled by default. To see how this works in action check out this video by Alp Kaan: How to use cloze deletions in notion2anki 🤩

You can use the card type to flip which creates a mix of the cards. Basic (front & back), basic + reversed and just reversed.

So by default we are reading in the Notion styles which does not necessarily look good on all devices. Especially on iOS you can see some weird text alignment issues. Those can be solved by adding this to your card template:

body {
  padding: 1rem;
  text-align: left;
}

Background

This project was hacked together after seeing this post on Reddit by jacksong97:

Hey guys just need a little help with something.

I have a whole bunch of questions that I've written for myself within Notion (nested toggle questions). I was hoping I could transfer them into Anki cards fairly painlessly. I have done some just copying and pasting each side separately but it just took too long.

Is there a way to import directly or copy and paste into a txt file or something that will create the cards for me?

Thanks!

Edit: if I were to just turn them into a text file, how do I set which text goes to the back of the card? I’ve been able to get them all into seperate cards but just the fronts

https://www.reddit.com/r/Anki/comments/g29mzk/cards_imported_from_notion/

Limitations

We are still heavily relying on the APKG format. Long term we want to support AnkiWeb and make it possible to do true realtime collaboration.

Star History

Star History Chart

Credits

Special thanks to following developers / artistans


Alexander Alemayhu

💻 👀 📖 📹

Alp Kaan Aksu

💻 📹

Mads Cordes

💻

Guillem Palau-Salvà

💬 🤔

Marcel Walk

💻

License

Unless otherwise specified in the source:

The code is licensed under the MIT Copyright (c) 2020-2023, Alexander Alemayhu

server's People

Contributors

aalemayhu avatar alpkaanaksu avatar dependabot[bot] avatar guillem-palau-salva avatar imgbotapp avatar maximus0000 avatar mobilpadde avatar nyasakiat avatar renni771 avatar secretmud avatar tdp17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

server's Issues

Read the Anki Manual

I mostly a fairly basic user of Anki. Notion is my go to place to for writing, notes, etc. Reading up on the manual will help me better plan the state management of the tool.

Full Support for Markdown & CSV Export

There are bugs here and there but I feel like the Markdown support is getting there. For the CSV, I have not really used the tables so much so need to look into this in Notion.

Update the state management

I am experiencing issues with Imba so can't really do this yet but either way I still need to finish reading the Anki manual but will use this issue to flesh out the details.

There are primarily three main states the application can be in

  1. Ready to receive local uploads
    • User picks local file
    • User cancels local upload (leaving the page, closing tab, etc.)
  2. Upload in progress
    • Decks being created
    • Error app crashes and hangs
  3. Exported
    • Download of zip file is produced from the decks
    • Or app hangs due to crash

So the current flow is not so robust and makes it easy to leave the user hanging. There should be better transitions between the three and proper error handling.

Follow ups

  • Should we prevent user from leaving the page when upload / processing is in progress?
  • If subpages are detected should we ask user if they want to create multiple decks?

Related-to: #11

Reduce the bundle size

The current size of the built JavaScript is 6.1M which is a lot. This is likely due to the dependencies. Would be nice to get this resolved in web pack.

Image sizing

In Notion you can resize images, but those fields are not available in the Markdown, IIRC.

A couple of options I am thinking of doing:

  • Let the user set a default size for a cards
  • See previews of the cards and be able to overwrite the size individually also
  • Provide option to import via HTML which would produce exactly the same as Notion

Dark Mode

I have started redesigning the app and it would be nice to be able to invert the colours when using it late at night.

Support HTML

Currently we only support the Markdown & CSV export which is very limiting with regards to styling. Sizes and colors won't match among other things.

More defensive statements

Based on the emails I’ve been receiving recently, some crashes are occurring due to null related exceptions. I think we can handle these cases by not assuming stuff is defined.

Create a FAQ page

People have been asking some similar questions. Will be good to put it up on the site.

Handle reimports better

Reimporting causes the cards to be duplicated. Either we should have deeper support with Notion and do uni or bi-directional synchronisation.

vd on Discord says:

(3) As a student, I will be adding more cards to my Notion file as I learn more things. It would be awesome if I could upload my new Notion file with extra cards and NotionToAnki can add only the new/updated cards to my Anki deck, so I don't have to go back and delete duplicates or create a new Notion file with only new cards just for export.

Create an official add-on for notion2anki

From Discord

Alpīnus Kānus Axuus:
Maybe you could create an add-on that works with notion2anki
Just create a deck with it (using the url)
And add-on checks if the notion page is changed
In case it is changed, it creates an updated deck and replaces it with the current deck

Add progress bar

One user suggested this since it's not clear that work is happening in the background. We can use the HTML tag progress but for it to work nicely it needs to be progressed and probably styled.

We could split the progress in four parts where increments of 25% are made
0. Reading Notion Export

  1. Creating cards
  2. Building Anki file
  3. Preparing Anki file

Provide a desktop app

Would be nice to be able to use this offline or in a closed environment where the network blocks certain ip ranges.

Add support for dividers

(1) I think when you place dividers in the Notion Toggle File, the NotionToAnki program isn't able to handle it. It thinks that line is a card and uses the next sub-bullet point to make a card out of context.

Suggested-by: vd on Discord

Parsing HTML breaks when using backgrounds?

Got the below exception


Successfully compiled asm.js code (total compilation time 496ms) app.js
Successfully compiled asm.js code (total compilation time 507ms) app.js
Some cookies are misusing the recommended “sameSite“ attribute 2
warn Detected empty card, please report bug to developer with an example instrument.ts:129:35
writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead! instrument.ts:129:35
Uncaught (in promise) Error: NOT NULL constraint failed: notes.sfld
    handleError app.js line 11 > eval:20
    step app.js line 11 > eval:20
    get app.js line 11 > eval:20
    getAsObject app.js line 11 > eval:20
    value app.js:11
    value app.js:11
    build app.js:11
    X app.js:11
    fileuploaded app.js:11
    handleEvent app.js:11
    sentryWrapped helpers.ts:85
    Lt trycatch.ts:149
    dt instrument.ts:385
    on$ app.js:11
    render app.js:11
    commit app.js:11
    visit app.js:11
    end$ app.js:11
    render app.js:11
    commit app.js:11
    connectedCallback app.js:11
    define app.js:11
    <anonymous> app.js:11
    a app.js:1
    <anonymous> app.js:11
    a app.js:1
    <anonymous> app.js:1
    <anonymous> app.js:1
app.js line 11 > eval:20:16580
Successfully compiled asm.js code (total compilation time 514ms) app.js

​

General Imba.zip

add tags on the card not the deck

The current implementation is broken and should be updated to either work on the card level or removed entirely?

x.addCard(... { tags: ['cool', 'car'] });

Improve default notion style for iOS

From Discord

Quick newbie question: on Anki for desktop, all my cards are left-aligned as they should be but on my iPad they are centred. Do you guys know how I can change that globally? 😬

iOS

image

Desktop

image

Preserve colours from Notion

  • Text color, background

Suggested-by: vd on Discord

(2) It would be really cool to see background color added to the Anki cards, if there is background color that corresponds to the colored Notion Toggle Sections.

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.