Last active
October 31, 2017 14:07
-
-
Save sritchie/c361d6c277c8f161972c to your computer and use it in GitHub Desktop.
Instructions for how to have Kanji Colorizer not replace a field with other text in it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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