-
Notifications
You must be signed in to change notification settings - Fork 148
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
Enable adding cards within a note to specific decks #86
Comments
Interesting, I didn't realize that Anki allowed cards from the same note to belong in different decks. I think that this could be achieved by adding a |
Currently, genanki allows you to specify which deck a note (and all of its corresponding cards) should be added to.
In my personal project, I generate notes that have templates/cards which I would rather not have show up in the same deck (at least initially). I'm looking to see how feasible it would be to allow for this kind of split in code. Since the library is currently built around just adding notes to decks, I'm also looking to see if there are any thoughts on what a compelling way to structure this ability might be.
One option that comes to mind is to change from the
my_deck.add_note(my_note)
approach and instead move this up to the package level. So, you'd create all your decks up-front, pass them to thePackage
, and then useadd_note
directly there, along with a configuration of card => deck. For example:This would be an alternative to the
deck_1.add_note
call, and could throw in case not all cards for the corresponding model were included in one of the mapping keys.Any thoughts here? I think the implementation of this shouldn't be too crazy, as we just need to pass a deck ID mapping from the
Package
inwrite_to_db
, instead of how currently we only pass a singledeck_id
value. Of course, we'd need to deal with template name collisions across note types so internally this would likely be tracked asDict[Tuple[genanki.Model, str], genanki.Deck]
. In the above example, this would mean the dictionary used by thePackage
class internally isHappy to talk through this or take a stab at implementing this approach if it sounds good.
The text was updated successfully, but these errors were encountered: