diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-07-07 20:00:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-07 20:00:30 -0400 |
commit | 315dc425e489dc96c2f2d4e13b500105d724ec52 (patch) | |
tree | 380f1f793b158d5a7652dd08fa0cd10d7378679f /ext/data | |
parent | 9935e154f1d2d9881c636b9a93f9d31b04621287 (diff) |
Anki card selected text (#1809)
* Add support for injecting the text selection into Anki cards
* Add selection-text
* Upgrade to add {selection-text}
* Update descriptions
* Update test data
Diffstat (limited to 'ext/data')
-rw-r--r-- | ext/data/templates/anki-field-templates-upgrade-v13.handlebars | 4 | ||||
-rw-r--r-- | ext/data/templates/default-anki-field-templates.handlebars | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/ext/data/templates/anki-field-templates-upgrade-v13.handlebars b/ext/data/templates/anki-field-templates-upgrade-v13.handlebars index ebf9069e..78820b95 100644 --- a/ext/data/templates/anki-field-templates-upgrade-v13.handlebars +++ b/ext/data/templates/anki-field-templates-upgrade-v13.handlebars @@ -1,3 +1,7 @@ +{{#*inline "selection-text"}} + {{~#if (hasMedia "selectionText")}}{{#getMedia "selectionText" format="text"}}{{/getMedia}}{{/if~}} +{{/inline}} + {{<<<<<<<}} {{#each glossary}}{{#multiLine}}{{.}}{{/multiLine}}{{/each}} {{=======}} diff --git a/ext/data/templates/default-anki-field-templates.handlebars b/ext/data/templates/default-anki-field-templates.handlebars index 62da796d..c9ee2833 100644 --- a/ext/data/templates/default-anki-field-templates.handlebars +++ b/ext/data/templates/default-anki-field-templates.handlebars @@ -378,4 +378,8 @@ {{~#multiLine}}{{context.fullQuery}}{{/multiLine~}} {{/inline}} +{{#*inline "selection-text"}} + {{~#if (hasMedia "selectionText")}}{{#getMedia "selectionText" format="text"}}{{/getMedia}}{{/if~}} +{{/inline}} + {{~> (lookup . "marker") ~}} |