krmanik / Write-Kanji

Learn, read, write and practice Kanji by drawing strokes with Onyomi, Kunyomi and Meaning in English.
Other
9 stars 3 forks source link

Writing component bug - integrating with pre-existing deck #4

Closed gavieru closed 3 months ago

gavieru commented 3 months ago

I was trying to integrate the writing component into a pre-existing deck which has images and audio/voiceover that plays. Unfortunately, after dropping in the scripts you provided, as well as editing the templates, I wasn't able to get the writing component to work in the preview or in the actual decks. (Interestingly, I have to check the "Fill Empty Fields" option in the Card Types/Template view to be able to see the hanzi writer as well. Maybe I'm doing something wrong there as well?)

The above is on my Windows desktop. Ultimately, I'd love to use this on my AnkiDroid (mobile app) as well, but I know that doesn't have your scripts. My workaround is just using the whiteboard feature to draw onscreen and manually comparing for now.

Smaller workable sample of above deck, download from WeTransfer: https://we.tl/t-NPsmo5FsdC

image image

krmanik commented 3 months ago

I have updated the script try again.

The issue in above deck is that Writing field is used but it is empty, and it does not contain any kanji or kana. So, change it to Kanji filed which make it work.

-<div id='ch_kanji' class="text-color4">{{Writing}}</div>
+<div id='ch_kanji' class="text-color4">{{Kanji}}</div>

Above fix the issues, you may update script with latest changes (it is optional). Read more here.

gavieru commented 3 months ago

That fixed it, amazing! And works well on mobile. :D