|
1 | 1 | #' Transform code from R, Rmd or Rnw files |
2 | 2 | #' |
3 | | -#' A wrapper for [enc::transform_lines_enc()] which initiates the styling of |
| 3 | +#' A wrapper which initiates the styling of |
4 | 4 | #' either R, Rmd or Rnw files by passing the relevant transformer function for each |
5 | 5 | #' case. |
6 | 6 | #' |
7 | | -#' @inheritParams enc::transform_lines_enc |
8 | | -#' @param ... Further arguments passed to `enc::transform_lines_enc()`. |
| 7 | +#' @inheritParams transform_utf8 |
| 8 | +#' @param ... Further arguments passed to [transform_utf8()]. |
9 | 9 | #' @keywords internal |
10 | | -transform_code <- function(path, fun, verbose = FALSE, ...) { |
| 10 | +transform_code <- function(path, fun, ...) { |
11 | 11 | if (is_plain_r_file(path)) { |
12 | | - enc::transform_lines_enc(path, fun = fun, ..., verbose = verbose) |
| 12 | + transform_utf8(path, fun = fun, ...) |
13 | 13 | } else if (is_rmd_file(path)) { |
14 | | - enc::transform_lines_enc(path, |
15 | | - fun = partial(transform_mixed, transformer_fun = fun, filetype = "Rmd"), ..., |
16 | | - verbose = verbose |
| 14 | + transform_utf8(path, |
| 15 | + fun = partial(transform_mixed, transformer_fun = fun, filetype = "Rmd"), |
| 16 | + ... |
17 | 17 | ) |
18 | 18 | } else if (is_rnw_file(path)) { |
19 | | - enc::transform_lines_enc(path, |
20 | | - fun = partial(transform_mixed, transformer_fun = fun, filetype = "Rnw"), ..., |
21 | | - verbose = verbose |
| 19 | + transform_utf8(path, |
| 20 | + fun = partial(transform_mixed, transformer_fun = fun, filetype = "Rnw"), |
| 21 | + ... |
22 | 22 | ) |
23 | 23 | } else { |
24 | 24 | stop(path, " is not an R, Rmd or Rnw file") |
|
0 commit comments