Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RLesur/klippy
Copy to Clipboard Buttons for RMarkdown HTML Documents
https://github.com/RLesur/klippy
clipboard-buttons knitr r rmarkdown
Last synced: 3 months ago
JSON representation
Copy to Clipboard Buttons for RMarkdown HTML Documents
- Host: GitHub
- URL: https://github.com/RLesur/klippy
- Owner: RLesur
- License: mit
- Created: 2017-09-27T20:49:25.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-10-06T13:42:49.000Z (about 2 years ago)
- Last Synced: 2024-06-05T02:32:38.143Z (5 months ago)
- Topics: clipboard-buttons, knitr, r, rmarkdown
- Language: R
- Homepage: https://rlesur.github.io/klippy/
- Size: 1.47 MB
- Stars: 54
- Watchers: 2
- Forks: 11
- Open Issues: 13
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - RLesur/klippy - Copy to Clipboard Buttons for RMarkdown HTML Documents (R)
README
---
output: github_document
---```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```# klippy
Copy to Clipboard Buttons for R Markdown HTML Documents[![Travis build status](https://travis-ci.org/RLesur/klippy.svg?branch=master)](https://travis-ci.org/RLesur/klippy)
## Overview
**klippy** enhances R Markdown HTML documents with **"copy to clipboard" buttons** as shown below:
![](man/figures/klippy.png)
## Installation
`klippy` is not available from CRAN, but you can install the development version from GitHub with:
```{r, eval = FALSE}
# install.packages("remotes")
remotes::install_github("rlesur/klippy")
```## Motivation
As an intensive reader of R Markdown books and documents (thanks to `knitr`), I selected on my screen dozens of R code blocks then press `Ctrl+C`...
This package is a very small, but I hope helpful add-in for R Markdown to improve the reader experience.## Usage
Add the following chunk anywhere in your `Rmd` file:
````markdown
`r ''````{r klippy, echo=FALSE, include=TRUE}
klippy::klippy()
```
````## Browser Support
**klippy** uses [clipboard.js](https://clipboardjs.com/). Tooltips are rendered with [Primer Tooltips](https://primer.style/) CSS.
Glue code is in Vanilla JS.
For supported browsers, see [`clipboard.js` documentation](https://clipboardjs.com/#browser-support).## Bugs/Feature requests
If you have any, [let me know](https://github.com/RLesur/klippy/issues). Thanks!
## Related project
To use `clipboard.js` in Shiny, see **rclipboard** ([CRAN](https://cran.r-project.org/package=rclipboard), [GitHub](https://github.com/sbihorel/rclipboard)).
## Credits
The following libraries are distributed with `klippy`:
**clipboard.js** (version: 1.7.1) (c) Zeno Rocha
MIT license:
Website:
GitHub:**Primer Tooltips** (version: 1.4.0) (c) GitHub, Inc.
MIT license:
Website:The clipboard icon `clippy.svg` is part of:
**GitHub Octicons** (version: 6.0.1) (c) GitHub, Inc.
MIT license:
Website: