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

PositionNameTypeRequiredDefaultSinceExample
#0summarystring---

The summary of details.

open

PositionNameTypeRequiredDefaultSinceExample
#1openboolean----

When true, expand the details by default.

Examples

Collapsed Details Example

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

Expanded Details Example

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