Skip to content

Commit

Permalink
Convert status box to callout
Browse files Browse the repository at this point in the history
And combine options
  • Loading branch information
hadley committed Oct 5, 2022
1 parent 3ebfbf0 commit e64d700
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
20 changes: 12 additions & 8 deletions _common.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ knitr::opts_chunk$set(
options(
dplyr.print_min = 6,
dplyr.print_max = 6,
stringr.view_n = 10
)

# Activate crayon output
options(
#crayon.enabled = TRUE,
pillar.bold = TRUE,
stringr.view_n = 10,
# Activate crayon output - temporarily disabled for quarto
# crayon.enabled = TRUE,
pillar.bold = TRUE
)

ggplot2::theme_set(ggplot2::theme_gray(12))
Expand All @@ -33,8 +30,15 @@ status <- function(type) {
stop("Invalid `type`", call. = FALSE)
)

class <- switch(type,
polishing = "note",
restructuring = "important",
drafting = "important",
complete = "note"
)

cat(paste0(
"::: status\n",
"::: callout-", class, "\n",
"You are reading the work-in-progress second edition of R for Data Science. ",
"This chapter ", status, ". ",
"You can find the complete first edition at <https://r4ds.had.co.nz>.\n",
Expand Down
12 changes: 0 additions & 12 deletions r4ds.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ img.quarto-cover-image {
box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
}

/* status box styling */

.status {
border: 2px solid #637238;
padding: 1em;
margin-bottom: 1em;
}

.status p {
margin-bottom: 0;
}

/* Headings ------------------------------------------------------ */

h2 {
Expand Down

0 comments on commit e64d700

Please sign in to comment.