Skip to content

Commit 0624e59

Browse files
jperasmusQingWei-Li
authored andcommitted
docs: Add new copy-to-clipboard plugin (#265)
1 parent aba2aec commit 0624e59

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

docs/plugins.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ When readers expand the demo box, the source code and description are shown ther
113113

114114
See https://codesponsor.io
115115

116-
117116
```html
118117
<script>
119118
window.$docsify = {
@@ -123,3 +122,21 @@ See https://codesponsor.io
123122
<script src="//unpkg.com/docsify/lib/plugins/codesponsor.min.js"></script>
124123
```
125124

125+
## Copy to Clipboard
126+
127+
Add a simple `Click to copy` button to all preformatted code blocks to effortlessly allow users to copy example code from your docs.
128+
129+
```html
130+
<link rel="stylesheet" href="//unpkg.com/docsify-copy-code/styles.css">
131+
<script src="//unpkg.com/docsify-copy-code/index.js"></script>
132+
```
133+
134+
```javascript
135+
window.$docsify = {
136+
plugins: [
137+
window.DocsifyCopyCodePlugin.init()
138+
]
139+
}
140+
```
141+
142+
See [here](https://github.com/jperasmus/docsify-copy-code/blob/master/README.md) for more details.

0 commit comments

Comments
 (0)