kerrickstaley / genanki

A Python 3 library for generating Anki decks
MIT License
2.06k stars 161 forks source link

Assign card dues per individual card and not just note level #123

Open miniwa opened 1 year ago

miniwa commented 1 year ago

Hi! My use case in Anki has me generating more than 1 card for every note in a model. But I also want to make sure the user sees the cards from a specific template before they see any cards generated by the next template.

Currently, this is not possible to do in genanki, as card dues can only be assigned per individual note level. The workaround is to create duplicate notes for each card type, but that leads to lots of duplicate information and is quite clunky to work with.

I tried my best to figure out a way to implement this without murdering your backward compatibility, it's not the cleanest but it does work. If you spot a way to do this with a cleaner API surface I'm all for that.

codecov-commenter commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (0fa4f74) 95.41% compared to head (79a0c13) 95.54%. Report is 3 commits behind head on main.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #123 +/- ## ========================================== + Coverage 95.41% 95.54% +0.13% ========================================== Files 11 11 Lines 327 337 +10 ========================================== + Hits 312 322 +10 Misses 15 15 ``` | [Files](https://app.codecov.io/gh/kerrickstaley/genanki/pull/123?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [genanki/note.py](https://app.codecov.io/gh/kerrickstaley/genanki/pull/123?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Z2VuYW5raS9ub3RlLnB5) | `97.65% <100.00%> (+0.19%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.