Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Instructions for how to have Kanji Colorizer not replace a field with other text in it.
# This is useful for multi-Kanji words; once you've deleted everything but the first Kanji, you want
# the colorizer to leave the field alone.
# 1) Look for the line that starts with `def addKanji(note, flag=False, currentFieldIndex=None)`
# 2) Scroll down almost to the bottom of that function (where the lines are indented,
# right above the "Add a colorized..." bit of text
# 3) Replace this line:
note[dstField] = dst
# With this:
if not note[dstField]:
note[dstField] = dst
# Restart Anki and you'll be good to go! This basically checks if the field's empty, and does nothing if it is.
# If the field's NOT empty, it replaces it with the new, snazzy colorized kanji images.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.