Skip to main content
edited tags
Link
Glorfindel
  • 7k
  • 3
  • 24
  • 50
deleted 5 characters in body
Source Link
M--
  • 581
  • 2
  • 14

About

Highlighting and copying code from questions/answers is not as straightforward as one hopes it'd be. Throughout the years, there were (at least) a couple of userscripts/extensions to address this need. However, they are not maintained and the links are dead.

I have found this gist by kpym to be still functional, however it could've used a facelift.

This userscript (written off of the linked gist) adds a copy button to the top right corner of each code blocks to copy the code from questions and answers.

Dark mode:

Light mode:

Installation

Click to install with a script manager. N.B. I have only tested this with Tampermonkey on Firefox.

Repository

Here is the source code for this userscript; source code repo

About

Highlighting and copying code from questions/answers is not as straightforward as one hopes it'd be. Throughout the years, there were (at least) a couple of userscripts/extensions to address this need. However, they are not maintained and the links are dead.

I have found this gist by kpym to be still functional, however it could've used a facelift.

This userscript (written off of the linked gist) adds a copy button to the top right corner of each code blocks to copy the code from questions and answers.

Dark mode:

Light mode:

Installation

Click to install with a script manager. N.B. I have only tested this with Tampermonkey on Firefox.

Repository

Here is the source code for this userscript; source code repo

About

Highlighting and copying code from questions/answers is not as straightforward as one hopes it'd be. Throughout the years, there were (at least) a couple of userscripts/extensions to address this need. However, they are not maintained and the links are dead.

I have found this gist by kpym to be still functional, however it could've used a facelift.

This userscript (written off of the linked gist) adds a copy button to the top right corner of code blocks to copy the code from questions and answers.

Dark mode:

Light mode:

Installation

Click to install with a script manager. N.B. I have only tested this with Tampermonkey on Firefox.

Repository

Here is the source code for this userscript; source code repo

Source Link
M--
  • 581
  • 2
  • 14

Copy code-blocks from Stack Exchange websites

About

Highlighting and copying code from questions/answers is not as straightforward as one hopes it'd be. Throughout the years, there were (at least) a couple of userscripts/extensions to address this need. However, they are not maintained and the links are dead.

I have found this gist by kpym to be still functional, however it could've used a facelift.

This userscript (written off of the linked gist) adds a copy button to the top right corner of each code blocks to copy the code from questions and answers.

Dark mode:

Light mode:

Installation

Click to install with a script manager. N.B. I have only tested this with Tampermonkey on Firefox.

Repository

Here is the source code for this userscript; source code repo