Skip to content

Commit

Permalink
docs: Add new copy-to-clipboard plugin (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
jperasmus authored and QingWei-Li committed Sep 29, 2017
1 parent aba2aec commit 0624e59
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ When readers expand the demo box, the source code and description are shown ther

See https://codesponsor.io


```html
<script>
window.$docsify = {
Expand All @@ -123,3 +122,21 @@ See https://codesponsor.io
<script src="//unpkg.com/docsify/lib/plugins/codesponsor.min.js"></script>
```

## Copy to Clipboard

Add a simple `Click to copy` button to all preformatted code blocks to effortlessly allow users to copy example code from your docs.

```html
<link rel="stylesheet" href="//unpkg.com/docsify-copy-code/styles.css">
<script src="//unpkg.com/docsify-copy-code/index.js"></script>
```

```javascript
window.$docsify = {
plugins: [
window.DocsifyCopyCodePlugin.init()
]
}
```

See [here](https://github.com/jperasmus/docsify-copy-code/blob/master/README.md) for more details.

0 comments on commit 0624e59

Please sign in to comment.