Details Demo

Example 1

This example shows the use of the dtext shortcode to quickly create a details block containing text. The default summary text of “Details” is used and the details block is closed until opened.

Syntax

{{< dtext "This is details text." >}}

Output

Details
This is details text.

Example 2

This example shows the use of the summary argument to control the summary text.

Syntax

{{< dtext "This is details text." summary="Hint" >}}

Output

Hint
This is details text.

Example 3

This example shows the use of the open flag to make the details block open until closed.

Syntax

{{< dtext "This is details text that is visible by default." summary="Hint" open >}}

Output

Hint
This is details text that is visible by default.

Example 4

This example shows the use of the dstart and dstop shortcodes to create a more flexible details block containing markdown as well as an executed code chunk.

Syntax

{{< dstart summary="Answer Key" >}}

**Here is some markdown**

```{r}
# And here is an R code chunk
plot(iris$Sepal.Length, iris$Sepal.Width)
```

{{< dstop >}}

Output

Answer Key

Here is some markdown

# And here is an R code chunk
plot(iris$Sepal.Length, iris$Sepal.Width)

Example 5

This example shows that the open flag works with the dstart shortcode too.

Syntax

{{< dstart summary="Answer Key" open >}}

**Here is some markdown**

```{r}
# And here is an R code chunk
plot(iris$Sepal.Length, iris$Sepal.Width)
```

{{< dstop >}}

Output

Answer Key

Here is some markdown

# And here is an R code chunk
plot(iris$Sepal.Length, iris$Sepal.Width)