reprex
reprex copied to clipboard
venue = "carbon" (or some equivalent)
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.
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!
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
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.
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.
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.