Skip to content

Commit

Permalink
include is handled directly by knitr for all engine
Browse files Browse the repository at this point in the history
  • Loading branch information
cderv committed Apr 23, 2024
1 parent 8041ace commit 5384c91
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions R/knitr-engine.R
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ eng_python <- function(options) {
# Stash some options.
is_hold <- identical(options$results, "hold")
is_hidden <- identical(options$results, "hide")
is_include <- isTRUE(options$include)
jupyter_compat <- isTRUE(options$jupyter_compat)

# line index from which source should be emitted
Expand Down Expand Up @@ -306,8 +305,8 @@ eng_python <- function(options) {
outputs$push(output)
}

# append captured outputs (respecting 'include' option)
if (!is_hidden && is_include) {
# append captured outputs (respecting 'results = "hide"' option)
if (!is_hidden) {
# append captured output
if (!identical(captured, ""))
outputs_target$push(captured)
Expand Down Expand Up @@ -349,7 +348,7 @@ eng_python <- function(options) {
plt$show()
}

if (!is_hidden && is_include) {
if (!is_hidden) {
for (plot in .engine_context$pending_plots$data())
outputs_target$push(plot)
.engine_context$pending_plots$clear()
Expand Down

0 comments on commit 5384c91

Please sign in to comment.