From 008ffdb6bffc2855957be948a24c9e07730501d6 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 28 Nov 2020 14:30:50 -0500 Subject: Frequencies marker (#1074) * Update japanese.js tests * Simplify fallback/early exit * Add overloads to furigana and furiganaPlain handlebars helper functions * Expose unique expression/reading arrays (and subsequently counts) * Add {frequencies} marker --- docs/templates.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/templates.md b/docs/templates.md index 1c9081d2..7425bc4a 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -44,21 +44,27 @@ This function can be helpful for debugging values when creating templates. ### `furigana` -Converts a definition to its furigana representation. +Converts a definition or expression/reading pair to its furigana representation.
Syntax: - {{#furigana}}<definition>{{/furigana}} + {{#furigana}}<definition>{{/furigana}}
+ {{#furigana expression reading}}{{/furigana}}
* _`definition`_
The definition to convert. + * _`expression`_
+ The expression to convert. + * _`reading`_
+ The reading to convert.
Example: ```handlebars {{#furigana}}{{.}}{{/furigana}} + {{#furigana "読む" "よむ"}}{{/furigana}} ``` Output: @@ -73,21 +79,27 @@ Converts a definition to its furigana representation. ### `furiganaPlain` -Converts a definition to its simplified furigana representation. +Converts a definition or expression/reading pair to its simplified furigana representation.
Syntax: {{#furiganaPlain}}<definition>{{/furigana}} + {{#furiganaPlain expression reading}}{{/furiganaPlain}}
* _`definition`_
The definition to convert. + * _`expression`_
+ The expression to convert. + * _`reading`_
+ The reading to convert.
Example: ```handlebars {{~#furiganaPlain~}}{{.}}{{~/furiganaPlain~}} + {{#furiganaPlain "読む" "よむ"}}{{/furiganaPlain}} ``` Output: -- cgit v1.2.3