aboutsummaryrefslogtreecommitdiff
path: root/ext/js/templates/sandbox/template-renderer-frame-main.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/templates/sandbox/template-renderer-frame-main.js')
-rw-r--r--ext/js/templates/sandbox/template-renderer-frame-main.js18
1 files changed, 4 insertions, 14 deletions
diff --git a/ext/js/templates/sandbox/template-renderer-frame-main.js b/ext/js/templates/sandbox/template-renderer-frame-main.js
index bb9cac3a..15fe7781 100644
--- a/ext/js/templates/sandbox/template-renderer-frame-main.js
+++ b/ext/js/templates/sandbox/template-renderer-frame-main.js
@@ -16,23 +16,13 @@
*/
/* globals
- * AnkiNoteDataCreator
- * CssStyleApplier
- * JapaneseUtil
- * TemplateRenderer
+ * AnkiTemplateRenderer
* TemplateRendererFrameApi
*/
(async () => {
- const cssStyleApplier = new CssStyleApplier('/data/structured-content-style.json');
- await cssStyleApplier.prepare();
- const japaneseUtil = new JapaneseUtil(null);
- const templateRenderer = new TemplateRenderer(japaneseUtil, cssStyleApplier);
- const ankiNoteDataCreator = new AnkiNoteDataCreator(japaneseUtil);
- templateRenderer.registerDataType('ankiNote', {
- modifier: ({marker, commonData}) => ankiNoteDataCreator.create(marker, commonData),
- composeData: (marker, commonData) => ({marker, commonData})
- });
- const templateRendererFrameApi = new TemplateRendererFrameApi(templateRenderer);
+ const ankiTemplateRenderer = new AnkiTemplateRenderer();
+ await ankiTemplateRenderer.prepare();
+ const templateRendererFrameApi = new TemplateRendererFrameApi(ankiTemplateRenderer.templateRenderer);
templateRendererFrameApi.prepare();
})();