Skip to content

Setup Changes

This page documents any changes to the setup as recorded in previous pages, as well as any important handlebars and JPMN updates. Most importantly, this documents the existance of breaking changes from external programs and if there are fixes or workarounds for them.

If something breaks, and you suspect it's due to an external program updating, please check here first! If you can't find any solution, please let me know!


2023/10/08 (JPMN 0.12.0.0-prerelease-13)

This version of jp-mining-note fixes a bug that was introduced with a recent AJT Japanese update. This bug resulted in an Unexpected flattened.childNode error on new cards, and prevented pitch accent information from being displayed correctly. See the Updating page on how to update the note. Afterwards, see below for the other necessary changes that must be made to properly update the note.

AJT Japanese Config Update

This update requires you to update your AJT Japanese config settings. To do so, go to the AJT Japanese setup instructions and follow the instructions. The main changes are the removal of the "styles" key, and the addition of the "style" key under the "pitch_accent" settings.

Note

After updating the AJT Japanese config, make sure you restart Anki. Do this before moving on to the next step.

Regenerating the AJTWordPitch field

After updating your AJT Japanese config settings, you will need to regenerate the AJTWordPitch field for all your cards.

Warning

This procedure will delete data from all your cards, however, under normal use, the AJTWordPitch field should only contain autogenerated content, so this shouldn't be a problem. If, for some reason, you have manually edited the AJTWordPitch field for any cards, those edits should be recorded somewhere before running this procedure.

  1. Run the following batch command:
    empty_field AJTWordPitch
    
  2. Regenerate the AJT Japanese data for all of your notes.

Reformat any entries in the PAOverrideText field

Since the HTML format for displaying pronunciation data has changed, any pronunciation data that has been manually entered into the PAOverrideText field will need to be rewritten. The new format is described here.

A simple way to find all cards that contain manually edited data in the PAOverrideText field is to run the following query in the Anki browser:

PAOverrideText:_*

Final Steps

After changing everything, don't forget to test that the card works! If you reached this point, then congratulations! You are finally done with updating the note! Pitch accent and pronunciation data should now be displayed correctly on all cards.

If your cards still don't display properly, then it's possible you forgot to restart Anki after updating the AJT Japanese configuration. Restart Anki to confirm the config change, and then go back and regenerate the AJTWordPitch field again.


2023/??/?? (JPMN 0.12.0.0)

This version of jp-mining-note comes with many changes, including an entire backend javascript rework. See the Updating page on how to update the note. Afterwards, see below for the other necessary changes that must be made to properly update the note.

Config Rework

The _jpmn-options.js runtime options file has been completely reworked, meaning your previous config will no longer work. With this update, the file has been replaced automatically, so the note can work for future versions.

If you have changed any runtime options before, you will need change them again. Common runtime-options (pitch accent coloring and image blur) are included as examples; remove the comment to re-enable them. To see all available runtime options, see Runtime Options: Available Options.

A backup of your previous runtime options should be made. The location of the backup is different depending on the updating method used:

Anki2/addons21/1732829476/user_files/backup
(repo root)/backup

Note

For people using pitch accent coloring, the entire card is now highlighted with the pitch accent group. To restore the previous behavior, use these runtime options:

"autoPitchAccent.coloredPitchAccent.color.fullSentence": false,
"autoPitchAccent.coloredPitchAccent.color.definitions": false,

Updating Multiple Devices

A common issue with updating multiple devices (for example, updating your phone) is that the new runtime options file may not be synced properly. In the case that the file is not synced properly, you will get the following warning:

JPMNOptions was not defined in the options file. Was there an error?

The official documentation says that adding or removing a media file should fix this issue. However, I received various reports from people saying this does not work. A fool-proof workaround that is guaranteed to work is documented below.

  1. Make sure all devices are synced.
  2. Run the following batch command:

    move_runtime_options_file_to_temp
    
  3. Sync to AnkiWeb (from the computer).

  4. Run the following batch command:

    move_runtime_options_file_to_original
    
  5. Sync to AnkiWeb (from the computer).

  6. On all other devices, sync from AnkiWeb.
  1. Make sure all devices are synced.
  2. Rename the _jpmn-options.js file to something different manually, i.e. _jpmn-options-TEMP.js.
  3. Sync to AnkiWeb (from the computer).
  4. Rename the temporary file (in the example above: _jpmn-options-TEMP.js) to the original name (_jpmn-options.js).
  5. Sync to AnkiWeb (from the computer).
  6. On all other devices, sync from AnkiWeb.

Yomichan Handlebars

Yomichan's Handlebars has been updated, with some new helpers and features being added.

  • To update Yomichan's Anki Card Format, see here.
  • To update your handlebars templates, see here.

After updating the templates, the following fields must be changed:

  • FrequencySort: {jpmn-min-freq}{jpmn-frequency-sort}
    • Newer users might already have this set correctly. In that case, you don't have to change anything.
  • YomichanWordTags: (empty){tags}
  • See here for instructions on how to update Anki Card Format.

Note

Remember that these settings must be updated on every device that you use Yomichan on! This includes Android (if you use AnkiConnectAndroid), and all active Yomichan profiles.

Frequency Display

The frequency at the top right now defaults to using the FrequencySort value. This is because it is usually more useful to see a summary of the values, instead of all the literal values itself.

Automatic Field Collapsing

For newer versions of Anki, you can set a field to be collapsed by default by heading over to:

(Note editor) → Fields...Collapse by default

Feel free to automatially collapse any fields you don't use, or very rarely use. The fields that are collapsed by default can be found here.

Custom SCSS

For people who are using custom SCSS (usually through src/scss/extra, when building the note), it is now recommended that the extra folder is moved to the overrides/scss folder. This is purely a stylistic change, to better separate user-defined changes and source code.

Font Size Changes

The default font sizes of certain sections have been changed to be a bit bigger, in order to make kanji more readable. If you prefer the original smaller font sizes, the following CSS will revert the changes:

.hover-tooltip__word-div {
  font-size: 1em;
}

.hover-tooltip__word-div b {
  font-weight: var(--bold-font-weight);
}
.hover-tooltip__card--sentence-only .hover-tooltip__sent-div b {
  font-weight: var(--bold-font-weight);
}

:root {
  --glossary-font-size: 1.125rem;
}

@media (max-width: 850px), (max-height: 700px) {
  :root {
    --glossary-font-size: 0.9375rem;
  }
}

Final Steps

After changing everything, don't forget to test that the card works! If you reached this point, then congratulations! You are finally done with updating the note! Enjoy 0.12.x.x and all its new features!


2023/04/07 (AJT Japanese Update)

AJT Japanese got updated to include automatic audio file downloading. The example config was updated to disable this by default, because having it enabled increased Anki startup time. Feel free to re-enable this if you plan on using this feature.


2023/04/01 (Anki 2.1.61)

Anki 2.1.61 sets Reduce motion to be enabled by default. This breaks all animations in templates. To re-enable animations in templates, please turn this option off.

Note that this is a temporary change on Anki's side, and should be fixed at some point in the future.


2023/03/18 (Handlebars 1.0.1)

The handlebars got an update to support other note types other than jp-mining-note. Documentation has still not been released on the new options, so this update has not been officially announced yet.

  • See the full changelog here.
  • See how to update your handlebars here.

2023/03/07 (AJT Anki Add-ons Update)

AJT Furigana and AJT Pitch Accent got combined into one add-on: AJT Japanese. AJT Japanese takes the place of AJT Furigana, and should've be automatically updated.

To use this new add-on, the config must be updated. This new config can be found here.

Additionally, please disable or remove the "AJT Pitch Accent" add-on, as it is now redundant and may interfere with "AJT Japanese".


2023/02/22 (CSS Injector Update)

The CSS Injector was updated by the author, to support Anki versions 2.1.55 and above. Any local version of CSS Injector should be removed, and the AnkiWeb version should be used instead. If you are already using the AnkiWeb version, nothing has to be done.

See the setup instructions here.


2022/11/19 (JPMN 0.11.0.0)

  • Yomichan's handlebars was updated. See how to update your handlebars here.
  • Yomichan's 'Anki Card Format' section was updated, and the following fields must be changed:
    • WordReadingHiragana: (empty){jpmn-word-reading-hiragana}
    • See here for instructions on how to update Anki Card Format.
  • If you are using the nsfw-toggle function, the option name was changed from nsfw-toggle to image-blur. Please change it in your runtime options to continue using it. Example config
  • The way keybinds are specified has been changed (to allow keys to still function as expected even with CapsLock enabled.) Keybinds will no longer work until you update the runtime options values. For example, update n to KeyN. Example config

Everything before

Lower versions of JPMN are not recorded here. Full details of the changes can be found in the main changelog instead.


Last update: May 15, 2024