Skip to content

Commit b7f9c8c

Browse files
authored
details shortcode: add example of both alternatives (#783)
* details shortcode: add example of both alternatives readme: mention steps shortcode, move katex alpha order steps: use 1. instead of fixed numbers * roll back steps.md * positional vs argument. bonus typo fix
1 parent e08d9b7 commit b7f9c8c

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,10 @@ In fact almost empty not quite empty because an empty file looks like absent for
287287
- [Columns](https://hugo-book-demo.netlify.app/docs/shortcodes/columns/)
288288
- [Details](https://hugo-book-demo.netlify.app/docs/shortcodes/details/)
289289
- [Hints](https://hugo-book-demo.netlify.app/docs/shortcodes/hints/)
290+
- [KaTeX](https://hugo-book-demo.netlify.app/docs/shortcodes/katex/)
290291
- [Mermaid](https://hugo-book-demo.netlify.app/docs/shortcodes/mermaid/)
292+
- [Steps](https://hugo-book-demo.netlify.app/docs/shortcodes/steps/)
291293
- [Tabs](https://hugo-book-demo.netlify.app/docs/shortcodes/tabs/)
292-
- [KaTeX](https://hugo-book-demo.netlify.app/docs/shortcodes/katex/)
293294

294295
By default, Goldmark trims unsafe outputs which might prevent some shortcodes from rendering. It is recommended to set `markup.goldmark.renderer.unsafe=true` if you encounter problems.
295296

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
# Details
22

3-
Details shortcode is a helper for `details` html5 element. It is going to replace `expand` shortcode.
3+
Details shortcode is a helper for `details` html5 element. To collapse the details either omit the `open`
4+
keyword when using positional arguments or set `open=false` when using parameters.
45

5-
## Example
6+
## Example with positional arguments
67
```tpl
78
{{%/* details "Title" [open] */%}}
89
## Markdown content
910
Lorem markdownum insigne...
1011
{{%/* /details */%}}
1112
```
13+
14+
{{% details "Title" open %}}
15+
## Markdown content
16+
Lorem markdownum insigne...
17+
{{% /details %}}
18+
19+
## Example with parameters
1220
```tpl
1321
{{%/* details title="Title" open=true */%}}
1422
## Markdown content
1523
Lorem markdownum insigne...
1624
{{%/* /details */%}}
1725
```
1826

19-
{{% details "Title" open %}}
27+
{{% details title="Title" open=true %}}
2028
## Markdown content
2129
Lorem markdownum insigne...
2230
{{% /details %}}

layouts/_shortcodes/columns.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{- $ratio := (split (.Get "ratio") ":") -}}
22
{{- if strings.Contains .InnerDeindent "<--->" -}}
3-
{{- warnf "Columns shortcode seprator '<--->' is deprecated, use markdown list instead." -}}
3+
{{- warnf "Columns shortcode separator '<--->' is deprecated, use markdown list instead." -}}
44
{{- $attributes := partial "docs/text/mapper" (dict
55
"attributes" (cond .IsNamedParams .Params dict)
66
"merge" (dict

0 commit comments

Comments
 (0)