Code snippets
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 :-)
Hi, I am currently writting a plugin for code snippets. It might takes few times to get it done though
So I am closing this :-) Thx @juanwolf !
Hi guys! Sorry for the question but how can I enable this plugin in my Rocket.Chat installation?
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.
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)?
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.
when will we see it on demo?
@titulus I try snippets on demo right now and it is working great.
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.
+1 for these issues to be resolved. We need to lift the message limit size, and enable folding.
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?