yomichan/ext/data/templates/anki-field-templates-upgrade-v13.handlebars
toasted-nutbread e88d63fc6d
Template renderer media updates (#1802)
* Add TemplateRendererMediaProvider to abstract media-related functionality

* Update representation of injected media

* Update templates

* Update upgrade file

* Update tests

* Update test data

* Force media to be an object

* Update test data
2021-07-06 19:43:53 -04:00

52 lines
1.6 KiB
Handlebars

{{<<<<<<<}}
{{#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}}<li>{{#multiLine}}{{.}}{{/multiLine}}</li>{{/each}}
{{=======}}
{{#each glossary}}<li>{{#formatGlossary ../dictionary}}{{{.}}}{{/formatGlossary}}</li>{{/each}}
{{>>>>>>>}}
{{<<<<<<<}}
{{~#if definition.audioFileName~}}
[sound:{{definition.audioFileName}}]
{{~/if~}}
{{=======}}
{{~#if (hasMedia "audio")~}}
[sound:{{#getMedia "audio" format="fileName"}}{{/getMedia}}]
{{~/if~}}
{{>>>>>>>}}
{{<<<<<<<}}
<img src="{{definition.screenshotFileName}}" />
{{=======}}
{{~#if (hasMedia "screenshot")~}}
<img src="{{#getMedia "screenshot" format="fileName"}}{{/getMedia}}" />
{{~/if~}}
{{>>>>>>>}}
{{<<<<<<<}}
{{~#if definition.clipboardImageFileName~}}
<img src="{{definition.clipboardImageFileName}}" />
{{~/if~}}
{{=======}}
{{~#if (hasMedia "clipboardImage")~}}
<img src="{{#getMedia "clipboardImage" format="fileName"}}{{/getMedia}}" />
{{~/if~}}
{{>>>>>>>}}
{{<<<<<<<}}
{{~#if definition.clipboardText~}}{{definition.clipboardText}}{{~/if~}}
{{=======}}
{{~#if (hasMedia "clipboardText")}}{{#getMedia "clipboardText" format="text"}}{{/getMedia}}{{/if~}}
{{>>>>>>>}}