# Simpler way to copy code on this forum

**URL:** <https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652>\
**Category:** Site Feedback\
**Created:** [October 13, 2019, 11:06am UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652 "2019-10-13T11:06:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [October 13, 2019, 11:06am UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/1 "2019-10-13T11:06:36Z")

</div>

Hi any chance we could get a button that simply says copy code at the bottom of a code snippet, rather than having to click and drag, I know some of you might not find it a big deal, but it can be a hassle pulling long pieces of code using this method. Anyway just a suggestion.

---

<div class="post-metadata">

**Author:** ![Tiemen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tiemen/32/5477_2.png) [@Tiemen](https://discourse.processing.org/u/Tiemen)\
**Post date:** [October 13, 2019, 10:36pm UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/2 "2019-10-13T22:36:00Z")

</div>

This would be great, saves some time and possible copy errors. I noticed the old forum had it; is there by chance a specific reason it wasn’t implemented in the current one?

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [October 14, 2019, 3:12am UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/3 "2019-10-14T03:12:11Z")

</div>

Any update on this would be appreciated, its clear Im not the only one who could benefit from this.

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [October 14, 2019, 3:43am UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/4 "2019-10-14T03:43:29Z")

</div>

> [@paulgoux](#):
>
> update on this would be appreciated

a real update could only come from the admin of this forum

> [@paulgoux](#):
>
> it can be a hassle pulling long pieces of code

yes, you are not the first who noted that.

> [@Tiemen](#):
>
> a specific reason it wasn’t implemented

yes, as it is not ready from the discourse side,  
[https://www.google.com/search?&q=discourse+copy+code+button](https://www.google.com/search?&q=discourse+copy+code+button)

looks like there are only hacks, what still not work on all browsers  
and also might have more problems like memory leaks…

also i got the impression some so called “co founders” there at “discourse”  
are not that willing…?

all that might be good reasons to sit it out?  
but “we” also would take the risk to experiment?

* * *

also the first step was addressed many times,  
how to get the beginner to put the code into the `</> Preformatted text` button  
by better icon, better tool-tip text , or just a starting template what has  
info section and a code section

```

type or paste code here

```  
already

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [October 14, 2019, 4:05am UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/5 "2019-10-14T04:05:20Z")

</div>

Thanks, I meant update as in, a comment on the issue.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [October 19, 2019, 2:43pm UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/6 "2019-10-19T14:43:05Z")

</div>

I believe that @fjenett and @REAS are the only ones able to install plugins on this site. They would need to comment.

> [@Copy code shortcut](https://discourse.processing.org/t/copy-code-shortcut/660/3):
>
> It looks like this feature is available as a theme component, here: I don’t have the ability to install components into the website, but from a quick glance it looks fairly straightforward – if it doesn’t add too much maintenance overhead fro admins @ProcessingOrg

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 19, 2019, 5:37pm UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/7 "2019-10-19T17:37:22Z")

</div>

Really annoying is copying code on a tablet. For that reason I already started to provide a link to a file on my drive below the posted code. At least until this will be solved.

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [October 20, 2019, 1:49am UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/8 "2019-10-20T01:49:21Z")

</div>

```auto
what is the tablet problem?

```

from a very old tablet phone?  
copy paste? possibly,  
but the `  
are missing on my phone keyboard, so can not type them manually.  
GRRR

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 20, 2019, 9:01am UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/9 "2019-10-20T09:01:27Z")

</div>

Another thing is; when I copy the code (on my tablet) from the forum into my app, I can’t paste it directly. I first have to paste it into for instance a “github edit box”, or what I mostly do, into an text editing app like “QuickEdit”, than copy it again into my app. Otherwise, if I paste it directly, it will be pasted as a single line, with all the format problems. Pasting into an intermediate edit box will somehow “clean” the text. Also the " character I have to delete and re-type, because it somehow gives an error.

---

<div class="post-metadata">

**Author:** ![Tiemen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tiemen/32/5477_2.png) [@Tiemen](https://discourse.processing.org/u/Tiemen)\
**Post date:** [October 20, 2019, 9:05am UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/10 "2019-10-20T09:05:09Z")

</div>

Does it also happen when you copy/paste code from another website into your app, or is it only code from this forum?

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 20, 2019, 9:06am UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/11 "2019-10-20T09:06:50Z")

</div>

Some will others not. I do not know the format used on the web sites.

---

<div class="post-metadata">

**Author:** ![Tiemen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tiemen/32/5477_2.png) [@Tiemen](https://discourse.processing.org/u/Tiemen)\
**Post date:** [October 20, 2019, 9:24am UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/12 "2019-10-20T09:24:27Z")

</div>

Have you tried to (if it’s possible with your tablet) copy with `control shift c` and paste with `control shift v`? Believe that’s a way to maintain meta information while copying, although I’m not sure it works for various OS and devices.

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 20, 2019, 2:35pm UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/13 "2019-10-20T14:35:01Z")

</div>

Yes my tablet keyboard has that option and that’s the way I do it.

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [December 8, 2019, 11:31am UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/14 "2019-12-08T11:31:12Z")

</div>

For those also struggling with copying on phone or tablet; I found a fantastic app on Google’s Play store called “Cópia Universal”. I checked it, and it is safe.  
You just scroll down the notification screen, choose the activation bar, then long tap the code box and a new screen appears with solely the code with a button to copy. I can directly paste it into the APDE and the text appears formatted, instead of everything on one line.

---

<div class="post-metadata">

**Author:** ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)\
**Post date:** [May 1, 2020, 3:12pm UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/15 "2020-05-01T15:12:58Z")

</div>

Just to add another voice saying this is really annoying. A copy button would be good, or ‘open in separate window’.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 1, 2020, 4:14pm UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/16 "2020-05-01T16:14:18Z")

</div>

Hi @RichardDL – you are in luck!

It looks like Discourse published a full copy-code-block button feature just 9 days ago.

> **[Copy codeblock contents to clipboard](https://meta.discourse.org/t/copy-codeblock-contents-to-clipboard/148855)**
>
> 📣 Now live in core Discourse is the ability to show a copy button for codeblocks! import { createWidget } from 'discourse/widgets/widget'; createWidget('my-widget', { tagName: 'div.hello', html() { return "hello world"; } }); This...

It is now enabled, and live on this forum for all code blocks (past, present, and future).

```auto
// this is a standard code block, it can be copied.
println("copy with the copy code block button");

```

---

<div class="post-metadata">

**Author:** ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)\
**Post date:** [May 1, 2020, 4:18pm UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/17 "2020-05-01T16:18:32Z")

</div>

Test, working, thanks. 🙂

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [May 1, 2020, 4:48pm UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/18 "2020-05-01T16:48:11Z")

</div>

Perfect. It works on my PC and my phone. But it is a pity that it doesn’t work on my tablet (Kitkat 4.4 Chrome actualized). And there I need it most. 😞

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [May 1, 2020, 10:10pm UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/19 "2020-05-01T22:10:55Z")

</div>

Now this I like!!!

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 2, 2020, 1:26pm UTC](https://discourse.processing.org/t/simpler-way-to-copy-code-on-this-forum/14652/20 "2020-05-02T13:26:01Z")

</div>

> [@noel](#):
>
> a pity that it doesn’t work on my tablet (Kitkat 4.4 Chrome actualized). And there I need it most.

Hi Noel – consider reporting that on the main Discourse forum I linked where it was developed – maybe they can fix it?
