Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: apy review-from-file #105

Open
pclk opened this issue Nov 12, 2024 · 7 comments
Open

Feature Request: apy review-from-file #105

pclk opened this issue Nov 12, 2024 · 7 comments

Comments

@pclk
Copy link

pclk commented Nov 12, 2024

No description provided.

@lervag
Copy link
Owner

lervag commented Nov 12, 2024

I have no idea how this would work. Please provide a more detailed description of how you you want this to work, preferably with some examples.

@pclk
Copy link
Author

pclk commented Nov 12, 2024

Apologies, here is the description:

  • similar to apy add-from-file, where we read a markdown file and add the cards to our anki db
  • instead of adding, we parse those new cards into apy review, where we can review one by one before executing add-from-file

Example

Input

model: Basic

# Note
model: Cloze

## Text
The {{c1::Supervised Classification}} learning algorithms are {{c2::K-Nearest Neighbour algorithm}}, {{c3::Logistic regression}}, {{c4::Decision tree}}, {{c5::Support Vector Machine}}.

## Back Extra


# Note
model: Cloze

## Text
In {{c1::KNN}}, the {{c2::K}} parameter defines the amount of {{c3::nearest neighbours}} considered.

## Back Extra

Expected Output

Launches an apy review session with 5 cloze card reviews

Usage

when calling apy review-from-file $INPUT_FILE, it will start a review session similar to apy review.

Is this sufficient information? please let me know.

@lervag
Copy link
Owner

lervag commented Nov 14, 2024

Yes, but I'm not sure I agree this is necessary. So, in my opinion, you could get the desired functionality by performing two steps:

apy add-from-file new-notes.md
apy review added:1

Thus, I'm curious what the value proposition of having a single command for this is.

Perhaps I don't understand quite what you want here?

@pclk
Copy link
Author

pclk commented Nov 14, 2024

I understand. The value proposition is to be able to review cards directly from your file before it gets added to the anki database.

This is so that everyone can review their markdown file cards before commiting an addition to the anki db.

However, if this requires significant changes to the codebase, then i will implement a script that does a addition, review of latest cards, and removal upon exit. Let me know if it is.

@lervag
Copy link
Owner

lervag commented Nov 15, 2024

Ok, how about if I add a --review option to apy add-from-file? This would be very easy, especially if it works more or less like I proposed above, i.e. that it

  1. Adds the cards from the file.
  2. Starts a apy review of the added files.

Does this sound like what you want?

@pclk
Copy link
Author

pclk commented Nov 19, 2024

Hello lervag,

Sorry for the late reply.

The idea was to review the cards directly from the markdown file before any database operation. One thing about database operations like adding the cards, is that i have to close my anki application, otherwise there will be:

  1. Database Locked error
  2. If there is no Database Locked error while the application is active, then the database will get corrupted

As such, i would like to avoid such operations if possible, unless im ready to commit the flashcards into my database.

Is this still possible? Thank you for your guidance!

@lervag
Copy link
Owner

lervag commented Nov 19, 2024

Sorry for the late reply.

No problem!

The idea was to review the cards directly from the markdown file before any database operation.

Ah, ok. That would actually require a lot of work, because the entire review code is based on the database APIs fron Anki. And in more recent versions of the Anki API there is no way (that I know of) to not actually commit the actions continuously.

One thing about database operations like adding the cards, is that i have to close my anki application, otherwise there will be: …

Yes, that's right. apy can't be used while Anki is running. It's actually one of the main reasons I created apy. I wanted a CLI tool that was independent of Anki and worked without having Anki Desktop running. Else I could have just used the AnkiConnect stuff.

Is this still possible? Thank you for your guidance!

Everything is possible, but to be honest, I'm not really motivated to work on this. I would not use the functionality myself and I see no easy way to implement it.

Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants