docs: Add new copy-to-clipboard plugin (#265)
This commit is contained in:
parent
aba2aec0d0
commit
0624e592d8
1 changed files with 18 additions and 1 deletions
|
|
@ -113,7 +113,6 @@ When readers expand the demo box, the source code and description are shown ther
|
||||||
|
|
||||||
See https://codesponsor.io
|
See https://codesponsor.io
|
||||||
|
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script>
|
<script>
|
||||||
window.$docsify = {
|
window.$docsify = {
|
||||||
|
|
@ -123,3 +122,21 @@ See https://codesponsor.io
|
||||||
<script src="//unpkg.com/docsify/lib/plugins/codesponsor.min.js"></script>
|
<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.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue