summaryrefslogtreecommitdiff
path: root/ext/bg/data/anki-field-templates-upgrade-v6.handlebars
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-11-28 14:30:50 -0500
committerGitHub <noreply@github.com>2020-11-28 14:30:50 -0500
commit008ffdb6bffc2855957be948a24c9e07730501d6 (patch)
treebe6642b030011f0007aad1025da3c5accd0d9a54 /ext/bg/data/anki-field-templates-upgrade-v6.handlebars
parent94d63f4f87a61f7e42ea44d8100ea11d5ccdbce0 (diff)
Frequencies marker (#1074)
* Update japanese.js tests * Simplify fallback/early exit * Add overloads to furigana and furiganaPlain handlebars helper functions * Expose unique expression/reading arrays (and subsequently counts) * Add {frequencies} marker
Diffstat (limited to 'ext/bg/data/anki-field-templates-upgrade-v6.handlebars')
-rw-r--r--ext/bg/data/anki-field-templates-upgrade-v6.handlebars17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/bg/data/anki-field-templates-upgrade-v6.handlebars b/ext/bg/data/anki-field-templates-upgrade-v6.handlebars
index 33a2f949..809423ce 100644
--- a/ext/bg/data/anki-field-templates-upgrade-v6.handlebars
+++ b/ext/bg/data/anki-field-templates-upgrade-v6.handlebars
@@ -6,3 +6,20 @@
{{~/each~}}
{{~/if~}}
{{/inline}}
+
+{{#*inline "frequencies"}}
+ {{~#if (op ">" definition.frequencies.length 0)~}}
+ <ul style="text-align: left;">
+ {{~#each definition.frequencies~}}
+ <li>
+ {{~#if (op "!==" ../definition.type "kanji")~}}
+ {{~#if (op "||" (op ">" ../uniqueExpressions.length 1) (op ">" ../uniqueReadings.length 1))~}}(
+ {{~#furigana expression reading~}}{{~/furigana~}}
+ ) {{/if~}}
+ {{~/if~}}
+ {{~dictionary}}: {{frequency~}}
+ </li>
+ {{~/each~}}
+ </ul>
+ {{~/if~}}
+{{/inline}}