From ca97e38bd22875e23cfe6f70d1803ea31d6f0e89 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 2 Jul 2021 22:46:38 -0400 Subject: Anki support for structured-content (#1786) * Update how glossary text is formatted * Update structured content and image generation * Pass root data to _createStructuredContentGenerator * Implement media URLs * Update documentation * Update options util * Apply styles to content * Improve HTML normalization * Update DatabaseVM.fetch function * Update test * Update test data --- .../anki-field-templates-upgrade-v13.handlebars | 17 +++++++++++++++++ .../templates/default-anki-field-templates.handlebars | 6 +++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 ext/data/templates/anki-field-templates-upgrade-v13.handlebars (limited to 'ext/data') diff --git a/ext/data/templates/anki-field-templates-upgrade-v13.handlebars b/ext/data/templates/anki-field-templates-upgrade-v13.handlebars new file mode 100644 index 00000000..04cc855a --- /dev/null +++ b/ext/data/templates/anki-field-templates-upgrade-v13.handlebars @@ -0,0 +1,17 @@ +{{<<<<<<<}} +{{#each glossary}}{{#multiLine}}{{.}}{{/multiLine}}{{/each}} +{{=======}} +{{#each glossary}}{{#formatGlossary ../dictionary}}{{{.}}}{{/formatGlossary}}{{/each}} +{{>>>>>>>}} + +{{<<<<<<<}} +{{#each glossary}}{{#multiLine}}{{.}}{{/multiLine}}{{#unless @last}} | {{/unless}}{{/each}} +{{=======}} +{{#each glossary}}{{#formatGlossary ../dictionary}}{{{.}}}{{/formatGlossary}}{{#unless @last}} | {{/unless}}{{/each}} +{{>>>>>>>}} + +{{<<<<<<<}} +{{#each glossary}}
  • {{#multiLine}}{{.}}{{/multiLine}}
  • {{/each}} +{{=======}} +{{#each glossary}}
  • {{#formatGlossary ../dictionary}}{{{.}}}{{/formatGlossary}}
  • {{/each}} +{{>>>>>>>}} diff --git a/ext/data/templates/default-anki-field-templates.handlebars b/ext/data/templates/default-anki-field-templates.handlebars index 97359aa0..67547732 100644 --- a/ext/data/templates/default-anki-field-templates.handlebars +++ b/ext/data/templates/default-anki-field-templates.handlebars @@ -21,11 +21,11 @@ {{~#if only~}}({{#each only}}{{.}}{{#unless @last}}, {{/unless}}{{/each}} only) {{/if~}} {{~/unless~}} {{~#if (op "<=" glossary.length 1)~}} - {{#each glossary}}{{#multiLine}}{{.}}{{/multiLine}}{{/each}} + {{#each glossary}}{{#formatGlossary ../dictionary}}{{{.}}}{{/formatGlossary}}{{/each}} {{~else if @root.compactGlossaries~}} - {{#each glossary}}{{#multiLine}}{{.}}{{/multiLine}}{{#unless @last}} | {{/unless}}{{/each}} + {{#each glossary}}{{#formatGlossary ../dictionary}}{{{.}}}{{/formatGlossary}}{{#unless @last}} | {{/unless}}{{/each}} {{~else~}} - + {{~/if~}} {{~#set "previousDictionary" dictionary~}}{{~/set~}} {{/inline}} -- cgit v1.2.3