feat: implement copy button for code snippets#6530
Conversation
|
Hi @Apolo151, thanks for the PR. |
820ba8d to
2853918
Compare
|
Hi @rahulshendre, I have added the sign-off, sorry for the inconvenience. |
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
@rahulshendre @Ayushmore1214 everything else looks good? |
rahulshendre
left a comment
There was a problem hiding this comment.
LGTM overall @eeshaanSA.
One note: on some code blocks the copy button slightly overlaps the first line of code. It’s still readable, but might be worth a small space tweak for clarity.
What do you think?
Ayushmore1214
left a comment
There was a problem hiding this comment.
Looks good to go but the issue raised by @rahulshendre need to be fixed!
|
Hi @rahulshendre @Ayushmore1214, I have updated the style to push the copy button to the top a little to handle the overlap.
|
2fef4a6 to
e91ad02
Compare
rahulshendre
left a comment
There was a problem hiding this comment.
LGTM, thanks @Apolo151
@eeshaanSA, before merging
One small nit: there seems to be a bit of extra space between the code and the copy button. Should we tighten that? Thoughts?
|
@rahulshendre, thanks a lot. I think it is good to do. Since we have no way of seeing this in production, let us see where this is going. We can always rollback if it is bad, or improvise with more changes later. Thanks gentlemen. |
We should start to work upon this, i'll follow up on the discussions we've already had and add this to the agenda for the next community meeting |
|
Hi @eeshaanSA, I've approved this PR. |
|
@eeshaanSA, I think we are good to go with this |
Signed-off-by: Apolo151 <[email protected]>
Signed-off-by: Apolo151 <[email protected]>
0a8492b to
61a9aa5
Compare

What this PR does:
Adds a copy button to all code snippets in the docs.
Before

After

Why we need it:
Better UX for users and contributors.
Which issue(s) this PR fixes:
Fixes #6526
Does this PR introduce a user-facing change?:
Yes
How are users affected by this change Better UX, Users can copy any code snippet by simply clicking the button instead of having to select the text.
Is this breaking change: No, users can still select the code snippet as usual.
How to migrate (if breaking change): NA