From 832c8c9f49a2c4411684c1bc092a84700c135829 Mon Sep 17 00:00:00 2001 From: MarvNC Date: Thu, 18 Jan 2024 17:04:50 -0800 Subject: [PATCH] Fix indentation in details blocks --- docs/templates.md | 196 +++++++++++++++++++++++----------------------- 1 file changed, 98 insertions(+), 98 deletions(-) diff --git a/docs/templates.md b/docs/templates.md index 63bff62b76..234b971cff 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -23,25 +23,25 @@ for debugging values when creating templates. ```handlebars -
{{dumpObject .}}
+
{{dumpObject .}}
``` Output: ```html -
{
-      "key": "value"
-  }
+
{
+    "key": "value"
+}
``` Preview: ```html - { - "key": "value" - } +{ + "key": "value" +} ``` @@ -65,15 +65,15 @@ Converts a definition or expression/reading pair to its furigana representation. ```handlebars - {{furigana .}} - {{furigana "読む" "よむ"}} +{{furigana .}} +{{furigana "読む" "よむ"}} ``` Output: ```html - む +む ``` Preview @@ -101,15 +101,15 @@ representation. ```handlebars - {{~furiganaPlain .~}} - {{furiganaPlain "読む" "よむ"}} +{{~furiganaPlain .~}} +{{furiganaPlain "読む" "よむ"}} ``` Output: ```html - 読[よ]む +読[よ]む ``` @@ -129,18 +129,18 @@ Replaces newline characters with a forced HTML line break `
`. ```handlebars - {{#multiLine~}} - some - multiline - text - {{~/multiLine}} +{{#multiLine~}} +some +multiline +text +{{~/multiLine}} ``` Output: ```html - some
multiline
text +some
multiline
text ``` Preview: @@ -179,14 +179,14 @@ multiple arguments are present, they are all concatenated. ```handlebars - {{#regexReplace "\(([^)]*)\)" "$1" "g"~}}Here is (some) (text) (in) (parentheses){{~/regexReplace}} +{{#regexReplace "\(([^)]*)\)" "$1" "g"~}}Here is (some) (text) (in) (parentheses){{~/regexReplace}} ``` Output: ```html - Here is some text in parentheses +Here is some text in parentheses ``` @@ -218,14 +218,14 @@ multiple arguments are present, they are all concatenated. ```handlebars - {{#regexMatch "\(([^)]*)\)" "g"~}}Here is (some) (text) (in) (parentheses){{~/regexMatch}} +{{#regexMatch "\(([^)]*)\)" "g"~}}Here is (some) (text) (in) (parentheses){{~/regexMatch}} ``` Output: ```html - (some)(text)(in)(parentheses) +(some)(text)(in)(parentheses) ``` @@ -250,14 +250,14 @@ representation of the tags separated by commas. ```handlebars - {{~mergeTags definition group merge~}} +{{~mergeTags definition group merge~}} ``` Output: ```html - v5m, vt, JMdict (English) +v5m, vt, JMdict (English) ``` @@ -286,14 +286,14 @@ empty. The context is unchanged. ```handlebars - {{~#eachUpTo someArray 5}}{{{.}}}
{{else}}Empty{{/mergeTags~}} +{{~#eachUpTo someArray 5}}{{{.}}}
{{else}}Empty{{/mergeTags~}} ``` Output: ```html - someArray[0]
someArray[1]
someArray[2]
someArray[3]
someArray[4]
+someArray[0]
someArray[1]
someArray[2]
someArray[3]
someArray[4]
``` Preview: @@ -323,14 +323,14 @@ single array. ```handlebars - {{#each (spread array1 array2)}}{{{.}}}
{{/each}} +{{#each (spread array1 array2)}}{{{.}}}
{{/each}} ``` Output: ```html - array1[0]
array1[1]
array2[0]
array2[1]
+array1[0]
array1[1]
array2[0]
array2[1]
``` Preview: @@ -365,16 +365,16 @@ If an unknown operator is specified, the `undefined` value is returned. ```handlebars - {{#if (op "===" value1 value2)}}Values are equal{{/if~}}
- {{~#op "-" value1}}{{/op~}}
- {{~op "?:" value1 "a" "b"}} +{{#if (op "===" value1 value2)}}Values are equal{{/if~}}
+{{~#op "-" value1}}{{/op~}}
+{{~op "?:" value1 "a" "b"}} ``` Output: ```html - Values are equal
-32
a +Values are equal
-32
a ``` Preview: @@ -398,14 +398,14 @@ Gets a value from the custom state stack. ```handlebars - {{get "some-text"}} +{{get "some-text"}} ``` Output: ```html - This is the value of some-text! +This is the value of some-text! ``` @@ -428,8 +428,8 @@ Assigns a value to the custom state stack. ```handlebars - {{#set "some-text"}}This is the value of some-text!{{/set~}} - {{~set "some-number" 32}} +{{#set "some-text"}}This is the value of some-text!{{/set~}} +{{~set "some-number" 32}} ``` Output: @@ -459,21 +459,21 @@ recent scope and work backwards until a value is found. ```handlebars - {{~set "key" 32~}} - {{~get "key"~}}, - {{~#scope~}} - {{~#get "key"~}}, - {{~#set "key" 64~}} - {{~#get "key"~}}, - {{~/scope~}} - {{~get "key"~}} +{{~set "key" 32~}} +{{~get "key"~}}, +{{~#scope~}} + {{~#get "key"~}}, + {{~#set "key" 64~}} + {{~#get "key"~}}, +{{~/scope~}} +{{~get "key"~}} ``` Output: ```html - 32,32,64,32 +32,32,64,32 ``` @@ -495,14 +495,14 @@ Repeatedly gets a property of an object. ```handlebars - {{property someObject "field" 0 "toString"}} +{{property someObject "field" 0 "toString"}} ``` Output: ```html - function toString() { [native code] } +function toString() { [native code] } ``` @@ -522,14 +522,14 @@ No-op. Returns the inner contents of the template. ```handlebars - {{noop}}Unchanged content{{/noop}} +{{noop}}Unchanged content{{/noop}} ``` Output: ```html - Unchanged content +Unchanged content ``` @@ -550,14 +550,14 @@ mora and the position of the downstep. ```handlebars - {{#if (isMoraPitchHigh 1 2)}}High pitch{{else}}Low pitch{{/if}} +{{#if (isMoraPitchHigh 1 2)}}High pitch{{else}}Low pitch{{/if}} ``` Output: ```html - High pitch +High pitch ``` @@ -577,14 +577,14 @@ Returns an array of the mora for a kana string. ```handlebars - {{#each (getKanaMorae "よみたん")}}{{{.}}}
{{/each}} +{{#each (getKanaMorae "よみたん")}}{{{.}}}
{{/each}} ``` Output: ```html - よ



+よ



``` Preview: @@ -610,18 +610,18 @@ Returns the type of a value. `#typeof` in the block form will always return ```handlebars - {{typeof "よみたん"}} - {{typeof 1}} - {{#typeof}}よみたん{{/typeof}} +{{typeof "よみたん"}} +{{typeof 1}} +{{#typeof}}よみたん{{/typeof}} ``` Output: ```html - string - number - string +string +number +string ``` @@ -644,15 +644,15 @@ arguments that are arrays. ```handlebars - {{set "index" 32~}} - {{~join "_" "yomitan" (get "index") "value"}} +{{set "index" 32~}} +{{~join "_" "yomitan" (get "index") "value"}} ``` Output: ```html - yomitan_32_value +yomitan_32_value ``` @@ -674,15 +674,15 @@ arrays. ```handlebars - {{set "index" 32~}} - {{~concat "yomitan_" (get "index") "_value"}} +{{set "index" 32~}} +{{~concat "yomitan_" (get "index") "_value"}} ``` Output: ```html - yomitan_32_value +yomitan_32_value ``` @@ -704,14 +704,14 @@ term. ```handlebars - [{{#each (pitchCategories @root)}}{{.}}{{#unless @last}}, {{/unless}}{{/each}}] +[{{#each (pitchCategories @root)}}{{.}}{{#unless @last}}, {{/unless}}{{/each}}] ``` Output: ```html - [heiban, kifuku] +[heiban, kifuku] ``` @@ -734,14 +734,14 @@ structured-content generation. ```handlebars - {{#each glossary}}{{formatGlossary ../dictionary .}}{{/each}} +{{#each glossary}}{{formatGlossary ../dictionary .}}{{/each}} ``` Output: ```html - Here is the content of a gloss, which may include formatted HTML. +Here is the content of a gloss, which may include formatted HTML. ``` @@ -781,40 +781,40 @@ Name" ```handlebars - {{#if (hasMedia "audio")}}The audio file name is: {{getMedia "audio"}}{{/if}} +{{#if (hasMedia "audio")}}The audio file name is: {{getMedia "audio"}}{{/if}} - {{#if (hasMedia "screenshot")}}The screenshot file name is: {{getMedia "screenshot"}}{{/if}} +{{#if (hasMedia "screenshot")}}The screenshot file name is: {{getMedia "screenshot"}}{{/if}} - {{#if (hasMedia "clipboardImage")}}The clipboard image file name is: {{getMedia "clipboardImage"}}{{/if}} +{{#if (hasMedia "clipboardImage")}}The clipboard image file name is: {{getMedia "clipboardImage"}}{{/if}} - {{#if (hasMedia "clipboardText")}}The clipboard text is: {{getMedia "clipboardText"}}{{/if}} +{{#if (hasMedia "clipboardText")}}The clipboard text is: {{getMedia "clipboardText"}}{{/if}} - {{#if (hasMedia "selectionText")}}The selection text is: {{getMedia "selectionText"}}{{/if}} +{{#if (hasMedia "selectionText")}}The selection text is: {{getMedia "selectionText"}}{{/if}} - {{#if (hasMedia "textFurigana" "日本語")}}This is an example of text with generated furigana: {{getMedia "textFurigana" "日本語" escape=false}}{{/if}} +{{#if (hasMedia "textFurigana" "日本語")}}This is an example of text with generated furigana: {{getMedia "textFurigana" "日本語" escape=false}}{{/if}} - {{#if (hasMedia "dictionaryMedia" "image.png" dictionary="Example Dictionary")}}The remapped file name for image.png is: {{getMedia "dictionaryMedia" "image.png" dictionary="Example Dictionary"}}{{/if}} +{{#if (hasMedia "dictionaryMedia" "image.png" dictionary="Example Dictionary")}}The remapped file name for image.png is: {{getMedia "dictionaryMedia" "image.png" dictionary="Example Dictionary"}}{{/if}} ``` Output: ```html - The audio file name is: yomitan_audio_にほんご_日本語.mp3 +The audio file name is: yomitan_audio_にほんご_日本語.mp3 - The screenshot file name is: yomitan_browser_screenshot_にほんご_日本語.png +The screenshot file name is: yomitan_browser_screenshot_にほんご_日本語.png - The clipboard image file name is: yomitan_clipboard_image_にほんご_日本語.png +The clipboard image file name is: yomitan_clipboard_image_にほんご_日本語.png - The clipboard text is: This is the clipboard text +The clipboard text is: This is the clipboard text - The selection text is: This is the selection text +The selection text is: This is the selection text - The selection text is: This is the selection text +The selection text is: This is the selection text - This is an example of text with generated furigana: 日本語にほんご +This is an example of text with generated furigana: 日本語にほんご - The remapped file name for image.png is: yomitan_dictionary_media_1_にほんご_日本語.png +The remapped file name for image.png is: yomitan_dictionary_media_1_にほんご_日本語.png ``` @@ -847,7 +847,7 @@ devoiced. ```handlebars - {{~pronunciation format='text' reading='よむ' downstepPosition=1~}} +{{~pronunciation format='text' reading='よむ' downstepPosition=1~}} ``` @@ -872,20 +872,20 @@ if not specified. ```handlebars - {{hiragana "よみたん ヨミたん ヨミタン"}} - {{#hiragana}}よみたん ヨミたん ヨミタン{{/hiragana}} - {{#hiragana}}ローマ字{{/hiragana}} - {{#hiragana keepProlongedSoundMarks=true}}ローマ字{{/hiragana}} +{{hiragana "よみたん ヨミたん ヨミタン"}} +{{#hiragana}}よみたん ヨミたん ヨミタン{{/hiragana}} +{{#hiragana}}ローマ字{{/hiragana}} +{{#hiragana keepProlongedSoundMarks=true}}ローマ字{{/hiragana}} ``` Output: ```html - よみたん よみたん よみたん - よみたん よみたん よみたん - ろうま字 - ろーま字 +よみたん よみたん よみたん +よみたん よみたん よみたん +ろうま字 +ろーま字 ``` @@ -907,16 +907,16 @@ Converts hiragana text to katakana. ```handlebars - {{katakana "よみたん ヨミたん ヨミタン"}} - {{#katakana}}よみたん ヨミたん ヨミタン{{/katakana}} +{{katakana "よみたん ヨミたん ヨミタン"}} +{{#katakana}}よみたん ヨミたん ヨミタン{{/katakana}} ``` Output: ```html - ヨミタン ヨミタン ヨミタン - ヨミタン ヨミタン ヨミタン +ヨミタン ヨミタン ヨミタン +ヨミタン ヨミタン ヨミタン ```