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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,17 @@ On first run, this recipe generates all the missing files and folders in the `bu
pipenv run brain_brew run recipes/anki_to_source.yaml
```

This recipe allows editing the English standard or extended deck in Anki, and then pulling the changes into the CSVs. Other languages are currently not supported. It also does not support editing the note model, card templates, deck description, etc. -- only the content of the notes.
or

```bash
pipenv run brain_brew run recipes/anki_to_source_[extended].yaml
```

These recipes allows editing the English standard or extended deck in Anki, and then pulling the changes into the CSVs. Other languages are currently not supported. It also does not support editing the note model, card templates, deck description, etc. -- only the content of the notes.

1. Make your edits in Anki.
1. Export the deck with CrowdAnki into the `build/Ultimate Geography [EN]` folder (even if you've edited the extended deck).
1. Run `pipenv run brain_brew run recipes/anki_to_source.yaml`.
1. Export the deck with CrowdAnki into the `build/Ultimate Geography [EN]` or `build/Ultimate Geography [EN] [Extended]` folders for the standard and extended decks respectively.
1. Run `pipenv run brain_brew run recipes/anki_to_source.yaml` or `pipenv run brain_brew run recipes/anki_to_source_[extended].yaml`.
1. Any new media will be placed at the top level of the `src/media` folder and will need to be moved into the appropriate sub-folder.

### How-to's
Expand Down
56 changes: 56 additions & 0 deletions recipes/anki_to_source_[extended].yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
- build_parts:
- notes_from_crowd_anki:
source: build/Ultimate Geography [EN] [Extended]
part_id: extended notes
sort_order: [Country]
# save_to_file: src/notes/english.yaml
- note_model_from_crowd_anki:
- source: build/Ultimate Geography [EN] [Extended]
part_id: Ultimate Geography [Extended]
# save_to_file: src/note_models/Ultimate_Geography_[Extended].yaml
- headers_from_crowd_anki:
- source: build/Ultimate Geography [EN] [Extended]
part_id: default
# save_to_file: src/headers/default.yaml
- media_group_from_crowd_anki:
- source: build/Ultimate Geography [EN] [Extended]
part_id: all_anki_media
- save_media_group_to_folder:
parts: [all_anki_media]
folder: src/media
clear_folder: false
recursive: true

- generate_csvs:
notes: extended notes

note_model_mappings:
- note_models:
- Ultimate Geography [Extended]

columns_to_fields:
guid: guid
country: Country
country info: Country Info
capital: Capital
capital info: Capital Info
capital hint: Capital hint
flag: flag
flag similarity: Flag similarity
map: map
tags: tags

personal_fields: []

file_mappings:
- file: src/data/main.csv
note_model: Ultimate Geography [Extended]

derivatives:
- file: src/data/guid.csv
- file: src/data/country.csv
- file: src/data/country_info.csv
- file: src/data/capital.csv
- file: src/data/capital_info.csv
- file: src/data/capital_hint.csv
- file: src/data/flag_similarity.csv
Loading