-
Notifications
You must be signed in to change notification settings - Fork 4
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
Issue/feedback for cloze card #6
Comments
Hey there! I'll address the different points you brought up one by one: Note types use
|
Hey hey 😃 Thank you so much for taking the time to respond in such detail and being willing to change the interface part! I really appreciate it. Markdown is my favorite format when taking notes, so I'm happy to see your project, which combines it with Anki! I have been using Anki for a while, but I only started to think about generating cards programmatically and discovered AnkiConnect add-ons a few days ago. So I might not be an expert on this subject. However, it seems to me that most libraries that can send cards (particularly remotely?) are using AnkiConnect under the hood though. I needed to send Anki cards remotely because I use WSL2 on my Windows machine for development purposes. And my understanding is that WSL2 is considered a remote network to the Windows machine. (:rotating_light: Setting up AnkiConnect to work with WSL2 had some challenges, and I would be happy to share more information with you if you are interested in exploring this further.) Overall my impression of AnkiConnect is that it's quite easy to use (Except for the issue costs by WSL2). The code snippet that ChatGPT provided basically just works. But this brings back the issue of the Cloze card template. If you check the below image, where I simply imported the When using AnkiConnect and calling the request with |
Thank you for the feedback and explaining more your situation I'm a bit busy today, but I will look into the AnkiConnect issue soon and check if the error is strictly related to the note type issue or could be something else :) Also, even if the editor shows that error, you should be able to review the card and it should work correctly, can you confirm that? Do the cards work while reviewing? If I can get AnkiConnect to work and the cards work even if anki complains about the note type, I won't have to think of workarounds for the front-end 🙈 If everything goes well and it's just Anki's editor, then I think I should be able to roll out the new version with AnkiConnect imports by the 15th/20th! Until then, if the cards imported using the |
Yes, confirmed that I can review the card in the Anki app and it works! |
Thanks for letting me know :) |
Hey there! I've had a rough week so I couldn't get to work on this; hopefully I will be able to look into it tomorrow :) |
Hello @Mochitto,
I recently came across your project while searching for a library that can transform markdown to Anki cards and I must say it's a really nice project. However, I encountered some issues when trying out the cloze card. I think the problem with Anki cloze is that in your current design, HandleClozes will eventually create the same content for both the front and back strings. But in the card/model template, the front card has
{{cloze:Front}}
, and the back card has{{cloze:Back}}
. I believe this is not what Anki expects. It may work if you force import the card with an apkg file, but if you are using AnkiConnect, theaddNote
call will fail. If I go to anki GUI and try to add the card with the content, it won't let me and pops out:Cloze deletion can only be used in fields which use the ‘cloze:’ filter
error.I found a workaround by modifying the card template's back and changing
{{cloze:Back}}
to{{cloze:Front}}
. This way, the backside of the card will just use the same content as the front side, which is likely what cloze deletion operation expects. Then, I am not setting the Back field when making theaddNote
call.Also, I had some trouble getting cloze cards to work at the beginning as I was doing something like:
When I uploaded the card, it threw an exception, because you have the line:
t=document.querySelectorAll(e);if(!t.length)throw document.body.innerHTML=s,new Error(`Couldn't find any element matching ${e}`);return t}
And I realize the card model template is expecting the tab-group. After searching around the lib, I finally realize the correct calls are:
I feel like if cloze hashes and wrapping with
process_card
to add the tab-group are necessary, they should have been wrapped into one function as an exposed interface, basically mimicking theprocess_card
counterpart:I hope this feedback is useful to you, and I'm looking forward to hearing your thoughts on this.
Thank you for your time and effort on this project.
The text was updated successfully, but these errors were encountered: