Skip to content
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 upload.fun configurable via option #214

Open
wlandau opened this issue Oct 23, 2018 · 7 comments
Open

Make upload.fun configurable via option #214

wlandau opened this issue Oct 23, 2018 · 7 comments
Labels
feature options tidy-dev-day 🤓

Comments

@wlandau
Copy link

@wlandau wlandau commented Oct 23, 2018

As much as I love automatic image embedding in reprex, it does present a challenge for those of us collaborating on confidential projects in a locked-down industry setting. My own company's proxies do not block the uploads, and the URLs are public. We would still like to share rendered reprexes in our internal private repos.

@jennybc
Copy link
Member

@jennybc jennybc commented Oct 23, 2018

This example shows how to override upload.fun, in this case forcing the fig to stay local:

reprex/R/reprex.R

Lines 176 to 188 in de45a37

#' # write reprex to file AND keep figure local too, i.e. don't post to imgur
#' tmp <- file.path(tempdir(), "foofy")
#' reprex({
#' #+ setup, include = FALSE
#' knitr::opts_knit$set(upload.fun = identity)
#'
#' #+ actual-reprex-code
#' #' Some prose
#' ## regular comment
#' (x <- 1:4)
#' median(x)
#' plot(x)
#' }, outfile = tmp)

With that in mind, what are you thinking?

@jennybc
Copy link
Member

@jennybc jennybc commented Oct 23, 2018

If specifying upload.fun in the reprex code is unattractive (which I can imagine), the options would seem to be ... putting this under the control of an option (meh) or allowing a custom reprex template (?). I used to expose the knitr options more, but got no sense that anyone ever used it and removed that.

@wlandau
Copy link
Author

@wlandau wlandau commented Oct 23, 2018

That example definitely helps, and I personally think calling knitr::opts_knit$set(upload.fun = identity) is not too much to ask. But maybe some guidance on the usage of upload.fun and other knitr options would be nice, with cross-references alongside mentions of Imgur.

@jennybc jennybc changed the title Option to suppress imgur uploads? Make upload.fun configurable via option Nov 8, 2018
@jennybc
Copy link
Member

@jennybc jennybc commented Nov 8, 2018

I'm highjacking your issue @wlandau.

Note to self: wrap upload.fun and put the logic about doing different things for different venues inside it. Then make that something that is configurable via option. Default behaviour for general population stays the same but people like @wlandau can re-configure and we could share a recipe that helps people in China and can't use imgur.com (see the ending of the #220 saga).

@wlandau
Copy link
Author

@wlandau wlandau commented Nov 9, 2018

Thanks, @jennybc!

@jennybc
Copy link
Member

@jennybc jennybc commented May 17, 2019

Also related to #259 re: making the options better documented.

@jennybc
Copy link
Member

@jennybc jennybc commented Feb 21, 2020

I should announce here that, now that the big transition to a proper Rmd document format + reprex_render() is done ... there is no remaining technical blocker here. It's a matter of me (or someone else) figuring out how to execute this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature options tidy-dev-day 🤓
Projects
None yet
Development

No branches or pull requests

2 participants