Skip to content

Commit

Permalink
Check for Quarto environment before using workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
rich-iannone committed Feb 28, 2024
1 parent 0af8a47 commit f5bcb6f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
8 changes: 4 additions & 4 deletions R/get_agent_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -1967,14 +1967,14 @@ get_agent_report <- function(
# nocov end

# Quarto rendering workaround
agent_report <- gt::fmt(agent_report, fns = identity)
if (check_quarto()) {
agent_report <- gt::fmt(agent_report, fns = identity)
}

agent_report

}

get_default_title_text <- function(report_type,
lang) {
get_default_title_text <- function(report_type, lang) {

if (report_type == "informant") {
title_text <-
Expand Down
5 changes: 3 additions & 2 deletions R/get_informant_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -679,10 +679,11 @@ get_informant_report <- function(
# nocov end

# Quarto rendering workaround
gt_informant_report <- gt::fmt(gt_informant_report, fns = identity)
if (check_quarto()) {
gt_informant_report <- gt::fmt(gt_informant_report, fns = identity)
}

gt_informant_report

}

add_to_tbl <- function(tbl, item, group) {
Expand Down
5 changes: 3 additions & 2 deletions R/get_multiagent_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -916,10 +916,11 @@ get_multiagent_report <- function(
class(report_tbl) <- c("ptblank_multiagent_report.wide", class(report_tbl))

# Quarto rendering workaround
report_tbl <- gt::fmt(report_tbl, fns = identity)
if (check_quarto()) {
report_tbl <- gt::fmt(report_tbl, fns = identity)
}

report_tbl

}

generate_cell_content <- function(
Expand Down
4 changes: 4 additions & 0 deletions R/utils-output.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,8 @@ get_rds_tbl_info_files_tbl <- function(rds_tbl, tbl_name) {
rds_tbl[rds_tbl$tbl_name == tbl_name, "information_files"][[1]][[1]]
}

check_quarto <- function() {
Sys.getenv("QUARTO_BIN_PATH") != ""
}

# nocov end

0 comments on commit f5bcb6f

Please sign in to comment.