forked from FooSoft/yomichan
-
Notifications
You must be signed in to change notification settings - Fork 206
Open
Labels
kind/enhancementThe issue or PR is a new feature or requestThe issue or PR is a new feature or request
Description
I've been using the glossary-first-brief handlebar so far to construct Anki cards, but I recently switched my primary dictionary and want to continue using my old primary dictionary to create cards. Ideally I'd be able to use like single-glossary-jmdict-2025-08-01-first-brief but that's not currently an option.
After some prototyping, the following change to glossary-first allows the expected behavior:
{{~#*inline "glossary-first"~}}
<div style="text-align: left;" class="yomitan-glossary">
{{~#scope~}}
{{~#if (op "===" definition.type "term")~}}
{{~> glossary-single definition brief=brief noDictionaryTag=noDictionaryTag ~}}
{{~#if definition.glossaryScopedStyles~}}
<style>{{{definition.glossaryScopedStyles}}}</style>
{{~/if~}}
{{~else if (op "||" (op "===" definition.type "termGrouped") (op "===" definition.type "termMerged"))~}}
{{~set "foundFirst" false~}}
{{~#each definition.definitions~}}
{{~#unless (op "&&" ../selectedDictionary (op "!=" ../selectedDictionary dictionary))~}}
{{~#unless (get "foundFirst")~}}
{{~> glossary-single . brief=../brief noDictionaryTag=../noDictionaryTag ~}}
{{~#if glossaryScopedStyles~}}
<style>{{{glossaryScopedStyles}}}</style>
{{~/if~}}
{{~set "foundFirst" true~}}
{{~/unless~}}
{{~/unless~}}
{{~/each~}}
{{~/if~}}
{{~/scope~}}
</div>
{{~/inline~}}
{{#*inline "single-glossary-jmdict-2025-08-01-first-brief"}}
{{~> glossary-first selectedDictionary='JMdict [2025-08-01]' brief=true}}
{{/inline}}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/enhancementThe issue or PR is a new feature or requestThe issue or PR is a new feature or request