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

Aggressive Prerender checks within rmarkdown #179

Merged
merged 9 commits into from
Oct 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Package: learnr
Type: Package
Title: Interactive Tutorials for R
Version: 0.9.2
Version: 0.9.2.9000
Authors@R: c(
person("Barbara", "Borges", role = c("aut", "cre"), email = "barbara@rstudio.com"),
person("Barret", "Schloerke", role = c("aut", "cre"), email = "barret@rstudio.com"),
person("JJ", "Allaire", role = "aut", email = "jj@rstudio.com"),
person("Barbara", "Borges", role = "aut", email = "barbara@rstudio.com"),
person(family = "RStudio, Inc.", role = "cph"),
person(family = "Ajax.org B.V.", role=c("ctb", "cph"), comment= "Ace library"),
person("Zeno", "Rocha", role = c("ctb", "cph"), comment = "clipboard.js library"),
Expand Down Expand Up @@ -32,7 +33,9 @@ Imports:
knitr (>= 1.14),
markdown,
shiny (>= 1.0),
rmarkdown (>= 1.8)
rmarkdown (>= 1.10.14)
Remotes:
rstudio/rmarkdown
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.0
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
learnr 0.9.3
learnr 0.9.2.9000 (unreleased)
===========

* Fixed a spurious console warning when running exercises using Pandoc 2.0. ([#154](https://github.com/rstudio/learnr/issues/154))

* Aggressively rerender prerendered tutorials in favor of a cohesive exercise environment ([#169](https://github.com/rstudio/learnr/issues/169), [#179](https://github.com/rstudio/learnr/pull/179), and [rstudio/rmarkdown#1420](https://github.com/rstudio/rmarkdown/pull/1420))

* Added a new function, `safe`, which evaluates code in a new, safe R environment. ([#174](https://github.com/rstudio/learnr/pull/174))

learnr 0.9.2
Expand Down
10 changes: 6 additions & 4 deletions R/run.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ run_tutorial <- function(name, package, shiny_args = NULL) {
)
}

# run within tutorial wd and ensure we don't call rmarkdown::render
# run within tutorial wd
withr::with_dir(tutorial_path, {
withr::with_envvar(c(RMARKDOWN_RUN_PRERENDER = "0"), {
rmarkdown::run(file = NULL, dir = tutorial_path, shiny_args = shiny_args)
})
if (!identical(Sys.getenv("SHINY_PORT", ""), "")) {
# is currently running in a server, do not allow for prerender (rmarkdown::render)
withr::local_envvar(c(RMARKDOWN_RUN_PRERENDER = "0"))
}
rmarkdown::run(file = NULL, dir = tutorial_path, shiny_args = shiny_args)
})
}

Expand Down