有一个简单的过程来放置用于复制gitbook代码的按钮。在书本中该怎么做?
# 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
创建index.md
并创建book.json
:
{
"structure": {
"readme": "index.md"
},
"plugins": ["copy-code-button"]
}
最后,gitbook build .
答案 0 :(得分:1)
We just added the Copy
button。您可以通过
remotes::install_github('rstudio/bookdown')
要回答您的原始问题: bookdown 当前无法使用gitbook插件。