hugo-theme-relearn/exampleSite/content/shortcodes/expand.en.md
Sören Weber 42c8ec549b
code highlighter: avoid unstyled blocks in docs #32
The new highlighter does not work to well if no syntax is specified
for the code block / code fence / indention.
See https://github.com/gohugoio/hugo/pull/8917
2021-08-23 23:32:34 +02:00

91 lines
1.8 KiB
Markdown

---
title : Expand
description : "Displays an expandable/collapsible section of text on your page"
---
The Expand shortcode displays an expandable/collapsible section of text on your page.
## Usage
````go
{{%/* expand "Does this relearn theme rock?" { "true" | "false" } */%}}
Yes!
{{%/* /expand */%}}
````
The first optional parameter defines the text that appears next to the expand/collapse icon. The default text is `"Expand me..."`.
The second optional parameter controls if the block is initially shown as expanded (`"true"`) or collapsed (`"false"`). The default ist `"false"`.
## Examples
### All defaults
{{% expand %}}
Yes, you did it!
{{% /expand %}}
{{% expand "Show markup" "true" %}}
````go
{{%/* expand */%}}
Yes, you did it!
{{%/* /expand */%}}
````
{{% /expand %}}
### Initially expanded
{{% expand "Expand me..." "true" %}}
No need to press you!
{{% /expand %}}
{{% expand "Show markup" "true" %}}
````go
{{%/* expand "Expand me..." "true" */%}}
No need to press you!
{{%/* /expand */%}}
````
{{% /expand %}}
### Arbitrary text
{{% expand "Show me endless possibilities" %}}
Some expandable text.
You can add:
- multiple paragraphs
- bullet point lists
- _emphasized_, **bold** and even **_bold emphasized_** text
- [links](https://example.com)
- other shortcodes besides `expand`
- etc.
```plaintext
...and even source code
```
> the possiblities are endless
{{% /expand %}}
{{% expand "Show markup" %}}
````go
{{%/* expand "Show me endless possibilities" */%}}
Some expandable text.
You can add:
- multiple paragraphs
- bullet point lists
- _emphasized_, **bold** and even **_bold emphasized_** text
- [links](https://example.com)
- other shortcodes besides `expand`
- etc.
```plaintext
...and even source code
```
> the possiblities are endless
{{%/* /expand */%}}
````
{{% /expand %}}