reprex icon indicating copy to clipboard operation
reprex copied to clipboard

venue = "carbon" (or some equivalent)

Open bwiernik opened this issue 2 years ago • 5 comments

I frequently use the Carbon tool (https://carbon.now.sh/) to create images of R code to share on Twitter. Currently, my workflow is to use reprex::reprex() to create the reprex, paste it to https://carbon.now.sh, copy the image from there, and paste the image and alt-text to Twitter. It would be really nice if I could streamline this to directly create a Carbon image with reprex().

There is an R package interface to Carbon carbonate. I tried to use reprex and carbonate together, but I was unable to get the versions of ChromeDriver and chrome.exe inovked by reprex and RSelenium to play well together.

bwiernik avatar Aug 27 '21 15:08 bwiernik

Hi! @bwiernik! I was actually just thinking the same thing, but more like venue = "image" or venue = "twitter", without the carbon interface. And agreed, it would be fantastic if the image could come pre-loaded with alt text of the code!

Having the styling options of carbonate on top would be such a nice bonus!

For an example, in this tweet I just took a screenshot of the reprex results and copied and pasted code into alt text.

Lovely reprex developers - please share if there are already other ways to achieve this that I am missing! And thank you for all that you do!

shannonpileggi avatar Dec 08 '21 14:12 shannonpileggi

For reference, just to connect the discussion, there was one some time ago about publishing reprex on the web https://github.com/tidyverse/reprex/issues/190

And also a related dicussion with reprex and carbon.now with the R carbonate package: in https://github.com/yonicd/carbonate/issues/14

Some demos of carbonate + reprex where made in https://github.com/maelle/reprex_demo

It is quite old but always interesting to have previous thoughts and ressources available

cderv avatar Dec 08 '21 14:12 cderv

Thank you for flagging the discussion @cderv! As discussed by @maelle, a URL to a gist that has the code/carbonate image stored as metadata to appear when sharing the link, if possible, would also be a cool solution! The idea of putting code in an image felt a bit off to me.

shannonpileggi avatar Dec 08 '21 16:12 shannonpileggi

I'm not working on or thinking about reprex at the moment.

But I've definitely thought about carbon support in the past. It would be really nice, I agree! Unfortunately, the most in-depth discussion I've had around this may have happened in Slack, though, not on GitHub.

One big blocker (or at least turn-off) for me is that, last I checked, the Carbon tool is quite unfriendly for programmatic use. Hence the need for what the carbonate R package is doing. Which is sufficiently 😬 that I've never been eager to pursue this with real vigor.

jennybc avatar Dec 08 '21 20:12 jennybc

This has been here for a while and it's still a neat idea. If anyone knows of changes in the Carbon situation (ie programmatic access has gotten easier) or of a new, similar tool that is friendly for programmatic access, please comment.

jennybc avatar Aug 16 '22 22:08 jennybc