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

Could reprex set an environment variable while it is rendering #466

Closed
olivroy opened this issue Jul 12, 2024 · 1 comment
Closed

Could reprex set an environment variable while it is rendering #466

olivroy opened this issue Jul 12, 2024 · 1 comment

Comments

@olivroy
Copy link
Contributor

olivroy commented Jul 12, 2024

Like pkgdown does

Sys.getenv("IN_PKGDOWN")

Something like

"IN_REPREX"

So it is easy to know you are in reprex.

I am trying to see how I could tackle #419 inside gt, but I am having a hard time finding out if we are in reprex or not.

The following function doesn't seem to be reliable?

in_reprex <- function() "gfm-yaml_metadata_block" %in% knitr::opts_knit$get("rmarkdown.pandoc.to")
@olivroy
Copy link
Contributor Author

olivroy commented Jul 12, 2024

No need, reprex sets an option dmurdoch/rgl#186

in_reprex <- function() 
  !is.null(getOption("reprex.current_venue"))

@olivroy olivroy closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant