-
Notifications
You must be signed in to change notification settings - Fork 8
/
_common.R
32 lines (28 loc) · 990 Bytes
/
_common.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# use results: "asis" when setting a status for a chapter
status <- function(type) {
status <- switch(type,
complete = "complete, and indicator values can be calculated as described below.",
incomplete = "incomplete and needs further developement before indicator values can be calculated.",
deprecated = "describing an indicator that is deprecated.",
stop("Invalid `type`", call. = FALSE)
)
class <- switch(type,
complete = "note",
incomplete = "warning",
deprecated = "important"
)
color <- switch(type,
complete = "lightgreen",
incomplete = "orange",
deprecated = "salmon"
)
cat(paste0(
"\n",
'::: {.callout-', class, ' style="background: ', color, ';"}', " \n",
"## Status", " \n",
"This indicator documentation is ",
status,
"\n",
":::\n"
))
}