aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-08-01 16:23:33 -0400
committerGitHub <noreply@github.com>2020-08-01 16:23:33 -0400
commit838fd211c6737ce7e2b6802a43837cf4300b60d2 (patch)
tree24fb7fd7d8e6c494a3e51defc7f32a6c3aa73107 /ext/bg/js/settings
parent1e839cd230e53f822478f945cb415a8af2b09aef (diff)
Pitch accent Anki field templates (#701)
* Template helper updates * Add pitch data to exported field formatting data * Reuse note data * Add no-op * Set up pitch accent templates * Refactor version update functions * Implement upgrade process for new Anki templates * Consistency * Update README and anki.js to have matching markers
Diffstat (limited to 'ext/bg/js/settings')
-rw-r--r--ext/bg/js/settings/anki-templates.js3
-rw-r--r--ext/bg/js/settings/anki.js6
2 files changed, 8 insertions, 1 deletions
diff --git a/ext/bg/js/settings/anki-templates.js b/ext/bg/js/settings/anki-templates.js
index 88d4fe04..4e004308 100644
--- a/ext/bg/js/settings/anki-templates.js
+++ b/ext/bg/js/settings/anki-templates.js
@@ -144,7 +144,8 @@ class AnkiTemplatesController {
let templates = options.anki.fieldTemplates;
if (typeof templates !== 'string') { templates = this._defaultFieldTemplates; }
const ankiNoteBuilder = new AnkiNoteBuilder({renderTemplate: api.templateRender.bind(api)});
- result = await ankiNoteBuilder.formatField(field, definition, mode, context, options, templates, exceptions);
+ const data = ankiNoteBuilder.createNoteData(definition, mode, context, options);
+ result = await ankiNoteBuilder.formatField(field, data, templates, exceptions);
}
} catch (e) {
exceptions.push(e);
diff --git a/ext/bg/js/settings/anki.js b/ext/bg/js/settings/anki.js
index 51dabba4..ac4c5455 100644
--- a/ext/bg/js/settings/anki.js
+++ b/ext/bg/js/settings/anki.js
@@ -54,6 +54,9 @@ class AnkiController {
'furigana-plain',
'glossary',
'glossary-brief',
+ 'pitch-accents',
+ 'pitch-accent-graphs',
+ 'pitch-accent-positions',
'reading',
'screenshot',
'sentence',
@@ -63,6 +66,9 @@ class AnkiController {
case 'kanji':
return [
'character',
+ 'cloze-body',
+ 'cloze-prefix',
+ 'cloze-suffix',
'dictionary',
'document-title',
'glossary',