-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make an RStudio add in #28
Comments
By "strip any lines that start with Are you saying to do this instead of or in addition to putting the reprexed version on the clipboard? |
I was thinking of replacing the currently selected code instead of putting it on the clipboard, so it wouldn't have the backticks. |
If you have occasion to use reprex, you could re-install and try the draft addin. I am still NOT replacing the reprex source with the output, although I experimented with that and could still do it. I now have the ability to do round trips (code --> rendered reprex --> code), which would come up. Overwriting or augmenting the source with the reprexed result caused me more grief than joy, but I think we must use this thing differently? I like seeing the html preview and having the GitHub-flavored markdown on the clipboard. I think what you want ("strip lines that start with |
Another reason to go with Hadley's suggestion is that It currently gives an error from I think this means that if I exported DISPLAY in my .profile and use |
Thanks @MilesMcBain this is a helpful use case, when it would be nice for the rendered reprex to be inserted into or on top of the current file. As for DISPLAY, yes, that must be configured for clipboard to work (see
Once you get the clipboard working at all, reprex takes care of all this for you, i.e. you would never need to explicitly call clipr. |
From @hadley:
I should either remove this or figure out how to make the message simply disappear after some suitable interval. |
Thx @hadley and @daattali, I think current addin now counts as "existing"! @MilesMcBain The more I think about this, you should never get that error. reprex should detect the lack of clipboard and give you a better message about where to find the output. Are you sure you were using a very recent version? If so, will you open that as a separate issue about RStudio Server? |
http://rstudio.github.io/rstudioaddins/
I think the nicest implementation would replace the currently selected code with the reprexed version. To make it work if called multiple times, you could first strip any lines that start with
#'
(maybe reprex already does this?)The text was updated successfully, but these errors were encountered: