Overview over my other Anki add-ons
Plugin for Anki, a spaced repetition flashcard program.
Plugin to merge a set of notes (from_notes) into another set of notes (to_notes), i.e. to update the to_notes with information from the from_notes.
THIS IS QUITE RUDIMENTARY: Originally only made this for a one time use. Leaving this here for anyone who may need it. PLEASE BACKUP YOUR COLLECTION BEFORE EXPERIMENTING WITH IT!
There is also another addon by vgck which is also about merging notes: Link to Addon, so also consider using this. That one also copies scheduling information but maybe allows for a bit less configuration (?).
Then
File
→ Export
)MERGE_FROM
MERGE_TO
merge notes
to start the merging processWAS_MERGED_FROM
, all to_notes that had another note merged into, now have the tag WAS_MERGED_TO
MERGE_FROM
but not the tag WAS_MERGED_FROM
or which have the tag MERGE_TO
but not the tag WAS_MERGED_TO
. This can be done via Anki's search function.WAS_MERGED_FROM
.If something goes wrong, simply reimport your backup (main menu: File
→ Import
). If you forgot to make a backup, Anki probably has made some for you, go check your backup directory <user name>/Documents/Anki/<Anki user name>/backups
and pick one of the newer once for reimport.
For configuration, go to the file merge_notes.py
and change the lines of the __init__
function.
This should look something like this:
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# BEGIN CONFIGURATION
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# --------------------- FIELD MERGE MODES -----------------------------
# Merge modes for the field contents as a dictionary of the form
# ```field name (unicode string) : merge mode (string)```
# where merge mode is one of the following 4 options
# * ```from``` (the field value of the to note will be that of the
# from note)
# * ```to``` (the field value of the to note will be that of the to
# note, i.e. we do not change anything)
# * ```merge_ft``` (the field value of the to note will be
# field value of from note + line break + field value of to note
# * ```merge_tf``` (the field value of the to note will be
# field value of to note + line break + field value of from note
# Note: Every field name of the from and to notes must be assigned a
# merge mode, else an error will be displayed!
self.field_merge_modes = {
u'Note': "merge_ft",
u'Kunyomi_story': "from",
u'Keyword': "to",
u'Heisig_index': "to",
u'Image': "merge_ft",
u'Other_meanings': "from",
u'Audio': "merge_ft",
u'Kunyomi': "from",
u'Diagram': "to",
u'Combined_story': "from",
u'Examples': "from",
u'Number_of_readings': "from",
u'Kanji_story': "to",
u'Onyomi_story': "from",
u'Expression': "to",
u'Signal': "from",
u'Keyword_notes': "merge_ft",
u'Onyomi': "from"
}
# --------------------- TAG MERGE MODES -------------------------------
# Mode to merge the tags of the from notes and to notes. Choose from
# 3 modes:
# * ```from```
# * ```to```
# * ```merge```
# With meaning as above.
# Note that the special tags defined below will be set automatically.
self.tag_merge_mode = "merge"
# --------------------- MATCH CONTROL-- -------------------------------
# Which field should be compared to find out which notes should be
# merged together?
self.match_field = u"Expression"
# When comparing self.match_field, strip all HTML around the field
# value (i.e. notes with match_field "<b>Test</b>" and "Test" are
# still recognized to be merged
self.strip_html = True
# Permanently strip the html of the self.match_field
self.strip_html_permanently = True
# --------------------- RUN CONTROL-- -------------------------------
# Dry run: Only compare notes and display which notes can be merged,
# but do not do any merging
self.dry = False
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# END CONFIGURATION
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The contents of this repository are licensed under the AGPL3 license (to be compatible with the license of Anki and its addons as detailed here).