Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Code snippets

Open mjasion opened this issue 10 years ago • 11 comments

Your Rocket.Chat version: 0.40.0

In slack I am able to ad large code fragment as snippet which i can collapse etc. It would be nice to have same feature in rocket :-)

mjasion avatar Sep 21 '16 20:09 mjasion

Hi, I am currently writting a plugin for code snippets. It might takes few times to get it done though

juanwolf avatar Oct 03 '16 12:10 juanwolf

So I am closing this :-) Thx @juanwolf !

mjasion avatar Oct 23 '16 11:10 mjasion

Hi guys! Sorry for the question but how can I enable this plugin in my Rocket.Chat installation?

ivanovaleksey avatar Jan 12 '17 09:01 ivanovaleksey

Hi!

If you are running the latest version of RC, you should be able to enable this feature in the administration panel -> Messages -> "Allow message snipetting", it should be one of the latest option.

Hope it helps.

juanwolf avatar Jan 12 '17 10:01 juanwolf

Thanks @juanwolf, I have found it a few minutes ago. As I understand I should sent snippet text via regular message and then create a snippet from that message (in message menu)?

ivanovaleksey avatar Jan 12 '17 11:01 ivanovaleksey

Yeah exactly, once done, the message will be formatted and will have syntax highlighting auto detected by highlight.js. After that, you should be able to find your snippet into the panel on the right of your channel.

Feel free to enhance this plugin, it is at its early stage and needs (a lot of) improvement.

juanwolf avatar Jan 12 '17 11:01 juanwolf

when will we see it on demo?

titulus avatar Jan 21 '17 09:01 titulus

@titulus I try snippets on demo right now and it is working great.

Rohlik avatar Jan 21 '17 17:01 Rohlik

This plugin doesn't solve 2 main problems with snippets:

  • there is a still present a message limit
  • i cannot fold huge message by default, and cannot fold this at all

So, this plugin is completely useless at this state.

navrocky avatar Apr 06 '17 15:04 navrocky

+1 for these issues to be resolved. We need to lift the message limit size, and enable folding.

reformstudios avatar Apr 26 '17 15:04 reformstudios

I'm running Rocket v58.2 in subdirectory (https://www.example.com/chat/...) and found that the subdirectory is not inserted in snippet's URL.

I expect an URL as follows.

https://www.example.com:3000/chat/snippet/Yg7xpNADfrBb9sSxg/sample-snippet

But in fact, the URL is

https://www.example.com:3000/snippet/Yg7xpNADfrBb9sSxg/sample-snippet

Of course I see a page shows "Unknow Path" when I click it.

What should I do about it?

moriyas1984 avatar Sep 25 '17 00:09 moriyas1984