summaryrefslogtreecommitdiff
path: root/ext/bg/js/template-renderer-frame-main.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-01-10 19:28:50 -0500
committerGitHub <noreply@github.com>2021-01-10 19:28:50 -0500
commit4ed949364564f00a8b871095d030af516fc2ed6d (patch)
tree8a7ac38887874f67f2e99187f7ab3ce29496fe51 /ext/bg/js/template-renderer-frame-main.js
parent25080ac82eef83fdaa921e2a8b12261130b8ac85 (diff)
Refactor anki note building (#1223)
* Move TemplateRendererProxy creation into AnkiNoteBuilder * Simplify _stringReplaceAsync * Organize note generation * Rename API * Make the template rendering function more generic
Diffstat (limited to 'ext/bg/js/template-renderer-frame-main.js')
-rw-r--r--ext/bg/js/template-renderer-frame-main.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/bg/js/template-renderer-frame-main.js b/ext/bg/js/template-renderer-frame-main.js
index 1bd7e086..92a8095e 100644
--- a/ext/bg/js/template-renderer-frame-main.js
+++ b/ext/bg/js/template-renderer-frame-main.js
@@ -24,6 +24,12 @@
(() => {
const japaneseUtil = new JapaneseUtil(null);
const templateRenderer = new TemplateRenderer(japaneseUtil);
+ templateRenderer.registerDataType('ankiNote', {
+ modifier: ({data, marker}) => {
+ data.marker = marker;
+ return data;
+ }
+ });
const api = new TemplateRendererFrameApi(templateRenderer);
api.prepare();
})();