aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/data/default-anki-field-templates.handlebars
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-01-28 21:33:30 -0500
committerGitHub <noreply@github.com>2021-01-28 21:33:30 -0500
commita81787c55b10b43344a9506b62d90c317b329667 (patch)
tree9a2ffe10e63efc85f3beacf31d0356ebe58ca606 /ext/bg/data/default-anki-field-templates.handlebars
parente610a62ceb07313c581a0bd2d5c8ebbc7c39ba4f (diff)
Remove the dictionary tag from the definitionTags (#1324)
* Remove dictionary tag from term definitionTags and kanji tags * Update test data * Update templates * Update tests * Update information
Diffstat (limited to 'ext/bg/data/default-anki-field-templates.handlebars')
-rw-r--r--ext/bg/data/default-anki-field-templates.handlebars18
1 files changed, 15 insertions, 3 deletions
diff --git a/ext/bg/data/default-anki-field-templates.handlebars b/ext/bg/data/default-anki-field-templates.handlebars
index 94553183..8ee2e00d 100644
--- a/ext/bg/data/default-anki-field-templates.handlebars
+++ b/ext/bg/data/default-anki-field-templates.handlebars
@@ -9,6 +9,13 @@
{{~#set "any" true}}{{/set~}}
{{~/if~}}
{{~/each~}}
+ {{~#unless noDictionaryTag~}}
+ {{~#if (op "||" (op "!" @root.compactTags) (op "!==" dictionary (get "previousDictionary")))~}}
+ {{~#if (get "any")}}, {{else}}<i>({{/if~}}
+ {{dictionary}}
+ {{~#set "any" true}}{{/set~}}
+ {{~/if~}}
+ {{~/unless~}}
{{~#if (get "any")}})</i> {{/if~}}
{{~/scope~}}
{{~#if only~}}({{#each only}}{{.}}{{#unless @last}}, {{/unless}}{{/each}} only) {{/if~}}
@@ -20,6 +27,7 @@
{{~else~}}
<ul>{{#each glossary}}<li>{{#multiLine}}{{.}}{{/multiLine}}</li>{{/each}}</ul>
{{~/if~}}
+ {{~#set "previousDictionary" dictionary~}}{{~/set~}}
{{/inline}}
{{#*inline "audio"}}
@@ -93,12 +101,12 @@
<div style="text-align: left;">
{{~#scope~}}
{{~#if (op "===" definition.type "term")~}}
- {{~> glossary-single definition brief=brief ~}}
+ {{~> glossary-single definition brief=brief noDictionaryTag=noDictionaryTag ~}}
{{~else if (op "||" (op "===" definition.type "termGrouped") (op "===" definition.type "termMerged"))~}}
{{~#if (op ">" definition.definitions.length 1)~}}
- <ol>{{~#each definition.definitions~}}<li>{{~> glossary-single . brief=../brief ~}}</li>{{~/each~}}</ol>
+ <ol>{{~#each definition.definitions~}}<li>{{~> glossary-single . brief=../brief noDictionaryTag=../noDictionaryTag ~}}</li>{{~/each~}}</ol>
{{~else~}}
- {{~#each definition.definitions~}}{{~> glossary-single . brief=../brief ~}}{{~/each~}}
+ {{~#each definition.definitions~}}{{~> glossary-single . brief=../brief noDictionaryTag=../noDictionaryTag ~}}{{~/each~}}
{{~/if~}}
{{~else if (op "===" definition.type "kanji")~}}
{{~#if (op ">" definition.glossary.length 1)~}}
@@ -111,6 +119,10 @@
</div>
{{~/inline~}}
+{{#*inline "glossary-no-dictionary"}}
+ {{~> glossary2 noDictionaryTag=true ~}}
+{{/inline}}
+
{{#*inline "glossary-brief"}}
{{~> glossary brief=true ~}}
{{/inline}}