Hao Zhu | f7994dd | 2017-02-27 16:58:42 -0500 | [diff] [blame] | 1 | #' Add a header row on top of current header |
| 2 | #' |
| 3 | #' @description Tables with multiple rows of header rows are extremely useful |
| 4 | #' to demonstrate grouped data. This function takes the output of a `kable()` |
Hao Zhu | e7c8f70 | 2017-10-10 13:22:59 -0400 | [diff] [blame] | 5 | #' function and adds an header row on top of it. |
Hao Zhu | f7994dd | 2017-02-27 16:58:42 -0500 | [diff] [blame] | 6 | #' |
| 7 | #' @param kable_input Output of `knitr::kable()` with `format` specified |
| 8 | #' @param header A (named) character vector with `colspan` as values. For |
| 9 | #' example, `c(" " = 1, "title" = 2)` can be used to create a new header row |
| 10 | #' for a 3-column table with "title" spanning across column 2 and 3. For |
| 11 | #' convenience, when `colspan` equals to 1, users can drop the ` = 1` part. |
| 12 | #' As a result, `c(" ", "title" = 2)` is the same as `c(" " = 1, "title" = 2)`. |
Hao Zhu | 32f43f7 | 2017-06-20 18:24:54 -0400 | [diff] [blame] | 13 | #' @param bold A T/F value to control whether the text should be bolded. |
| 14 | #' @param italic A T/F value to control whether the text should to be emphasized. |
Hao Zhu | ac7e70f | 2017-08-02 00:18:36 -0400 | [diff] [blame] | 15 | #' @param monospace A T/F value to control whether the text of the selected column |
| 16 | #' need to be monospaced (verbatim) |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 17 | #' @param underline A T/F value to control whether the text of the selected row |
| 18 | #' need to be underlined |
| 19 | #' @param strikeout A T/F value to control whether the text of the selected row |
| 20 | #' need to be stricked out. |
Hao Zhu | 3465b50 | 2018-04-02 22:41:46 -0400 | [diff] [blame] | 21 | #' @param align A character string for cell alignment. For HTML, possible values could |
| 22 | #' be `l`, `c`, `r` plus `left`, `center`, `right`, `justify`, `initial` and `inherit` |
| 23 | #' while for LaTeX, you can only choose from `l`, `c` & `r`. |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 24 | #' @param color A character string/vector for text color. Here please pay |
| 25 | #' attention to the differences in color codes between HTML and LaTeX. |
| 26 | #' @param background A character string/vector for background color. Here please |
| 27 | #' pay attention to the differences in color codes between HTML and LaTeX. Also |
| 28 | #' note that in HTML, background defined in cell_spec won't cover the whole |
| 29 | #' cell. |
| 30 | #' @param font_size A numeric input/vector for font size. For HTML, you can also use |
| 31 | #' options including `xx-small`, `x-small`, `small`, `medium`, `large`, |
| 32 | #' `x-large`, `xx-large`, `smaller`, `larger`, `initial` and `inherit`. |
| 33 | #' @param angle 0-360, degree that the text will rotate. |
Hao Zhu | ac7e70f | 2017-08-02 00:18:36 -0400 | [diff] [blame] | 34 | #' @param escape A T/F value showing whether special characters should be |
| 35 | #' escaped. |
Salzer | 6bc84f8 | 2018-02-11 13:18:01 -0500 | [diff] [blame] | 36 | #' @param line A T/F value to control whether a line will appear underneath the |
| 37 | #' header |
Hao Zhu | f7994dd | 2017-02-27 16:58:42 -0500 | [diff] [blame] | 38 | #' |
Hao Zhu | 78e6122 | 2017-05-24 20:53:35 -0400 | [diff] [blame] | 39 | #' @examples x <- knitr::kable(head(mtcars), "html") |
| 40 | #' # Add a row of header with 3 columns on the top of the table. The column |
| 41 | #' # span for the 2nd and 3rd one are 5 & 6. |
| 42 | #' add_header_above(x, c(" ", "Group 1" = 5, "Group 2" = 6)) |
| 43 | #' |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 44 | #' @export |
Hao Zhu | ac7e70f | 2017-08-02 00:18:36 -0400 | [diff] [blame] | 45 | add_header_above <- function(kable_input, header = NULL, |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 46 | bold = FALSE, italic = FALSE, monospace = FALSE, |
| 47 | underline = FALSE, strikeout = FALSE, |
| 48 | align = "c", color = NULL, background = NULL, |
| 49 | font_size = NULL, angle = NULL, |
Hao Zhu | 3465b50 | 2018-04-02 22:41:46 -0400 | [diff] [blame] | 50 | escape = TRUE, line = TRUE) { |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 51 | kable_format <- attr(kable_input, "format") |
| 52 | if (!kable_format %in% c("html", "latex")) { |
Hao Zhu | 401ebd8 | 2018-01-14 17:10:20 -0500 | [diff] [blame] | 53 | warning("Please specify format in kable. kableExtra can customize either ", |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 54 | "HTML or LaTeX outputs. See https://haozhu233.github.io/kableExtra/ ", |
| 55 | "for details.") |
Hao Zhu | 401ebd8 | 2018-01-14 17:10:20 -0500 | [diff] [blame] | 56 | return(kable_input) |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 57 | } |
| 58 | if (kable_format == "html") { |
Hao Zhu | 3465b50 | 2018-04-02 22:41:46 -0400 | [diff] [blame] | 59 | return(htmlTable_add_header_above(kable_input, header, bold, italic, |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 60 | monospace, underline, strikeout, |
| 61 | align, color, background, |
| 62 | font_size, angle, escape, line)) |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 63 | } |
| 64 | if (kable_format == "latex") { |
Hao Zhu | 3465b50 | 2018-04-02 22:41:46 -0400 | [diff] [blame] | 65 | return(pdfTable_add_header_above(kable_input, header, bold, italic, |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 66 | monospace, underline, strikeout, |
| 67 | align, color, background, |
| 68 | font_size, angle, escape, line)) |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 69 | } |
| 70 | } |
| 71 | |
| 72 | # HTML |
Hao Zhu | 3465b50 | 2018-04-02 22:41:46 -0400 | [diff] [blame] | 73 | htmlTable_add_header_above <- function(kable_input, header, bold, italic, |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 74 | monospace, underline, strikeout, |
| 75 | align, color, background, |
| 76 | font_size, angle, escape, line) { |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 77 | if (is.null(header)) return(kable_input) |
Hao Zhu | 909ea38 | 2017-06-12 15:43:47 -0400 | [diff] [blame] | 78 | kable_attrs <- attributes(kable_input) |
Hao Zhu | 558c72f | 2017-07-24 15:12:00 -0400 | [diff] [blame] | 79 | kable_xml <- read_kable_as_xml(kable_input) |
Hao Zhu | 62cdde5 | 2017-05-20 22:16:03 -0400 | [diff] [blame] | 80 | kable_xml_thead <- xml_tpart(kable_xml, "thead") |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 81 | |
| 82 | header <- standardize_header_input(header) |
| 83 | |
Hao Zhu | ac7e70f | 2017-08-02 00:18:36 -0400 | [diff] [blame] | 84 | if (escape) { |
| 85 | header$header <- escape_html(header$header) |
| 86 | } |
| 87 | |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 88 | header_rows <- xml_children(kable_xml_thead) |
| 89 | bottom_header_row <- header_rows[[length(header_rows)]] |
| 90 | kable_ncol <- length(xml_children(bottom_header_row)) |
| 91 | if (sum(header$colspan) != kable_ncol) { |
| 92 | stop("The new header row you provided has a different total number of ", |
| 93 | "columns with the original kable output.") |
| 94 | } |
| 95 | |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 96 | new_header_row <- htmlTable_new_header_generator( |
| 97 | header, bold, italic, monospace, underline, strikeout, align, line, |
| 98 | color, background, font_size, angle |
| 99 | ) |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 100 | xml_add_child(kable_xml_thead, new_header_row, .where = 0) |
Hao Zhu | f2dfd14 | 2017-07-24 14:43:28 -0400 | [diff] [blame] | 101 | out <- as_kable_xml(kable_xml) |
Hao Zhu | 2345676 | 2018-03-26 12:30:10 -0400 | [diff] [blame] | 102 | if (is.null(kable_attrs$header_above)) { |
| 103 | kable_attrs$header_above <- 1 |
| 104 | } else { |
| 105 | kable_attrs$header_above <- kable_attrs$header_above + 1 |
| 106 | } |
Hao Zhu | 909ea38 | 2017-06-12 15:43:47 -0400 | [diff] [blame] | 107 | attributes(out) <- kable_attrs |
Hao Zhu | f210083 | 2018-01-11 16:20:29 -0500 | [diff] [blame] | 108 | if (!"kableExtra" %in% class(out)) class(out) <- c("kableExtra", class(out)) |
Hao Zhu | 6a07646 | 2017-03-01 12:59:01 -0500 | [diff] [blame] | 109 | return(out) |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | standardize_header_input <- function(header) { |
| 113 | header_names <- names(header) |
| 114 | |
| 115 | if (is.null(header_names)) { |
| 116 | return(data.frame(header = header, colspan = 1, row.names = NULL)) |
| 117 | } |
| 118 | |
| 119 | names(header)[header_names == ""] <- header[header_names == ""] |
| 120 | header[header_names == ""] <- 1 |
| 121 | header_names <- names(header) |
| 122 | header <- as.numeric(header) |
| 123 | names(header) <- header_names |
| 124 | return(data.frame(header = names(header), colspan = header, row.names = NULL)) |
| 125 | } |
| 126 | |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 127 | htmlTable_new_header_generator <- function(header_df, bold, italic, monospace, |
| 128 | underline, strikeout, align, line, |
| 129 | color, background, font_size, |
| 130 | angle) { |
Hao Zhu | 3465b50 | 2018-04-02 22:41:46 -0400 | [diff] [blame] | 131 | if (align %in% c("l", "c", "r")) { |
| 132 | align <- switch(align, r = "right", c = "center", l = "left") |
| 133 | } |
Hao Zhu | 32f43f7 | 2017-06-20 18:24:54 -0400 | [diff] [blame] | 134 | row_style <- paste0( |
Hao Zhu | 3465b50 | 2018-04-02 22:41:46 -0400 | [diff] [blame] | 135 | paste0("text-align: ", align, "; "), |
Hao Zhu | 32f43f7 | 2017-06-20 18:24:54 -0400 | [diff] [blame] | 136 | ifelse(bold, "font-weight: bold; ", ""), |
Hao Zhu | ac7e70f | 2017-08-02 00:18:36 -0400 | [diff] [blame] | 137 | ifelse(italic, "font-style: italic; ", ""), |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 138 | ifelse(monospace, "font-family: monospace; ", ""), |
| 139 | ifelse(underline, "text-decoration: underline; ", ""), |
| 140 | ifelse(strikeout, "text-decoration: line-through; ", "") |
Hao Zhu | 32f43f7 | 2017-06-20 18:24:54 -0400 | [diff] [blame] | 141 | ) |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 142 | if (!is.null(color)) { |
| 143 | row_style <- paste0(row_style, "color: ", html_color(color), ";") |
| 144 | } |
| 145 | if (!is.null(background)) { |
| 146 | row_style <- paste0( |
| 147 | row_style, |
| 148 | "padding-right: 4px; padding-left: 4px; ", |
| 149 | "background-color: ", html_color(background), ";" |
| 150 | ) |
| 151 | } |
| 152 | if (!is.null(font_size)) { |
| 153 | if (is.numeric(font_size)) font_size <- paste0(font_size, "px") |
| 154 | row_style <- paste0(row_style, "font-size: ", font_size, ";") |
| 155 | } |
| 156 | if (!is.null(angle)) { |
| 157 | angle <- paste0("-webkit-transform: rotate(", angle, |
| 158 | "deg); -moz-transform: rotate(", angle, |
| 159 | "deg); -ms-transform: rotate(", angle, |
| 160 | "deg); -o-transform: rotate(", angle, |
| 161 | "deg); transform: rotate(", angle, |
| 162 | "deg); display: inline-block; ") |
| 163 | header_df$header <- ifelse( |
| 164 | trimws(header_df$header) == "", |
| 165 | header_df$header, |
| 166 | paste0('<span style="', angle, '">', header_df$header, '</span>') |
| 167 | ) |
| 168 | } |
| 169 | |
| 170 | line <- ifelse(ez_rep(line, nrow(header_df)), |
| 171 | "border-bottom: 1px solid #ddd; padding-bottom: 5px; ", "") |
| 172 | |
| 173 | header_items <- ifelse( |
| 174 | trimws(header_df$header) == "", |
| 175 | paste0('<th style="border-bottom:hidden" colspan="', header_df$colspan, |
| 176 | '"></th>'), |
| 177 | paste0( |
| 178 | '<th style="border-bottom:hidden; ', |
| 179 | 'padding-bottom:0; padding-left:3px;padding-right:3px;', |
| 180 | row_style, '" colspan="', |
| 181 | header_df$colspan, '"><div style="', line, '">', header_df$header, |
| 182 | '</div></th>') |
| 183 | ) |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 184 | header_text <- paste(c("<tr>", header_items, "</tr>"), collapse = "") |
| 185 | header_xml <- read_xml(header_text, options = c("COMPACT")) |
| 186 | return(header_xml) |
| 187 | } |
| 188 | |
| 189 | # Add an extra header row above the current header in a LaTeX table ------ |
Hao Zhu | 3465b50 | 2018-04-02 22:41:46 -0400 | [diff] [blame] | 190 | pdfTable_add_header_above <- function(kable_input, header, bold, italic, |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 191 | monospace, underline, strikeout, |
| 192 | align, color, background, |
| 193 | font_size, angle, escape, line) { |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 194 | table_info <- magic_mirror(kable_input) |
| 195 | header <- standardize_header_input(header) |
Hao Zhu | 248bbef | 2018-04-02 18:25:14 -0400 | [diff] [blame] | 196 | |
Hao Zhu | ac7e70f | 2017-08-02 00:18:36 -0400 | [diff] [blame] | 197 | if (escape) { |
Hao Zhu | f94a26f | 2018-04-05 17:42:55 -0400 | [diff] [blame] | 198 | header$header <- input_escape(header$header, align) |
Hao Zhu | ac7e70f | 2017-08-02 00:18:36 -0400 | [diff] [blame] | 199 | } |
Hao Zhu | 248bbef | 2018-04-02 18:25:14 -0400 | [diff] [blame] | 200 | |
Hao Zhu | 3465b50 | 2018-04-02 22:41:46 -0400 | [diff] [blame] | 201 | align <- match.arg(align, c("c", "l", "r")) |
Hao Zhu | 248bbef | 2018-04-02 18:25:14 -0400 | [diff] [blame] | 202 | |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 203 | hline_type <- switch(table_info$booktabs + 1, "\\\\hline", "\\\\toprule") |
Hao Zhu | 3465b50 | 2018-04-02 22:41:46 -0400 | [diff] [blame] | 204 | new_header_split <- pdfTable_new_header_generator( |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 205 | header, table_info$booktabs, bold, italic, monospace, underline, strikeout, |
| 206 | align, color, background, font_size, angle) |
| 207 | if (line) { |
Salzer | 6bc84f8 | 2018-02-11 13:18:01 -0500 | [diff] [blame] | 208 | new_header <- paste0(new_header_split[1], "\n", new_header_split[2]) |
| 209 | } else { |
| 210 | new_header <- new_header_split[1] |
| 211 | } |
Hao Zhu | 3fc0e88 | 2018-04-03 16:06:41 -0400 | [diff] [blame] | 212 | out <- str_replace(solve_enc(kable_input), |
Hao Zhu | b2b4199 | 2017-10-03 12:50:03 -0400 | [diff] [blame] | 213 | hline_type, |
| 214 | paste0(hline_type, "\n", new_header)) |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 215 | out <- structure(out, format = "latex", class = "knitr_kable") |
Hao Zhu | 2ce42b9 | 2017-06-15 17:15:33 -0400 | [diff] [blame] | 216 | # new_header_row <- latex_contents_escape(new_header_split[1]) |
| 217 | if (is.null(table_info$new_header_row)) { |
| 218 | table_info$new_header_row <- new_header_split[1] |
| 219 | table_info$header_df <- list(header) |
| 220 | } else { |
| 221 | table_info$new_header_row <- c(table_info$new_header_row, new_header_split[1]) |
| 222 | table_info$header_df[[length(table_info$header_df) + 1]] <- header |
| 223 | } |
Hao Zhu | 32f43f7 | 2017-06-20 18:24:54 -0400 | [diff] [blame] | 224 | attr(out, "kable_meta") <- table_info |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 225 | return(out) |
| 226 | } |
| 227 | |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 228 | ez_rep <- function(x, n) { |
| 229 | if (is.null(x)) return(NULL) |
| 230 | if (length(x) == 1) return(rep(x, n)) |
| 231 | return(x) |
| 232 | } |
| 233 | |
Hao Zhu | 32f43f7 | 2017-06-20 18:24:54 -0400 | [diff] [blame] | 234 | pdfTable_new_header_generator <- function(header_df, booktabs = FALSE, |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 235 | bold, italic, monospace, |
| 236 | underline, strikeout, align, |
| 237 | color, background, font_size, angle) { |
| 238 | n <- nrow(header_df) |
| 239 | bold <- ez_rep(bold, n) |
| 240 | italic <- ez_rep(italic, n) |
| 241 | monospace <- ez_rep(monospace, n) |
| 242 | underline <- ez_rep(underline, n) |
| 243 | strikeout <- ez_rep(strikeout, n) |
| 244 | align <- ez_rep(align, n) |
| 245 | color <- ez_rep(color, n) |
| 246 | background <- ez_rep(background, n) |
| 247 | font_size <- ez_rep(font_size, n) |
| 248 | angle <- ez_rep(angle, n) |
| 249 | if (!booktabs) { |
| 250 | align <- paste0("|", align, "|") |
| 251 | align[1] <- paste0(align[1], "|") |
| 252 | align[nrow(header_df)] <- paste0("|", align[nrow(header_df)]) |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 253 | } |
Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 254 | header <- header_df$header |
| 255 | colspan <- header_df$colspan |
| 256 | |
| 257 | header <- ifelse(bold, paste0('\\\\textbf\\{', header, '\\}'), header) |
| 258 | header <- ifelse(italic, paste0('\\\\em\\{', header, '\\}'), header) |
| 259 | header <- ifelse(monospace, paste0('\\\\ttfamily\\{', header, '\\}'), header) |
| 260 | header <- ifelse(underline, paste0('\\\\underline\\{', header, '\\}'), header) |
| 261 | header <- ifelse(strikeout, paste0('\\\\sout\\{', header, '\\}'), header) |
| 262 | if (!is.null(color)) { |
| 263 | color <- latex_color(color) |
| 264 | header <- paste0("\\\\textcolor", color, "\\{", header, "\\}") |
| 265 | } |
| 266 | if (!is.null(background)) { |
| 267 | background <- latex_color(background) |
| 268 | header <- paste0("\\\\cellcolor", background, "\\{", header, "\\}") |
| 269 | } |
| 270 | if (!is.null(font_size)) { |
| 271 | header <- paste0("\\\\bgroup\\\\fontsize\\{", font_size, "\\}\\{", |
| 272 | as.numeric(font_size) + 2, |
| 273 | "\\}\\\\selectfont ", header, "\\\\egroup\\{\\}") |
| 274 | } |
| 275 | if (!is.null(angle)) { |
| 276 | header <- paste0("\\\\rotatebox\\{", angle, "\\}\\{", header, "\\}") |
| 277 | } |
| 278 | header_items <- paste0( |
| 279 | '\\\\multicolumn\\{', colspan, '\\}\\{', align, '\\}\\{', header, '\\}' |
| 280 | ) |
| 281 | |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 282 | header_text <- paste(paste(header_items, collapse = " & "), "\\\\\\\\") |
Hao Zhu | 2ce42b9 | 2017-06-15 17:15:33 -0400 | [diff] [blame] | 283 | cline <- cline_gen(header_df, booktabs) |
| 284 | return(c(header_text, cline)) |
| 285 | } |
| 286 | |
| 287 | cline_gen <- function(header_df, booktabs) { |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 288 | cline_end <- cumsum(header_df$colspan) |
| 289 | cline_start <- c(0, cline_end) + 1 |
| 290 | cline_start <- cline_start[-length(cline_start)] |
Hao Zhu | c05e181 | 2017-02-25 01:45:35 -0500 | [diff] [blame] | 291 | cline_type <- switch(booktabs + 1, |
| 292 | "\\\\cline{", |
| 293 | "\\\\cmidrule(l{2pt}r{2pt}){") |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 294 | cline <- paste0(cline_type, cline_start, "-", cline_end, "}") |
| 295 | cline <- cline[trimws(header_df$header) != ""] |
| 296 | cline <- paste(cline, collapse = " ") |
Hao Zhu | 2ce42b9 | 2017-06-15 17:15:33 -0400 | [diff] [blame] | 297 | return(cline) |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 298 | } |
Hao Zhu | 2ce42b9 | 2017-06-15 17:15:33 -0400 | [diff] [blame] | 299 | |
| 300 | |