From dfd52e1ecd6919094e0b45fde2ca03c30eaad01f Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Wed, 25 Aug 2021 21:58:51 -0400 Subject: Hiragana & katakana helpers (#1908) * Add hiragana and katakana template helpers * Update documentation * Fix documentation --- docs/templates.md | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) (limited to 'docs/templates.md') diff --git a/docs/templates.md b/docs/templates.md index f1777fde..be17c30a 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -539,8 +539,8 @@ Returns the type of a value.
Syntax: - {{#typeof value}}{{/get}}
- {{#typeof}}value{{/get}}
+ {{#typeof value}}{{/typeof}}
+ {{#typeof}}value{{/typeof}}
* _`value`_
The value to check. @@ -775,6 +775,64 @@ same as the system used for generating popup and search page dictionary entries.
+### `hiragana` + +Converts katakana text to hiragana. + +
+ Syntax: + + {{#hiragana value}}{{/hiragana}}
+ {{#hiragana}}value{{/hiragana}}
+ + * _`value`_
+ The text to convert. +
+
+ Example: + + ```handlebars + {{#hiragana "よみちゃん ヨミちゃん ヨミチャン"}}{{/hiragana}} + {{#hiragana}}よみちゃん ヨミちゃん ヨミチャン{{/hiragana}} + ``` + + Output: + ```html + よみちゃん よみちゃん よみちゃん + よみちゃん よみちゃん よみちゃん + ``` +
+ + +### `katakana` + +Converts hiragana text to katakana. + +
+ Syntax: + + {{#katakana text}}{{/katakana}}
+ {{#katakana}}text{{/katakana}}
+ + * _`text`_
+ The text to convert. +
+
+ Example: + + ```handlebars + {{#hiragana "よみちゃん ヨミちゃん ヨミチャン"}}{{/hiragana}} + {{#hiragana}}よみちゃん ヨミちゃん ヨミチャン{{/hiragana}} + ``` + + Output: + ```html + ヨミチャン ヨミチャン ヨミチャン + ヨミチャン ヨミチャン ヨミチャン + ``` +
+ + ## Legacy Helpers Yomichan has historically used Handlebars templates to generate the HTML used on the search page and results popup. -- cgit v1.2.3