The klippy
package enhances R Markdown
HTML
documents with copy to clipboard
buttons. You only have to paste the following chunk anywhere in
your Rmd
file.
Obviously, you have to try the clipboard button in the upper left corner of this chunk!
The klippy()
function inserts a klippy1 in each R
or markdown
code block.
You can select which of the code blocks get a klippy.
First, insert this chunk anywhere in your Rmd
file:
Then, add the klippy
class to a code chunk:
If you use other languages than R
in your
Rmd
file, you can also add klippies to these code
blocks.
For example, if you want to add klippies to R
and
python
code blocks, add this chunk anywhere in your
Rmd
file:
By default, klippy
is positionned at the upper-left
corner of the code chunks. You can choose another corner with
position
argument:
klippy
color is the same as the links in the document.
However, you can pick another color:
Tooltip messages can also be adapted:
For supported browsers, see clipboard.js
documentation.
A klippy is a knitweaR clipboard button.↩︎