Skip to content

docs: Add new copy-to-clipboard plugin #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
docs: Add new copy-to-clipboard plugin
  • Loading branch information
jperasmus committed Sep 28, 2017
commit cce6e3ef0d021022b77c8acbf3654ffbe19f2e65
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.