joplin icon indicating copy to clipboard operation
joplin copied to clipboard

Add a "Copy code" button on code blocks

Open laurent22 opened this issue 5 years ago • 38 comments

When a code block is displayed, add a "Copy" button in the top-right hand corner. Clicking on it should copy the code to the clipboard. That button should only be displayed when the user moves the mouse over the code block.

Note that this feature should be added to the joplin-renderer

Platforms

  • Desktop
  • Mobile

image

laurent22 avatar Jan 27 '20 16:01 laurent22

Please i will love to try to implement this, can this issue be assigned to me?, and if theres anyone more familier with the codebase, i will love to work together

Runo-saduwa avatar Jan 28 '20 00:01 Runo-saduwa

@Runo-saduwa, I'm currently working on my own assignment here involving changes in the user interface and whatnot. I spent all night digging through a large chunk of the rendering and electron code and am getting fairly familiar with it, especially after the devs here started separating some of the dialog code. One very cool thing about the code here: most of the functions and class names are sensible and describe exactly what their overall function is for the most part, and those that don't make a whole lot of sense outright, it's pretty easy to figure out what they do by searching for where they're used in the code.

bedwardly-down avatar Jan 28 '20 04:01 bedwardly-down

@Runo-saduwa, at this point we only assign up to one issue per person.

laurent22 avatar Jan 28 '20 14:01 laurent22

alright, thank you

Runo-saduwa avatar Jan 28 '20 15:01 Runo-saduwa

@laurent22 that is very reasonable. Thank you

bedwardly-down avatar Jan 28 '20 16:01 bedwardly-down

@laurent22 , i'm trying to give this a shot, so if i understand you correctly, this is going to be implemented in this repo joplin-renderer

Runo-saduwa avatar Jan 29 '20 23:01 Runo-saduwa

Yes indeed. Hmm now that the renderer is in a different repo it's not very easy to with with actually.

I'll see if I can think of something to make it easier, maybe by moving it back to this repo.

laurent22 avatar Jan 30 '20 22:01 laurent22

Well, ive pulled the latest changes, i've been staring at the code for an hour now and i dont know where to start from, Lol............... can you kindly guide me through where to start from

Runo-saduwa avatar Jan 31 '20 22:01 Runo-saduwa

@Runo-saduwa it looks like NoteRevisonViewer.jsx and NoteText.jsx under ElectronClient/app/gui would be a good place to start. A lot of the editor rendering code is there. Then follow it where it takes you. The way each part of the app is linked is very sensible and logical.

bedwardly-down avatar Feb 01 '20 13:02 bedwardly-down

Is this issue fixed for mobile yet,if not can I work upon this ?

rheo-chiti avatar Feb 09 '20 20:02 rheo-chiti

Sorry there’s already a pull request for this and it’s not a single platform issue.

On Sun, Feb 9, 2020 at 9:42 PM Chitransh Anand [email protected] wrote:

Is this issue fixed for mobile yet,if not can I work upon this ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/laurent22/joplin/issues/2383?email_source=notifications&email_token=AIR5ZV3L2SRZ3CVTMWVGA53RCBTE3A5CNFSM4KMERES2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELGXPTY#issuecomment-583890895, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIR5ZV2LZ4EMDPOYVSQNHKLRCBTE3ANCNFSM4KMERESQ .

Runo-saduwa avatar Feb 09 '20 21:02 Runo-saduwa

Is this issue still open? If yes, then can I work on it?

HirenMadhu avatar Feb 24 '20 02:02 HirenMadhu

Anyone working on this?

raghavg27 avatar Mar 10 '20 14:03 raghavg27

If there's no PR open, say you'll work on it and create a PR when ready.

We had so many people who said they'll work on something, but then nothing happened. So, if you take an issue, please keep us apprised of the status.

tessus avatar Mar 12 '20 02:03 tessus

If there's no PR open, say you'll work on it and create a PR when ready.

We had so many people who said they'll work on something, but then nothing happened. So, if you take an issue, please keep us apprised of the status.

hey @tessus I would like to do this issue with the help of clipboardJS library, I will submit you the PR ~~today~~ this week

Rishabh-malhotraa avatar Mar 12 '20 03:03 Rishabh-malhotraa

I would like to work on this, please.

flozender avatar Mar 21 '20 17:03 flozender

I would like to work on this, please.

Yes, @flozender go ahead.

Rishabh-malhotraa avatar Mar 22 '20 01:03 Rishabh-malhotraa

@laurent22 I have a question about the way to solve this, can we just not add the button HTML syntax here rather than writing the markdown plugin for it

copy code

Rishabh-malhotraa avatar Apr 05 '20 19:04 Rishabh-malhotraa

I'm working on it 👍

kowalskidev avatar Apr 10 '20 20:04 kowalskidev

I'm working on it 👍

please don't I'm done with this PR

Rishabh-malhotraa avatar Apr 11 '20 13:04 Rishabh-malhotraa

Was this feature implemented in Pull Request 3024 ?

wjrivera avatar Jul 04 '20 13:07 wjrivera

No.

tessus avatar Jul 04 '20 18:07 tessus

Is anyone assigned to this atm?

wjrivera avatar Sep 21 '20 14:09 wjrivera

No, there were PRs at one point, but they were not merged. More info in #2426 and #3024

tessus avatar Sep 21 '20 16:09 tessus

when will this be released ?

Ash0311 avatar Feb 09 '21 18:02 Ash0311

It won't, unless somebody picks up the PR a finishes it.

tessus avatar Feb 09 '21 18:02 tessus

Hey @tessus I am looking at the PRs made for this issue #2426 seems quite complete - except for the updates it needs on mobile. And #3024 seems to be a incomplete one and possibly stale for a long time.

What is the exact part of the feature that is yet to be done here? Is it that we need to make sure this works on mobile devices?

ArenaGrenade avatar Mar 13 '21 07:03 ArenaGrenade

This was incorrectly labelled as a "good first issue" but it's actually difficult to add this properly. And last year pull requests cannot be used a starting point as they weren't following the right approach.

laurent22 avatar Mar 13 '21 10:03 laurent22

Ah! Sure.

ArenaGrenade avatar Mar 13 '21 10:03 ArenaGrenade

Please add this soon as this is needed !

Ash0311 avatar Jun 12 '21 03:06 Ash0311