There is a simple procedure to put buttons for copying code of gitbooks. What would be the way to do that in a bookdown?
# install npm
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
# install gitbook builder
sudo npm install -g gitbook
sudo npm install -g gitbook-cli
# git clone gitbook "example" repository
git clone ...
cd gitbook/
npm init
# Install plugin to add clipboard button for code
# https://www.npmjs.com/package/gitbook-plugin-copy-code-button
npm install gitbook-plugin-copy-code-button
Create index.md
- in this case, in Rstudio, New file>R Markdown>From Template>github
and make book.json:
{
"structure": {
"readme": "index.md"
},
"plugins": ["copy-code-button"]
}
Finally, gitbook build .
