Skip to content

Commit

Permalink
catch a few more cases in the template patch
Browse files Browse the repository at this point in the history
  • Loading branch information
praschke committed Oct 22, 2023
1 parent 18757dc commit 3b88696
Showing 1 changed file with 54 additions and 44 deletions.
98 changes: 54 additions & 44 deletions ext/data/templates/anki-field-templates-upgrade-v21.handlebars
Original file line number Diff line number Diff line change
@@ -1,85 +1,91 @@
{{<<<<<<<}}
{{~#set "any" false}}{{/set~}}
{{#formatGlossary ../dictionary}}{{{.}}}{{/formatGlossary}}
{{=======}}
{{~set "any" false~}}
{{formatGlossary ../dictionary .}}
{{>>>>>>>}}

{{<<<<<<<}}
{{~#set "any" true}}{{/set~}}
{{~#furigana}}{{{.}}}{{/furigana~}}
{{=======}}
{{~set "any" true~}}
{{~furigana .~}}
{{>>>>>>>}}

{{<<<<<<<}}
{{#each glossary}}{{#formatGlossary ../dictionary}}{{{.}}}{{/formatGlossary}}{{/each}}
{{#furigana}}{{{definition}}}{{/furigana}}
{{=======}}
{{#each glossary}}{{formatGlossary ../dictionary .}}{{/each}}
{{furigana definition}}
{{>>>>>>>}}

{{<<<<<<<}}
{{#each glossary}}{{#formatGlossary ../dictionary}}{{{.}}}{{/formatGlossary}}{{#unless @last}} | {{/unless}}{{/each}}
{{~#furigana expression reading~}}{{~/furigana~}}
{{=======}}
{{#each glossary}}{{formatGlossary ../dictionary .}}{{#unless @last}} | {{/unless}}{{/each}}
{{~furigana expression reading~}}
{{>>>>>>>}}

{{<<<<<<<}}
<ul>{{#each glossary}}<li>{{#formatGlossary ../dictionary}}{{{.}}}{{/formatGlossary}}</li>{{/each}}</ul>
{{~#furigana expression reading}}{{/furigana~}}
{{=======}}
<ul>{{#each glossary}}<li>{{formatGlossary ../dictionary .}}</li>{{/each}}</ul>
{{~furigana expression reading~}}
{{>>>>>>>}}

{{<<<<<<<}}
{{~#set "previousDictionary" dictionary~}}{{~/set~}}
{{~#furiganaPlain}}{{{.}}}{{/furiganaPlain~}}
{{=======}}
{{~set "previousDictionary" dictionary~}}
{{~furiganaPlain .~}}
{{>>>>>>>}}

{{<<<<<<<}}
[sound:{{#getMedia "audio"}}{{/getMedia}}]
{{#furiganaPlain}}{{{definition}}}{{/furiganaPlain}}
{{=======}}
[sound:{{getMedia "audio"}}]
{{furiganaPlain definition}}
{{>>>>>>>}}

{{<<<<<<<}}
<span class="expression-{{termFrequency}}">{{~#furigana}}{{{.}}}{{/furigana~}}</span>
{{~#furiganaPlain expression reading~}}{{~/furiganaPlain~}}
{{=======}}
<span class="expression-{{termFrequency}}">{{~furigana .~}}</span>
{{~furiganaPlain expression reading~}}
{{>>>>>>>}}

{{<<<<<<<}}
{{#furigana}}{{{definition}}}{{/furigana}}
{{~#furiganaPlain expression reading}}{{/furiganaPlain~}}
{{=======}}
{{furigana definition}}
{{~furiganaPlain expression reading~}}
{{>>>>>>>}}

{{<<<<<<<}}
<span class="expression-{{termFrequency}}">{{~#furiganaPlain}}{{{.}}}{{/furiganaPlain~}}</span>
{{#getMedia "audio"}}{{/getMedia}}
{{=======}}
<span class="expression-{{termFrequency}}">{{~furiganaPlain .~}}</span>
{{getMedia "audio"}}
{{>>>>>>>}}

{{<<<<<<<}}
{{#furiganaPlain}}{{{definition}}}{{/furiganaPlain}}
{{#getMedia "screenshot"}}{{/getMedia}}
{{=======}}
{{furiganaPlain definition}}
{{getMedia "screenshot"}}
{{>>>>>>>}}

{{<<<<<<<}}
<img src="{{#getMedia "screenshot"}}{{/getMedia}}" />
{{#getMedia "clipboardImage"}}{{/getMedia}}
{{=======}}
<img src="{{getMedia "screenshot"}}" />
{{getMedia "clipboardImage"}}
{{>>>>>>>}}

{{<<<<<<<}}
<img src="{{#getMedia "clipboardImage"}}{{/getMedia}}" />
{{#getMedia "clipboardText"}}{{/getMedia}}
{{=======}}
<img src="{{getMedia "clipboardImage"}}" />
{{getMedia "clipboardText"}}
{{>>>>>>>}}

{{<<<<<<<}}
{{~#if (hasMedia "clipboardText")}}{{#getMedia "clipboardText"}}{{/getMedia}}{{/if~}}
{{#getMedia "selectionText"}}{{/getMedia}}
{{=======}}
{{~#if (hasMedia "clipboardText")}}{{getMedia "clipboardText"}}{{/if~}}
{{getMedia "selectionText"}}
{{>>>>>>>}}

{{<<<<<<<}}
{{#getMedia "textFurigana" definition.cloze.sentence escape=false}}{{/getMedia}}
{{=======}}
{{getMedia "textFurigana" definition.cloze.sentence escape=false}}
{{>>>>>>>}}

{{<<<<<<<}}
Expand All @@ -89,9 +95,21 @@
{{>>>>>>>}}

{{<<<<<<<}}
{{~#furigana expression reading~}}{{~/furigana~}}
{{~#set "any" false}}{{/set~}}
{{=======}}
{{~furigana expression reading~}}
{{~set "any" false~}}
{{>>>>>>>}}

{{<<<<<<<}}
{{~#set "any" true}}{{/set~}}
{{=======}}
{{~set "any" true~}}
{{>>>>>>>}}

{{<<<<<<<}}
{{~#set "previousDictionary" dictionary~}}{{~/set~}}
{{=======}}
{{~set "previousDictionary" dictionary~}}
{{>>>>>>>}}

{{<<<<<<<}}
Expand All @@ -107,9 +125,9 @@
{{>>>>>>>}}

{{<<<<<<<}}
{{~#get "separator"}}{{/get~}}{{{.}}}
{{~#get "separator"}}{{/get~}}
{{=======}}
{{~get "separator"~}}{{{.}}}
{{~get "separator"~}}
{{>>>>>>>}}

{{<<<<<<<}}
Expand All @@ -131,21 +149,13 @@
{{>>>>>>>}}

{{<<<<<<<}}
{{~#set (concat "used_" .) true~}}{{~/set~}}
{{~#set "first" false~}}{{~/set~}}
{{~#set "first" false~}}{{~/set~}}
{{=======}}
{{~set (concat "used_" .) true~}}
{{~set "first" false~}}
{{~set "first" false~}}
{{>>>>>>>}}

{{<<<<<<<}}
{{~#if (hasMedia "selectionText")}}{{#getMedia "selectionText"}}{{/getMedia}}{{/if~}}
{{~#set (concat "used_" .) true~}}{{~/set~}}
{{=======}}
{{~#if (hasMedia "selectionText")}}{{getMedia "selectionText"}}{{/if~}}
{{>>>>>>>}}

{{<<<<<<<}}
{{#getMedia "textFurigana" definition.cloze.sentence escape=false}}{{/getMedia}}
{{=======}}
{{getMedia "textFurigana" definition.cloze.sentence escape=false}}
{{~set (concat "used_" .) true~}}
{{>>>>>>>}}

0 comments on commit 3b88696

Please sign in to comment.