klippy icon indicating copy to clipboard operation
klippy copied to clipboard

Copy-code button for a code-chunk level

Open jooyoungseo opened this issue 4 years ago • 0 comments

Thanks very much for making such a nice package.

I was wondering if there would be any way to add an option to get the entire code at a code-chunk level, not based on a code result unit.

For example, I need to use a workaround results = "hold" in order to put the "Copy Code" button for a code-chunk level; otherwise, the button is placed for each executed line.

---
output: html_document
---

```{r klippy, echo=FALSE, include=TRUE}
klippy::klippy()
```

## R Chunks

### Original

```{r original}
summary(airquality$Ozone)
mean(airquality$Ozone)
```

### Workaround

```{r workaround, results = "hold"}
summary(airquality$Ozone)
mean(airquality$Ozone)
```

jooyoungseo avatar Jun 12 '20 15:06 jooyoungseo