docs: Add basic doc for wrapStandAloneImageWithinParagraph etc.

See #10492
This commit is contained in:
Bjørn Erik Pedersen 2022-12-05 16:50:47 +01:00
parent e93138dfdb
commit de9c5542ca
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
2 changed files with 53 additions and 42 deletions

View file

@ -84,7 +84,16 @@ PlainText
: The plain variant of the above. : The plain variant of the above.
Attributes (map) Attributes (map)
: A map of attributes (e.g. `id`, `class`) : A map of attributes (e.g. `id`, `class`). Note that this will currently always be empty for links.
The `render-image` templates will also receive:
IsBlock {{< new-in "0.108.0" >}}
: Returns true if this is a standalone image and the config option [markup.goldmark.parser.wrapStandAloneImageWithinParagraph](/getting-started/configuration-markup/#goldmark) is disabled.
Ordinal {{< new-in "0.108.0" >}}
: Zero-based ordinal for all the images in the current document.
### Link with title Markdown example ### Link with title Markdown example

View file

@ -1572,7 +1572,8 @@
"attribute": { "attribute": {
"title": true, "title": true,
"block": false "block": false
} },
"wrapStandAloneImageWithinParagraph": true
}, },
"extensions": { "extensions": {
"typographer": true, "typographer": true,
@ -1722,7 +1723,8 @@
}, },
"funcs": { "funcs": {
"getenv": [ "getenv": [
"^HUGO_" "^HUGO_",
"^CI$"
] ]
}, },
"http": { "http": {
@ -3632,7 +3634,7 @@
"Aliases": null, "Aliases": null,
"Examples": [ "Examples": [
[ [
"{{- $m := newScratch -}}\n{{- $m.Set \"Hugo\" \"Rocks!\" -}}\n{{- $m.Values | debug.Dump | safeHTML -}}", "{{ $m := newScratch }}\n{{ $m.Set \"Hugo\" \"Rocks!\" }}\n{{ $m.Values | debug.Dump | safeHTML }}",
"map[string]interface {}{\n \"Hugo\": \"Rocks!\",\n}" "map[string]interface {}{\n \"Hugo\": \"Rocks!\",\n}"
] ]
] ]
@ -4138,7 +4140,7 @@
], ],
"Examples": [ "Examples": [
[ [
"{{add 1 2}}", "{{ add 1 2 }}",
"3" "3"
] ]
] ]
@ -4151,7 +4153,7 @@
"Aliases": null, "Aliases": null,
"Examples": [ "Examples": [
[ [
"{{math.Ceil 2.1}}", "{{ math.Ceil 2.1 }}",
"3" "3"
] ]
] ]
@ -4173,7 +4175,7 @@
], ],
"Examples": [ "Examples": [
[ [
"{{div 6 3}}", "{{ div 6 3 }}",
"2" "2"
] ]
] ]
@ -4186,7 +4188,7 @@
"Aliases": null, "Aliases": null,
"Examples": [ "Examples": [
[ [
"{{math.Floor 1.9}}", "{{ math.Floor 1.9 }}",
"1" "1"
] ]
] ]
@ -4199,7 +4201,7 @@
"Aliases": null, "Aliases": null,
"Examples": [ "Examples": [
[ [
"{{math.Log 1}}", "{{ math.Log 1 }}",
"0" "0"
] ]
] ]
@ -4213,7 +4215,7 @@
"Aliases": null, "Aliases": null,
"Examples": [ "Examples": [
[ [
"{{math.Max 1 2 }}", "{{ math.Max 1 2 }}",
"2" "2"
] ]
] ]
@ -4227,7 +4229,7 @@
"Aliases": null, "Aliases": null,
"Examples": [ "Examples": [
[ [
"{{math.Min 1 2 }}", "{{ math.Min 1 2 }}",
"1" "1"
] ]
] ]
@ -4243,7 +4245,7 @@
], ],
"Examples": [ "Examples": [
[ [
"{{mod 15 3}}", "{{ mod 15 3 }}",
"0" "0"
] ]
] ]
@ -4259,7 +4261,7 @@
], ],
"Examples": [ "Examples": [
[ [
"{{modBool 15 3}}", "{{ modBool 15 3 }}",
"true" "true"
] ]
] ]
@ -4275,7 +4277,7 @@
], ],
"Examples": [ "Examples": [
[ [
"{{mul 2 3}}", "{{ mul 2 3 }}",
"6" "6"
] ]
] ]
@ -4291,7 +4293,7 @@
], ],
"Examples": [ "Examples": [
[ [
"{{math.Pow 2 3}}", "{{ math.Pow 2 3 }}",
"8" "8"
] ]
] ]
@ -4304,7 +4306,7 @@
"Aliases": null, "Aliases": null,
"Examples": [ "Examples": [
[ [
"{{math.Round 1.5}}", "{{ math.Round 1.5 }}",
"2" "2"
] ]
] ]
@ -4317,7 +4319,7 @@
"Aliases": null, "Aliases": null,
"Examples": [ "Examples": [
[ [
"{{math.Sqrt 81}}", "{{ math.Sqrt 81 }}",
"9" "9"
] ]
] ]
@ -4333,7 +4335,7 @@
], ],
"Examples": [ "Examples": [
[ [
"{{sub 3 2}}", "{{ sub 3 2 }}",
"1" "1"
] ]
] ]
@ -4870,7 +4872,7 @@
], ],
"Examples": [ "Examples": [
[ [
"{{chomp \"\u003cp\u003eBlockhead\u003c/p\u003e\\n\" | safeHTML }}", "{{ chomp \"\u003cp\u003eBlockhead\u003c/p\u003e\\n\" | safeHTML }}",
"\u003cp\u003eBlockhead\u003c/p\u003e" "\u003cp\u003eBlockhead\u003c/p\u003e"
] ]
] ]
@ -4920,7 +4922,7 @@
"Aliases": null, "Aliases": null,
"Examples": [ "Examples": [
[ [
"{{\"aabab\" | strings.Count \"a\" }}", "{{ \"aabab\" | strings.Count \"a\" }}",
"3" "3"
] ]
] ]
@ -5078,11 +5080,11 @@
], ],
"Examples": [ "Examples": [
[ [
"{{slicestr \"BatMan\" 0 3}}", "{{ slicestr \"BatMan\" 0 3 }}",
"Bat" "Bat"
], ],
[ [
"{{slicestr \"BatMan\" 3}}", "{{ slicestr \"BatMan\" 3 }}",
"Man" "Man"
] ]
] ]
@ -5109,11 +5111,11 @@
], ],
"Examples": [ "Examples": [
[ [
"{{substr \"BatMan\" 0 -3}}", "{{ substr \"BatMan\" 0 -3 }}",
"Bat" "Bat"
], ],
[ [
"{{substr \"BatMan\" 3 3}}", "{{ substr \"BatMan\" 3 3 }}",
"Man" "Man"
] ]
] ]
@ -5128,11 +5130,11 @@
], ],
"Examples": [ "Examples": [
[ [
"{{title \"Bat man\"}}", "{{ title \"Bat man\" }}",
"Bat Man" "Bat Man"
], ],
[ [
"{{title \"somewhere over the rainbow\"}}", "{{ title \"somewhere over the rainbow\" }}",
"Somewhere Over the Rainbow" "Somewhere Over the Rainbow"
] ]
] ]
@ -5147,7 +5149,7 @@
], ],
"Examples": [ "Examples": [
[ [
"{{lower \"BatMan\"}}", "{{ lower \"BatMan\" }}",
"batman" "batman"
] ]
] ]
@ -5162,7 +5164,7 @@
], ],
"Examples": [ "Examples": [
[ [
"{{upper \"BatMan\"}}", "{{ upper \"BatMan\" }}",
"BATMAN" "BATMAN"
] ]
] ]
@ -5388,11 +5390,11 @@
], ],
"Examples": [ "Examples": [
[ [
"{{ htmlEscape \"Cathal Garvey \u0026 The Sunshine Band \u003ccathal@foo.bar\u003e\" | safeHTML}}", "{{ htmlEscape \"Cathal Garvey \u0026 The Sunshine Band \u003ccathal@foo.bar\u003e\" | safeHTML }}",
"Cathal Garvey \u0026amp; The Sunshine Band \u0026lt;cathal@foo.bar\u0026gt;" "Cathal Garvey \u0026amp; The Sunshine Band \u0026lt;cathal@foo.bar\u0026gt;"
], ],
[ [
"{{ htmlEscape \"Cathal Garvey \u0026 The Sunshine Band \u003ccathal@foo.bar\u003e\"}}", "{{ htmlEscape \"Cathal Garvey \u0026 The Sunshine Band \u003ccathal@foo.bar\u003e\" }}",
"Cathal Garvey \u0026amp;amp; The Sunshine Band \u0026amp;lt;cathal@foo.bar\u0026amp;gt;" "Cathal Garvey \u0026amp;amp; The Sunshine Band \u0026amp;lt;cathal@foo.bar\u0026amp;gt;"
], ],
[ [
@ -5411,15 +5413,15 @@
], ],
"Examples": [ "Examples": [
[ [
"{{ htmlUnescape \"Cathal Garvey \u0026amp; The Sunshine Band \u0026lt;cathal@foo.bar\u0026gt;\" | safeHTML}}", "{{ htmlUnescape \"Cathal Garvey \u0026amp; The Sunshine Band \u0026lt;cathal@foo.bar\u0026gt;\" | safeHTML }}",
"Cathal Garvey \u0026 The Sunshine Band \u003ccathal@foo.bar\u003e" "Cathal Garvey \u0026 The Sunshine Band \u003ccathal@foo.bar\u003e"
], ],
[ [
"{{\"Cathal Garvey \u0026amp;amp; The Sunshine Band \u0026amp;lt;cathal@foo.bar\u0026amp;gt;\" | htmlUnescape | htmlUnescape | safeHTML}}", "{{ \"Cathal Garvey \u0026amp;amp; The Sunshine Band \u0026amp;lt;cathal@foo.bar\u0026amp;gt;\" | htmlUnescape | htmlUnescape | safeHTML }}",
"Cathal Garvey \u0026 The Sunshine Band \u003ccathal@foo.bar\u003e" "Cathal Garvey \u0026 The Sunshine Band \u003ccathal@foo.bar\u003e"
], ],
[ [
"{{\"Cathal Garvey \u0026amp;amp; The Sunshine Band \u0026amp;lt;cathal@foo.bar\u0026amp;gt;\" | htmlUnescape | htmlUnescape }}", "{{ \"Cathal Garvey \u0026amp;amp; The Sunshine Band \u0026amp;lt;cathal@foo.bar\u0026amp;gt;\" | htmlUnescape | htmlUnescape }}",
"Cathal Garvey \u0026amp; The Sunshine Band \u0026lt;cathal@foo.bar\u0026gt;" "Cathal Garvey \u0026amp; The Sunshine Band \u0026lt;cathal@foo.bar\u0026gt;"
], ],
[ [
@ -5456,7 +5458,7 @@
], ],
"Examples": [ "Examples": [
[ [
"{{ .Title | markdownify}}", "{{ .Title | markdownify }}",
"\u003cstrong\u003eBatMan\u003c/strong\u003e" "\u003cstrong\u003eBatMan\u003c/strong\u003e"
] ]
] ]