Skip to content

Commit

Permalink
Merge branch 'master' into text_answer
Browse files Browse the repository at this point in the history
* master:
  Aggressive Prerender checks within rmarkdown (rstudio#179)
  • Loading branch information
schloerke committed Oct 8, 2018
2 parents 3a120c4 + 209cd53 commit 2463f1d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
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

0 comments on commit 2463f1d

Please sign in to comment.