forked from FooSoft/yomichan
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add glossary-first handlebars (#921)
* Add glossary-first handlebars * Add docs * Fix missing /if * Write handlebars test data
- Loading branch information
Showing
8 changed files
with
383 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
ext/data/templates/anki-field-templates-upgrade-v35.handlebars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{{<<<<<<<}} | ||
{{#*inline "glossary-brief"}} | ||
{{~> glossary brief=true ~}} | ||
{{/inline}} | ||
{{=======}} | ||
{{#*inline "glossary-brief"}} | ||
{{~> glossary brief=true ~}} | ||
{{/inline}} | ||
|
||
{{~#*inline "glossary-first"~}} | ||
<div style="text-align: left;"> | ||
{{~#scope~}} | ||
{{~#if (op "===" definition.type "term")~}} | ||
{{~> glossary-single definition brief=brief noDictionaryTag=noDictionaryTag ~}} | ||
{{~else if (op "||" (op "===" definition.type "termGrouped") (op "===" definition.type "termMerged"))~}} | ||
{{~#if (op ">" definition.definitions.length 1)~}} | ||
{{~#with definition.definitions.[0]~}}{{~> glossary-single . brief=../brief noDictionaryTag=../noDictionaryTag ~}}{{~/with~}} | ||
{{~else~}} | ||
{{~#with definition.definitions.[0]~}}{{~> glossary-single . brief=../brief noDictionaryTag=../noDictionaryTag ~}}{{~/with~}} | ||
{{~/if~}} | ||
{{~/if~}} | ||
{{~/scope~}} | ||
</div> | ||
{{~/inline~}} | ||
|
||
{{#*inline "glossary-first-no-dictionary"}} | ||
{{~> glossary-first noDictionaryTag=true ~}} | ||
{{/inline}} | ||
|
||
{{#*inline "glossary-first-brief"}} | ||
{{~> glossary-first brief=true ~}} | ||
{{/inline}} | ||
{{>>>>>>>}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.