Skip to content

Conversation

@cwickham
Copy link
Contributor

@cwickham cwickham commented Apr 17, 2025

Adds the quiet parameter to quarto_preview().

Perhaps we should consider applying it to the message from quarto_preview() in addition to passing it on to quarto preview. I.e. when quiet = TRUE one might not expect to see the message here:

> quarto_preview("tests/testthat/test.qmd", quiet = TRUE)
Stop the preview with quarto_preview_stop()

@cwickham cwickham marked this pull request as draft April 17, 2025 19:17
@cwickham cwickham marked this pull request as ready for review April 18, 2025 18:32
@cderv
Copy link
Collaborator

cderv commented May 6, 2025

Sorry for the delay on this.

I think we need to check the function still works correctly as some of it rely on reading output

quarto-r/R/daemon.R

Lines 103 to 129 in 7a1e2ce

# monitor the process for abnormal exit
poll_process <- function() {
if (is.null(quarto[[ps_key]])) {
return()
}
ro <- quarto[[ps_key]]$read_output()
cat(ro)
# Look at url to browse too in `quarto preview log`
if (
!isFALSE(browse) &&
is.null(quarto[[url_key]]) &&
grepl("Browse at https?://", ro)
) {
m <- regexec("Browse at (https?://[^ ]+)\n", ro)
quarto[[url_key]] <- regmatches(ro, m)[[1]][2]
}
if (!quarto[[ps_key]]$is_alive()) {
status <- quarto[[ps_key]]$get_exit_status()
quarto[[ps_key]] <- NULL
if (status != 0) {
stop("Error running quarto ", command)
}
return()
}
later::later(delay = 0.3, poll_process)
}
poll_process()

and I am not sure their will be any output to read from with --quiet 🤔

I'll check that and then merge.

Perhaps we should consider applying it to the message from quarto_preview() in addition to passing it on to quarto preview. I.e. when quiet = TRUE one might not expect to see the message here

Yes

@cderv cderv merged commit d643d27 into quarto-dev:main May 6, 2025
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

Successfully merging this pull request may close these issues.

2 participants