Type:furigana:field

Hello, I’d like to create a {{type:Japanese}} card that includes furigana (small text displayed above the main text, known as ruby in HTML). However, using {{type:kanji:field}} doesn’t work as intended — it completely ignores “kanji:”, “kana:”, or “furigana:”.

I’ve found a workaround by simply using {{furigana:field}} on the back of the card (without “type:”), but I’m hoping to find a better solution.

Many thanks :slight_smile:

If the stock typing does not interpret kanji: and kana: filters accordingly, then the only solution is probably to make a custom typing function. This is not a small task, as it will require parsing the correct answer, passing the typed part between the front and the back of a card, and computing a diff to present the comparison on the backside. I have all of this implemented in this note type: https://ankiweb.net/shared/info/510199145. The correct answer is defined by whatever is put inside the id="correctAnswer" element at the top of the front template. If you enter {{kanji:field}} there, then what you type during reviews will be compared against exactly that.

You are free to check out the source code for it here as well: Anki-Card-Templates/Add-on/Source code at main · Eltaurus-Lt/Anki-Card-Templates · GitHub, although extracting the bits responsible for custom typing won’t be that easy either, as they are connected to many other things the template does, like parsing alternative answers, auto-rating cards, and fuzzy matching. But you are free to use the note type as a whole and customize it to your needs in any way required. On the upside of this method, the typing will work in the exact same way on every platform, including AnkiWeb, which doesn’t support it by default.

2 Likes

Thank you, I’m still looking for other solutions but I’ll use it if I can’t find anything else

1 Like