Skip to content
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

Feature Request: Copy to clipboard #130

Open
marcobiedermann opened this issue Jun 28, 2016 · 4 comments
Open

Feature Request: Copy to clipboard #130

marcobiedermann opened this issue Jun 28, 2016 · 4 comments

Comments

@marcobiedermann
Copy link
Collaborator

I suggest adding an option to copy the code snippets to your clipboard.
Clipboard.js is a nice JavaScript library which makes it super easy.
If you agree, I will start working on this :)

@joshbuchea
Copy link
Owner

@marcobiedermann apologies for not getting back to you on this sooner man. I haven't had much free time lately and have been neglecting my open source projects a bit. This sounds like a good idea to me 👍 My attempt to make it convenient to select/copy snippets by auto-selecting all text in a code block was a poor choice.

@marcobiedermann
Copy link
Collaborator Author

@joshbuchea Yeah, no worries. I was also very busy the last few weeks. Maybe I can work on this issue this weekend :)

@dakshshah96
Copy link
Contributor

I don't think the "Copy to Clipboard" functionality is possible with the current layout of the static site, which is made on Jekyll. All the content on http://gethead.info is parsed from the README.md file. It is simply not possible to add the copy functionality in a markdown file.

One possible solution would be to divide every code block into individual files and place them in the _includes folder. It would then be possible to add a "Copy to Clipboard" button at the end of each code block insertion in the index.html file. This too, sounds too complicated to be implemented.

Did you have any other solution in mind @marcobiedermann?

cc: @joshbuchea

@joshbuchea
Copy link
Owner

@dakshshah96 copy to clipboard functionality should be possible to layer on with some javascript. I'll see if I can add this in the near future unless anyone else wants to do it and submit a pull request 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants