nextra icon indicating copy to clipboard operation
nextra copied to clipboard

Copy to Clipboard action for codeblocks

Open numToStr opened this issue 2 years ago • 3 comments

Problem

Currently, if someone wants to copy the codeblock contents they have to manually select the content and press Ctrl-c. This could be cumbersome to do if the codeblock is large.

Solution

Add a Copy To Clipboard action; something similar to github's.

image

numToStr avatar Jul 14 '22 12:07 numToStr

Good thing to have! We'll need a syntax for that, maybe:

```js copy

It can be used together with other options:

```js copy showLineNumbers

shuding avatar Jul 31 '22 13:07 shuding

Ohh! I didn't thought about it earlier but making it opt-in would be cool. Also I agree with your syntax suggestion

```js copy

numToStr avatar Jul 31 '22 13:07 numToStr

Yeah, and we can have theme config option to turn this option by default to true

dimaMachina avatar Jul 31 '22 15:07 dimaMachina