Closed maelle closed 6 years ago
Quick solution would be to run reprex.
The solution is placed on the clipboard by reprex.
Use the clipboard in a obj <- carbon$new()
.
Setting obj$add_tiny <- TRUE
would add a tinyurl to the image.
Simple <- R6::R6Class("Simple",
public = list(
x = 1,
getx = function() self$x
)
)
Simple$set('public','foo',list(NULL))
Simple$public_fields
Rendering reprex...
Rendered reprex is on the clipboard.
obj <- carbonate::carbon$new()
obj$add_tinyurl <- TRUE
obj$tiny()
[1] "http://tinyurl.com/yaz3cg88"
obj$carbonate()
Nice! Only improvement I'd see would be to use venue=r
in reprex.
Do you want me to make a PR to document this "somewhere"?
indeed the venue should be r
good catch.
If you could make a PR that would be great! probably a vignette, seeing that the Readme is already overloaded and needs to be trimmed anyways. (If you want to add it as a new details chunk in the sharing subsection of the Readme that is also great, when I get a chance I can reorganize).
I'm interested to know what the use case you had in mind to combine the two outputs?
Thanks!
Will write a vignette soon then!
The reason for my asking is that I'm preparing a talk including a section about where/how to get help. It'll include a reprex
demo. Now I'm curious how to make reprex
interact with carbonate
to show how one could e.g. tweet a question.
One workflow I had in mind but that's maybe a bit cumbersome to show some code (buggy or not) would involve a reprex, reprex
, gistr
and carbonate
(just as a way to advertise the thing on Twitter/Slack with a nice pic, and with the gist URL as URL).
No well-formed ideas yet though.
sounds cool. you can directly tweet from the carbon object.
it would be cool if the venue for reprex could be gist
and then it would set up for you the gist with the reprexed code and add the gist link to the footer of the reprex output to clipr.
it would be cool if the venue for reprex could be gist
I would find this cool too ! 😉 It still is in my TODO. Should prioritize that maybe... 🤔 Thanks for the cross-referencing @maelle.
Using carbonate
and reprex
together was also on my mind. I try to have a look at what you already have done!
My experiments https://github.com/maelle/reprex_demo
I will contribute a README section to carbonate
(rather than a vignette) once I can take a screenshot cf #15
closing.
The problem I am wondering how to use
carbonate
andreprex
together. I.e. I'd like something similar to choosing a new venue forreprex
, that'd let me obtain a carbonate image and URL of the code I'd copied to clipboard, together with its output.Describe solutions you've considered I think it might only be a documentation need.