Details

Shortcode to generate HTML details tag, which is used to specify additional details that the user can open and close on demand.

Syntax

1{{% details [summary] [open] %}}
2CONTENT
3{{% /details %}}

Parameters

summary

PositionNameTypeRequiredDefaultSince
#0summarystring--

The summary of details.

open

PositionNameTypeRequiredDefaultSince
#1openboolean---

When true, expand the details by default.

Examples

Collapsed Details Example

1{{% details "hello.php" %}}
2```php
3echo "Hello world!";
4```
5{{% /details %}}
hello.php
1echo "Hello world!";

Expanded Details Example

1{{% details "hello.js" true %}}
2```js
3console.log("Hello world!");
4```
5{{% /details %}}
hello.js
1console.log("Hello world!");