zulip-terminal icon indicating copy to clipboard operation
zulip-terminal copied to clipboard

Add support for copying code snippets

Open neiljp opened this issue 4 years ago • 29 comments

Often it's useful to extract code - or maybe any quoted text? - from a message.

The likely initial way to implement this would be to ultimately add an extra (optional) section to the message information popup. However, as with in-message links or topic links, this feature requires solid implementation of extraction of code blocks first into a format the popup can show.

Things to consider:

  • each code section may have a language (eg. bash, python), which it would be good to indicate in an entry
  • we don't want to list the full section in the message information popup, just enough to be unique
  • in the short term, activating the entry for the code could copy it
  • in the longer term we may want to extend the copy feature to other links too, and activation could instead trigger a feature like #985

NOTE: I've marked this as a good first issue, but this may require a deeper dive into multiple areas!

neiljp avatar Aug 20 '21 00:08 neiljp

@zulipbot claim

kingjuno avatar Aug 26 '21 12:08 kingjuno

Hello @kingjuno, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days.

You can reclaim this issue or claim any other issue by commenting @zulipbot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

zulipbot avatar Sep 05 '21 14:09 zulipbot

@zulipbot claim

avats-dev avatar Sep 13 '21 07:09 avats-dev

Welcome to Zulip, @avats-dev! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip-terminal/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

zulipbot avatar Sep 13 '21 07:09 zulipbot

@avats-dev I am currently working on this issue and is somewhat half-implemented except for the test. I request you to take a different issue. I apologize that I forgot to claim this after 2 weeks.

kingjuno avatar Sep 13 '21 07:09 kingjuno

@kingjuno yeah sure. Sorry, I thought it was unaddressed. @zulipbot abandon

avats-dev avatar Sep 13 '21 08:09 avats-dev

ERROR: You have not claimed this issue to work on yet.

zulipbot avatar Sep 13 '21 08:09 zulipbot

@zulipbot abandon

avats-dev avatar Sep 13 '21 11:09 avats-dev

@zulipbot claim

kingjuno avatar Sep 14 '21 04:09 kingjuno

Hello @kingjuno, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days.

You can reclaim this issue or claim any other issue by commenting @zulipbot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

zulipbot avatar Sep 24 '21 09:09 zulipbot

@zulipbot claim

kingjuno avatar Sep 29 '21 09:09 kingjuno

Hello @kingjuno, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days.

You can reclaim this issue or claim any other issue by commenting @zulipbot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

zulipbot avatar Oct 09 '21 09:10 zulipbot

Hello Mr @kingjuno are you still working on this issue?

If not, I'm fairly interested in completing this issue if that's fine with you :)

CypherpunkSamurai avatar Dec 07 '21 04:12 CypherpunkSamurai

@neiljp I'd like to work on this. Looks interesting.

Important link that maybe should be added to the issue text: https://zulip.com/help/code-blocks

Organization administrators can also configure a default language for code blocks, which will be used whenever the code block has no tag.

The stated language is going to be organization-default language, unless specified otherwise, I'm guessing.

The entire code snippet doesn't need to be in the pop-up, I suppose? We could cut it off at X lines of code.

The playground feature looks pretty neat -- could work on it over the summer, since that looks like a pretty substantial PR.

Screenshot 2022-04-21 at 11 38 34 PM

plugyawn avatar Apr 21 '22 18:04 plugyawn

@zulipbot claim

yuktasarode avatar Mar 13 '23 00:03 yuktasarode

Hello @yuktasarode!

Thanks for your interest in Zulip! You have attempted to claim an issue without the label "help wanted". You can only claim and submit pull requests for issues with the help wanted label.

If this is your first time here, we recommend reading our guide for new contributors before getting started.

zulipbot avatar Mar 13 '23 00:03 zulipbot

Please see the existing PR for this at #1134 if you intend to work on this, with the notes I left there.

There is likely more we can add upon that, but a revised version of that PR that is mergeable would be a good building block.

For example, in a later PR we can show the language, which may require the organization-default settings to be used, and we could also provide a way of showing the code-playground for the language, if there is one.

neiljp avatar Mar 16 '23 18:03 neiljp

@zulipbot claim

yuktasarode avatar Mar 16 '23 19:03 yuktasarode

Welcome to Zulip, @yuktasarode! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip-terminal/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

zulipbot avatar Mar 16 '23 19:03 zulipbot

@yuktasarode You have been unassigned from this issue because you have not made any updates for over 14 days. Please feel free to reclaim the issue if you decide to pick up again. Thanks!

zulipbot avatar Mar 26 '23 20:03 zulipbot

@zulipbot claim

yuktasarode avatar Mar 31 '23 08:03 yuktasarode

@yuktasarode You have been unassigned from this issue because you have not made any updates for over 14 days. Please feel free to reclaim the issue if you decide to pick up again. Thanks!

zulipbot avatar Apr 28 '23 03:04 zulipbot

@zulipbot claim

rsashank avatar Dec 25 '23 21:12 rsashank

@rsashank You have been unassigned from this issue because you have not made any updates for over 14 days. Please feel free to reclaim the issue if you decide to pick up again. Thanks!

zulipbot avatar Jan 12 '24 03:01 zulipbot

@zulipbot claim

4rjunc avatar Feb 03 '24 06:02 4rjunc

Welcome to Zulip, @H4K3R13! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip-terminal/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

zulipbot avatar Feb 03 '24 06:02 zulipbot

Hello @H4K3R13, I have an open PR for this already, I'd suggest looking into other issues.

rsashank avatar Feb 03 '24 10:02 rsashank

Yep. I noticed that I was looking through your code . Good work 👍.

4rjunc avatar Feb 03 '24 10:02 4rjunc

@zulipbot abandon

4rjunc avatar Feb 03 '24 10:02 4rjunc