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

Allow converting extended deck from CrowdAnki format to source #668

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aplaice
Copy link
Collaborator

@aplaice aplaice commented Jan 23, 2025

Fix #666

It would be convenient for a single recipe to exist, and (given that we're not actually saving the note model itself to file) it should be possible, from a theoretical flow-of-data point of view, but I don't think this is currently supported by BrainBrew — the exact name of the note model has to be provided. (It would also likely be non-trivial to do this correctly, robustly and flexibly (while also not dropping the option of using save_to_file in the general case), given that the only reason this could theoretically work is because both note models have the exact same fields.)

Tested that the recipe works as expected by:

  1. Generate the CrowdAnki files in build/ with the source to Anki recipe.

  2. Make a change in one of the src/data/*.csv files. (Note: this is necessary before 3 because otherwise BrainBrew correctly notices there are no changes, and doesn't actually re-sort the notes, which would make the later comparison messy.)

  3. Run the Anki to source [extended] recipe. (This resorts the notes, but resetting the actual content to the state from before 2.)

  4. Make a change in build/Ultimate Geography [EN] [Extended]/deck.json.

  5. Run the Anki to source [extended] recipe.

  6. Compare the state between after 3 and after 5 and verify that your change was applied.

@axelboc
Copy link
Collaborator

axelboc commented Jan 23, 2025

Oh we need to update the Python version I think.

Fix anki-geo#666

It would be convenient for a single recipe to exist, and (given that
we're not actually saving the note model itself to file) it should be
possible, from a theoretical flow-of-data point of view, but I don't
think this is currently supported by BrainBrew — the exact name of the
note model has to be provided.  (It would also likely be non-trivial
to do this correctly, robustly and flexibly (while also not dropping
the option of using `save_to_file` in the general case), given that
the only reason this could theoretically work is because both note
models have the exact same fields.)

Tested that the recipe works as expected by:

1. Generate the CrowdAnki files in `build/` with the source to Anki
recipe.

2. Make a change in one of the `src/data/*.csv` files. (Note: this
is necessary before *3* because otherwise BrainBrew correctly notices
there are no changes, and doesn't actually re-sort the notes, which
would make the later comparison messy.)

3. Run the Anki to source [extended] recipe.  (This resorts the notes,
but resetting the actual content to the state from before *2*.)

4. Make a change in `build/Ultimate Geography [EN]
[Extended]/deck.json`.

5. Run the Anki to source [extended] recipe.

6. Compare the state between after *3* and after *5* and verify that
your change was applied.
@axelboc axelboc force-pushed the anki_to_source_extended branch from 476fce1 to f5f44f5 Compare January 27, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Bug: error while use anki_to_source.yaml for [Extended] decks
2 participants