Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
… We are programmed to receive. You can check out any time you like, But you can never leave. …
That’s what it feels like sometimes when trying to share code snippets on Slack. Sure, it’s easy to drop some code on there; but getting it out?
Caveat Coder
That inviting little question, “Create a Snippet?”… You know the one that automagically appears when you go to paste in a code chunk into the chatbox?
It’s a trap. You’ll be 3 steps into waiting for your browser to view the code before you get that snippet back out.
Options
I think it’s easier to wrap your code in block-code markdown using a pair of triple-backticks “`, like so :
``` fantastic_function(sth) ```
There’s still sometimes problems with selecting the code back out of a markdown block (no matter how you stab at it with your steely … touchpad), in that those trailing backticks can sometimes find their way into your code. But it’s still faster than the snippet functionality (at present) and more prettified than just dropping the code chunk in as raw text.
Get In Line Here
Slack’s a great productivity tool, which I use all day, everyday at work; and I’ve already sent them a comment regarding this. Their customer service was super prompt, assuring me they’ll thinking about this.
I’m taking this nod towards code snippets as the start of good things. But I’m still exploring other options than current functionality for sharing code. If you have any ideas, send ’em my way at @data_steve
Slack sends Code Snippets to Hotel California was originally published by Steve Simpson at data_steve on October 13, 2015.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.