---
title: "Customizing Details"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Customizing Details}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

```{r setup}
library(details)
```

You can customize the details output:

 1. [Customizing the title](#title)
 2. [Controlling if it is opened or closed](#open)
 3. [Customizing the Tooltip](#tooltip)
 4. [Setting the highlight language](#language)
 5. [Toggling off the language](#raw)

### Default

```{r}
  R.version |>
  details::details()
```

### Title

```{r}
R.version.string |>
  details::details(
    summary = 'R Version'
  )
```

Manipulating the title style

```{r}
R.version.string |>
  details::details(
    summary = '<font color="red"> R Version </font>'
  )
```

### Open

```{r}
R.version.string |>
  details::details(
    summary = 'Open by default',
    open = TRUE
  )
```

#### Tooltip

```{r}
R.version.string |>
  details::details(
    summary = 'Use the current date as the tooltip',
    tooltip = Sys.Date()
  )
```

### Language

```{r}

readLines(
  'https://raw.githubusercontent.com/metrumresearchgroup/covrpage/master/_pkgdown.yml'
  )|>
  details::details(
    summary = 'yaml example',
    lang = 'yml'
    )
```

### Raw

```{r}

details::details(
'<h1 style="color:blue;">This is a Blue Heading</h1><br>
<p style="border: 1px solid powderblue;">There is a border around the text</p>',
summary = 'Raw code example',
lang = 'none'
)

```