yomidevs / yomitan

Pop-up dictionary browser extension. Successor to Yomichan.
https://yomitan.wiki
GNU General Public License v3.0
1.2k stars 93 forks source link

Surround mined word in appropriate fields with a targetable tag #642

Open tomashaddad opened 8 months ago

tomashaddad commented 8 months ago

The mined word should be surrounded with a targetable HTML tag in fields such as sentence, clipboard-text, and any others that might be appropriate, so that it may be automatically formatted in Anki (or similar).

Often when I include sentences or paragraphs with my mined word via these markers I wish I could easily spot where the word is located, especially when it is surrounded by lots of text. Since Yomitan's parser can already identify word boundaries, including inflections, I don't imagine it would be too difficult.

For example, a sentence like「何を食べていますか?」mined for 食べる could be transformed into 何を<span data-yt-expression>食べて</span>いますか?.

MarvNC commented 8 months ago

https://github.com/themoeway/yomitan/blob/master/docs/anki-integration.md#markers-for-term-cards

I think the cloze markers are what you're looking for.

tomashaddad commented 8 months ago

https://github.com/themoeway/yomitan/blob/master/docs/anki-integration.md#markers-for-term-cards

I think the cloze markers are what you're looking for.

That works for the one word in your sentence, but I guess I was hoping for a more generalisable solution that would utilise the parser to mark all instances of the word in selected fields. If you still think cloze markers are sufficient, let me know and I'll close this issue.