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
This commit is contained in:
@@ -287,9 +287,10 @@ In fact almost empty not quite empty because an empty file looks like absent for
|
||||
- [Columns](https://hugo-book-demo.netlify.app/docs/shortcodes/columns/)
|
||||
- [Details](https://hugo-book-demo.netlify.app/docs/shortcodes/details/)
|
||||
- [Hints](https://hugo-book-demo.netlify.app/docs/shortcodes/hints/)
|
||||
- [Mermaid](https://hugo-book-demo.netlify.app/docs/shortcodes/mermaid/)
|
||||
- [Tabs](https://hugo-book-demo.netlify.app/docs/shortcodes/tabs/)
|
||||
- [KaTeX](https://hugo-book-demo.netlify.app/docs/shortcodes/katex/)
|
||||
- [Mermaid](https://hugo-book-demo.netlify.app/docs/shortcodes/mermaid/)
|
||||
- [Steps](https://hugo-book-demo.netlify.app/docs/shortcodes/steps/)
|
||||
- [Tabs](https://hugo-book-demo.netlify.app/docs/shortcodes/tabs/)
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -1,22 +1,30 @@
|
||||
# Details
|
||||
|
||||
Details shortcode is a helper for `details` html5 element. It is going to replace `expand` shortcode.
|
||||
Details shortcode is a helper for `details` html5 element. To collapse the details either omit the `open`
|
||||
keyword when using positional arguments or set `open=false` when using parameters.
|
||||
|
||||
## Example
|
||||
## Example with positional arguments
|
||||
```tpl
|
||||
{{%/* details "Title" [open] */%}}
|
||||
## Markdown content
|
||||
Lorem markdownum insigne...
|
||||
{{%/* /details */%}}
|
||||
```
|
||||
```tpl
|
||||
{{%/* details title="Title" open=true */%}}
|
||||
## Markdown content
|
||||
Lorem markdownum insigne...
|
||||
{{%/* /details */%}}
|
||||
```
|
||||
|
||||
{{% details "Title" open %}}
|
||||
## Markdown content
|
||||
Lorem markdownum insigne...
|
||||
{{% /details %}}
|
||||
|
||||
## Example with parameters
|
||||
```tpl
|
||||
{{%/* details title="Title" open=true */%}}
|
||||
## Markdown content
|
||||
Lorem markdownum insigne...
|
||||
{{%/* /details */%}}
|
||||
```
|
||||
|
||||
{{% details title="Title" open=true %}}
|
||||
## Markdown content
|
||||
Lorem markdownum insigne...
|
||||
{{% /details %}}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{- $ratio := (split (.Get "ratio") ":") -}}
|
||||
{{- if strings.Contains .InnerDeindent "<--->" -}}
|
||||
{{- warnf "Columns shortcode seprator '<--->' is deprecated, use markdown list instead." -}}
|
||||
{{- warnf "Columns shortcode separator '<--->' is deprecated, use markdown list instead." -}}
|
||||
{{- $attributes := partial "docs/text/mapper" (dict
|
||||
"attributes" (cond .IsNamedParams .Params dict)
|
||||
"merge" (dict
|
||||
|
||||
Reference in New Issue
Block a user