-
Notifications
You must be signed in to change notification settings - Fork 244
{glossary} with Compact glossaries + jmdict_extra is not fully compact #2297
Comments
Thanks for the bug report. I'll see if I can find a solution. In the meantime, you can produce the desired behavior by adding some custom CSS to your anki cards: ul[data-sc-content="glossary"] li {
display: inline-block;
padding-right: 1em;
margin-right: 1em;
border-right: 2px solid;
}
ul[data-sc-content="glossary"] li:last-of-type {
padding-right: 0px;
margin-right: 0px;
border-right: 0px solid;
} |
First a little background on this. The normal style of glossaries are formatted in the *.json term-bank files like this: ["gloss1", "gloss2", "gloss3"] In my current redesign of the JMdict file for Yomichan, terms with extra lists of information do not follow this format. Instead of an array of strings, the glossary array only contains one "structured-content" object. Its format looks sort of like this: [
{
"type": "structured-content",
"content": [{list-of-glosses},
{list-of-notes},
{list-of-references},
{list-of-example-sentences},
...
]
}
] Within the Yomichan browser popup, we only want the I submitted an edit for Yomichan last year which specifically targets this yomichan/ext/data/templates/default-anki-field-templates.handlebars Lines 23 to 31 in 2ee3e3a
On lines 25-26 in the code above, a normal glossary like So I think there are three different approaches we can take to solve this problem
I think option #1 is probably off the table for now. Too much time and effort. Option #2 will solve the issue, but I think it's kind of ugly. See the example images below. These are minor gripes, though. Option #3 is personally my preference. In the first place, I don't think it's good for Yomichan to be removing the HTML structure from these glossaries during the export to Anki. I like to see the glossaries in "compact mode" when I'm doing reviews on my PC, but on my phone I prefer to have them in bulleted lists. As long as the HTML structure is maintained, I can use CSS to adjust the presentation of the info depending upon the window's screen size. This can't be done when the glossaries are converted to a flat string like That's just my two cents. If option #2 sounds like the best solution to everyone else, I don't have a problem making that change. It's a pretty simple adjustment. |
Thanks for the super detailed reply! Out of the three options, I'm personally fine with using custom CSS to compact the cards. However, I know that there are some people that highly prefer plaintext definitions, and my initial guess is that option #2 is not appealing to most people. Right now, I think it would be best to keep this issue up in case anyone wants to pick up the work in Yomichan to implement option #1 since I believe that option is best for all parties (so long as someone wants to spend the time and effort on it.) One final note: I believe there is a 4th hacky potential option. If the dictionary for option #2 is created and named something different, say Thanks again for all your hard work on making these dictionaries! |
Description
Using the
jmdict_english_extra_with_examples_2023_01_29.zip
dictionary from FooSoft/yomichan-import#40, and withPopup Appearance
->Compact glossaries
enabled, the exported result of{glossary}
does not properly compact some<li>
elements. However, it is properly compacted on the actual popup in Yomichan.I'm guessing it has to do with the dictionary format, i.e. the custom
list-style-type
.Example: 仕舞う
This example works on the 2nd entry, but not the rest.
Example: 健康
This example works on the 2nd entry, but not the first.
Example: 猛暑日
Browser version
Chromium 109.0.5414.119
Yomichan version
22.10.23.0
Exported settings file
The settings should be more or less the default settings, but I included it here just in case.
yomichan-settings-2023-02-11-08-39-37.zip
The text was updated successfully, but these errors were encountered: