Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Jan 14, 2024
1 parent 0e37e77 commit a338bc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions R/style_tt.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,20 +161,26 @@ style_tt <- function (x, i, j, bold = FALSE, italic = FALSE, monospace = FALSE,
}

if (!is.null(align)) {
align_bootstrap <- ifelse(align == "c", "center", align_bootstrap)
align_bootstrap <- ifelse(align == "c", "center", align)
align_bootstrap <- ifelse(align == "l", "left", align_bootstrap)
align_bootstrap <- ifelse(align == "r", "right", align_bootstrap)
} else {
align_bootstrap <- align
}

if (!is.null(fontsize)) {
fontsize_bootstrap <- sprintf("%spx", (1 + 1 / 3) * fontsize)
} else {
fontsize_bootstrap <- fontsize
}

settings$bootstrap <- ""
settings$bootstrap <- vectorize_bootstrap(settings$bootstrap, bold, "font-weight: bold;")
settings$bootstrap <- vectorize_bootstrap(settings$bootstrap, italic, "font-style: italic;")
settings$bootstrap <- vectorize_bootstrap(settings$bootstrap, underline, "text-decoration: underline;")
settings$bootstrap <- vectorize_bootstrap(settings$bootstrap, strikeout, "text-decoration: line-through;")
settings$bootstrap <- vectorize_bootstrap(settings$bootstrap, monospace, "font-family: monospace;")
settings$bootstrap <- vectorize_bootstrap(settings$bootstrap, fontsize, "font-size: %s;")
settings$bootstrap <- vectorize_bootstrap(settings$bootstrap, fontsize_bootstrap, "font-size: %s;")
settings$bootstrap <- vectorize_bootstrap(settings$bootstrap, align_bootstrap, "text-align: %s;")
settings$bootstrap <- vectorize_bootstrap(settings$bootstrap, color, "color: %s;")
settings$bootstrap <- vectorize_bootstrap(settings$bootstrap, background, "background-color: %s;")
Expand Down
2 changes: 1 addition & 1 deletion vignettes/tutorial.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ colnames(k) <- NULL
bg <- hcl.colors(20, "Inferno")
fs <- 1:20
tt(k, "html", width = .5) |>
tt(k, width = .5) |>
style_tt(
i = 1:4,
j = 1:5,
Expand Down

0 comments on commit a338bc4

Please sign in to comment.