Closed Viterkim closed 3 months ago
@Viterkim If you
Then, the asbplayer-supplied sentence should override the Yomitan one, BUT also inherit any HTML markup in the Yomitan sentence. If that's not what is happening then there might be a bug, and it would be helpful to have an example of the Yomitan template actually being used, since I might be misunderstanding the problem.
Anki setup:
Asbplayer setup:
Sentence:
Added from anki:
Updated with asbplayer (no () now):
so if you can see the example word is 服 which i had marked (服) but the () dissapears since it's not in the original subtitle. it's because I'm using
{cloze-prefix} ({cloze-body}) {cloze-suffix}
to mark the {cloze-body} in ().
With animebook it just copied the entire sentence in (both top and bottom), even in a nice oneliner example:
Or maybe I'm doing something wrong?
Here's a subtitle file Non Non Biyori-S3 E12-Episode 12_ja.zip
@Viterkim Got it, I think I understand the problem a bit better now. Yomitan picks up the entire sentence on animebook, I believe due to a combination of how animebook renders the subtitle and how Yomitan detects boundaries between sentences. I can suggest two possible workarounds:
\n
as a possible sentence separating character then you might have some success.Unfortunately I am hesitant to make any subtitle rendering changes just to fix this issue so it would be great if one of the options above work for you.
There's no \n
line terminator when parsing sentences.
I'm not really sure how doing anything with {cloze-body} would help? My card format are vocab cards, with the sentence on the back where i have the ()
for convenience, for glancing at the word location.
asbplayer: i can see that there's just a newline in the content
animebook:
Here there's the <p>
tags?
Maybe this helps?
Also appreciate you spending your time on answering!
I'm not really sure how doing anything with {cloze-body} would help? My card format are vocab cards, with the sentence on the back where i have the () for convenience, for glancing at the word location.
What I mean is to highlight {cloze-body}
using HTML formatting instead of parentheses. So something like <b>{cloze-body}</b>
would do it, but you would be highlighting the word in bold instead of using parentheses.
If you do this then asbplayer will properly retain the highlighting when it updates the sentence.
like this?
no doesn't work
Okay it seems to work with the and not the subtitle track 1 field (didn't see the top one). But man i just don't like the bold stuff :D
l see, the HTML markup being retained for the individual subtitle tracks should probably be considered a bug.
About the bolding, you could still use HTML to get parentheses instead if you use the solution in this StackOverflow post: https://stackoverflow.com/questions/60178429/add-parentheses-before-and-after-paragraph-in-html-css
I would try something like this:
<span>{cloze-body}</span>
And then CSS in your Anki note type like this:
span::before {
content: "("
}
span::after {
content: ")"
}
It's actually a really good solution, and would also have something unique to wrap the word in!
BUT it unfortunately doesn't work. Setup:
Before:
After:
Hmm not sure what to tell you - maybe it is not possible to achieve the parentheses with HTML.
For asbplayer, I am reluctant to make changes to support this very specific use case, and you might have better luck submitting an issue to Yomitan regarding its sentence boundary detection when it comes to text separated by newlines.
Hmm not sure what to tell you - maybe it is not possible to achieve the parentheses with HTML.
For asbplayer, I am reluctant to make changes to support this very specific use case, and you might have better luck submitting an issue to Yomitan regarding its sentence boundary detection when it comes to text separated by newlines.
I think there might be a bug, as it worked with the bold html tag, but not with the stuff you suggested! @killergerbah
I like having a setup in yomitan with (anki connect)
when i mine stuff i have the full sentence and the word in
()
. However with asbplayer, when there's "2 lines of subtitles" only the line with the actual word in will get mined, this means that the audio will have the full sentence but the sentence is only "half".Using the asbplayer anki settings doesn't help as i like modifying the content and not just pop in the entire sentence.
Would it be possible to make both sentence lines the same HTML part or something like that? Or is there a way i can make yomitan pickup both sentences?
Thanks!
edit: this used to work fine in https://github.com/animebook/animebook.github.io :D also would it be possible to disable double click to full screen, or click to play/pause?
edit 2: disabling double click can be done with a simple violent monkey / tamper monkey script: