2021-08-25 11:33:29 +00:00
|
|
|
+++
|
2022-06-05 17:31:59 +00:00
|
|
|
description = "Expandable/collapsible sections of text"
|
2021-08-25 11:33:29 +00:00
|
|
|
title = "Expand"
|
|
|
|
+++
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
The `expand` shortcode displays an expandable/collapsible section of text.
|
|
|
|
|
|
|
|
{{% expand title="Expand me..." %}}Thank you!{{% /expand %}}
|
2021-07-16 20:35:20 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
While the examples are using named parameter you are free to use positional aswell.
|
|
|
|
|
|
|
|
{{< tabs groupId="shortcode-parameter">}}
|
|
|
|
{{% tab name="named" %}}
|
|
|
|
|
2021-08-23 21:32:34 +00:00
|
|
|
````go
|
2022-06-05 17:31:59 +00:00
|
|
|
{{%/* expand title="Expand me..." */%}}Thank you!{{%/* /expand */%}}
|
2021-07-16 20:35:20 +00:00
|
|
|
````
|
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
{{% /tab %}}
|
|
|
|
{{% tab name="positional" %}}
|
2021-07-16 20:35:20 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
````go
|
|
|
|
{{%/* expand "Expand me..." */%}}Thank you!{{%/* /expand */%}}
|
|
|
|
````
|
2021-07-16 20:35:20 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
{{% /tab %}}
|
|
|
|
{{< /tabs >}}
|
2021-09-03 22:50:08 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
### Parameter
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
| Name | Position | Default | Notes |
|
|
|
|
|:----------------------|:---------|:-----------------|:------------|
|
|
|
|
| **title** | 1 | `"Expand me..."` | Arbitray text to appear next to the expand/collapse icon. |
|
|
|
|
| **open** | 2 | `false` | When `true` the content text will be initially shown as expanded. |
|
|
|
|
| _**<content>**_ | | _<empty>_ | Arbitray text to be displayed on expand. |
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
### All Defaults
|
2021-07-16 20:35:20 +00:00
|
|
|
|
2021-08-23 21:32:34 +00:00
|
|
|
````go
|
2022-06-05 17:31:59 +00:00
|
|
|
{{%/* expand */%}}Yes, you did it!{{%/* /expand */%}}
|
2021-07-16 20:35:20 +00:00
|
|
|
````
|
2021-07-16 21:51:11 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
{{% expand %}}Yes, you did it!{{% /expand %}}
|
2021-07-16 21:51:11 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
### Initially Expanded
|
2021-07-16 21:51:11 +00:00
|
|
|
|
2021-08-23 21:32:34 +00:00
|
|
|
````go
|
2022-06-05 17:31:59 +00:00
|
|
|
{{%/* expand title="Expand me..." open="true" */%}}No need to press you!{{%/* /expand */%}}
|
2021-07-16 21:51:11 +00:00
|
|
|
````
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
{{% expand title="Expand me..." open="true" %}}No need to press you!{{% /expand %}}
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
### Arbitrary Text
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
````go
|
|
|
|
{{%/* expand title="Show me almost endless possibilities" */%}}
|
2022-05-23 12:59:24 +00:00
|
|
|
You can add standard markdown syntax:
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2021-07-16 20:35:20 +00:00
|
|
|
- multiple paragraphs
|
|
|
|
- bullet point lists
|
2021-07-26 08:10:10 +00:00
|
|
|
- _emphasized_, **bold** and even **_bold emphasized_** text
|
2021-07-16 20:35:20 +00:00
|
|
|
- [links](https://example.com)
|
|
|
|
- etc.
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2021-08-23 21:32:34 +00:00
|
|
|
```plaintext
|
2021-07-16 20:35:20 +00:00
|
|
|
...and even source code
|
|
|
|
```
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2022-05-23 12:59:24 +00:00
|
|
|
> the possiblities are endless (almost - including other shortcodes may or may not work)
|
2022-06-05 17:31:59 +00:00
|
|
|
{{%/* /expand */%}}
|
|
|
|
````
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
{{% expand title="Show me almost endless possibilities" %}}
|
2022-05-23 12:59:24 +00:00
|
|
|
You can add standard markdown syntax:
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2021-07-16 20:35:20 +00:00
|
|
|
- multiple paragraphs
|
|
|
|
- bullet point lists
|
2021-07-26 08:10:10 +00:00
|
|
|
- _emphasized_, **bold** and even **_bold emphasized_** text
|
2021-07-16 20:35:20 +00:00
|
|
|
- [links](https://example.com)
|
|
|
|
- etc.
|
|
|
|
|
2021-08-23 21:32:34 +00:00
|
|
|
```plaintext
|
2021-07-16 20:35:20 +00:00
|
|
|
...and even source code
|
|
|
|
```
|
|
|
|
|
2022-05-23 12:59:24 +00:00
|
|
|
> the possiblities are endless (almost - including other shortcodes may or may not work)
|
2021-07-16 21:51:11 +00:00
|
|
|
{{% /expand %}}
|