Invalid iphone deck style

I recently downloaded some electronic dictionaries in mdx and mdd formats from the Internet, and then loaded them through the anki plug-in fastwq, and then made some decks for learning English. Then these dictionary files are normal under the windows version of anki, including the formats, sizes, colors, background colors, etc. of different languages ​​in the dictionaries. Then I exported these decks and imported them into anki on my iPhone. As a result, the content formats, fonts, colors, etc. generated by these dictionaries are invalid and become the most basic style. Why is this and how can I fix this error? Thank you very much.

I’m afraid you’ll need to contact the add-on author about this. The most likely explanation is that the add-on or dictionary has used styling or JavaScript that doesn’t work correctly on Apple’s web browser, which AnkiMobile uses to display card content.

2 Likes

I made a further discovery. After importing external mdx, mdd, css and js files, the windows version of the anki plug-in Fast Word Query will put the css and js files in the collection.media directory and then call them. There is no problem with the style when using it in the windows version of anki. Then, when the apkg deck is transferred to the iPhone or iPad, the css and js styles in the collection.media directory will be invalid. I asked ChatGPT, and it told me that I can use Anki’s synchronization function. Anki automatically synchronizes the files in the collection.media directory to a specific directory on the iPhone, and then add

<link href="_file/styles.css" rel="stylesheet" />
<script src="_file/script.js"></script>

in the deck code. Such code can call external css and js files, but unfortunately I did not succeed. Later, I used a stupid method, which is to open the css and js code with an editor, and then copy and paste it into the style code column of the Anki deck, and then found that it actually worked. However, because Fast Word Query calls multiple dictionary files and uses css and js files set for multiple dictionaries, the deck style code will be very long, and it is very troublesome to operate, and it may cause conflicts in the style of the current deck. I just don’t know if there are any problems or research in this regard. Am I the only one who has encountered such a problem?

[ChatGPT is stubbornly ignorant about Anki. You can usually do better by reading the manual.]

Did you try?

  1. Name the file itself with a leading underscore. Field Replacements - Anki Manual
  2. Do not using any subdirectories in collection.media.
  3. Follow this excellent guide for how to use external JS and CSS in Anki.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.