-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add "copy" button to code in tutorials #213
Comments
Relevant: vuejs/vuepress#703 |
As stated in #703, had a need so I packaged it up as a plugin. Fully functional and I am fine offering this to you all as a core plugin. https://github.com/dovy/plugin-clipboard-copy Should work out of the box for anyone. |
Nice @dovy thanks! I'll take a look at this. |
@dovy do you plan to make this npm installable? |
Ha, sure. I was planning to see if VuePress wanted to merge this into their core. I'll take a look at getting it installable via npm. |
This is so great! Thanks @dovy! |
Let me know if you hit any problems. Works pretty solid for me. |
Someone correct me if I'm wrong, but I believe plugins aren't supported until vuepress 1.x, so this issue needs #770 to be resolved before I can use it. For the record, I did include: plugins: [['@dovyp/plugin-clipboard-copy', true]], in "@dovyp/plugin-clipboard-copy": "^1.0.0-alpha.3", in |
I’m using vuepress 1x and I couldn’t get it to work properly either. It’s so odd. It works if it’s in the root directory of my repo and I exclude the @dovyp/ bit from the config. |
@cicdw i can take a look into this! |
@cicdw @itsngansense you can take a look here to see it fully working. https://docs.redux.io/ Files of note: |
Ha, I am still trying to figure out how to make the sidebars be dynamic with the same style you have. I'd love the collapsable sections as your config has. ;) |
Thank you! Check our |
Fixed the issues with the install. package.json
config.js
Apparently, the name mattered. ;) |
… to add a copy button to code blocks.
Hovering over a code block should bring up a "copy" button to easily execute code snippets.
Wouldn't shock me if this ends up in VuePress proper, but maybe we can quickly throw something together. Not pressing.
The text was updated successfully, but these errors were encountered: