aboutsummaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/data/templates/anki-field-templates-upgrade-v36.handlebars3
-rw-r--r--ext/data/templates/default-anki-field-templates.handlebars4
-rw-r--r--ext/js/data/anki-template-util.js1
-rw-r--r--ext/js/data/options-util.js10
-rw-r--r--ext/settings.html6
5 files changed, 22 insertions, 2 deletions
diff --git a/ext/data/templates/anki-field-templates-upgrade-v36.handlebars b/ext/data/templates/anki-field-templates-upgrade-v36.handlebars
new file mode 100644
index 00000000..0b07e483
--- /dev/null
+++ b/ext/data/templates/anki-field-templates-upgrade-v36.handlebars
@@ -0,0 +1,3 @@
+{{#*inline "onyomi-hiragana"}}
+ {{~#each definition.onyomi}}{{hiragana .}}{{#unless @last}}, {{/unless}}{{/each~}}
+{{/inline}} \ No newline at end of file
diff --git a/ext/data/templates/default-anki-field-templates.handlebars b/ext/data/templates/default-anki-field-templates.handlebars
index 53dab1c1..bbeff830 100644
--- a/ext/data/templates/default-anki-field-templates.handlebars
+++ b/ext/data/templates/default-anki-field-templates.handlebars
@@ -173,6 +173,10 @@
{{~#each definition.onyomi}}{{.}}{{#unless @last}}, {{/unless}}{{/each~}}
{{/inline}}
+{{#*inline "onyomi-hiragana"}}
+ {{~#each definition.onyomi}}{{hiragana .}}{{#unless @last}}, {{/unless}}{{/each~}}
+{{/inline}}
+
{{#*inline "reading"}}
{{~#unless modeTermKana~}}
{{~#if merge~}}
diff --git a/ext/js/data/anki-template-util.js b/ext/js/data/anki-template-util.js
index 20170dae..1c74d747 100644
--- a/ext/js/data/anki-template-util.js
+++ b/ext/js/data/anki-template-util.js
@@ -83,6 +83,7 @@ export function getStandardFieldMarkers(type) {
'glossary',
'kunyomi',
'onyomi',
+ 'onyomi-hiragana',
'screenshot',
'search-query',
'selection-text',
diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js
index 521b4c9b..e2fd2789 100644
--- a/ext/js/data/options-util.js
+++ b/ext/js/data/options-util.js
@@ -542,7 +542,8 @@ export class OptionsUtil {
this._updateVersion32,
this._updateVersion33,
this._updateVersion34,
- this._updateVersion35
+ this._updateVersion35,
+ this._updateVersion36
];
/* eslint-enable @typescript-eslint/unbound-method */
if (typeof targetVersion === 'number' && targetVersion < result.length) {
@@ -1286,6 +1287,13 @@ export class OptionsUtil {
await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v35.handlebars');
}
+ /**
+ * - Added handlebars for onyomi reading in hiragana.
+ * @type {import('options-util').UpdateFunction}
+ */
+ async _updateVersion36(options) {
+ await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v36.handlebars');
+ }
/**
* @param {string} url
diff --git a/ext/settings.html b/ext/settings.html
index 14342a5b..525e99b1 100644
--- a/ext/settings.html
+++ b/ext/settings.html
@@ -3088,10 +3088,14 @@
</tr>
<tr>
<td><code class="anki-field-marker">{kunyomi}</code></td>
- <td>Kunyomi (Japanese reading) for the kanji, expressed as katakana.</td>
+ <td>Kunyomi (Japanese reading) for the kanji, expressed as hiragana.</td>
</tr>
<tr>
<td><code class="anki-field-marker">{onyomi}</code></td>
+ <td>Onyomi (Chinese reading) for the kanji, expressed as katakana.</td>
+ </tr>
+ <tr>
+ <td><code class="anki-field-marker">{onyomi-hiragana}</code></td>
<td>Onyomi (Chinese reading) for the kanji, expressed as hiragana.</td>
</tr>
<tr>