|
|
|
|
|
|
|
|
base16_palette <- fs::path_file(palette_file) |
|
|
base16_palette <- fs::path_file(palette_file) |
|
|
base16_info <- get_base16_theme_info(palette_file) |
|
|
base16_info <- get_base16_theme_info(palette_file) |
|
|
base16_attribution <- base16_info$attribution |
|
|
base16_attribution <- base16_info$attribution |
|
|
base16_rstudio_style <- base16_info$rstudio_style |
|
|
|
|
|
base16_name <- base16_info$name |
|
|
base16_name <- base16_info$name |
|
|
|
|
|
if (base16_info$isDark) base16_rstudio_style <- base16_info$rstudio_style |
|
|
|
|
|
|
|
|
base16_theme <- whisker::whisker.render( |
|
|
base16_theme <- whisker::whisker.render( |
|
|
readLines(here::here("src/base16/base16_template.scss"), warn = FALSE) |
|
|
readLines(here::here("src/base16/base16_template.scss"), warn = FALSE) |
|
|
|
|
|
|
|
|
base16_meta <- readLines(palette_file, n = 2) |
|
|
base16_meta <- readLines(palette_file, n = 2) |
|
|
info$attribution <- base16_meta[1] |
|
|
info$attribution <- base16_meta[1] |
|
|
info$rstudio_style <- base16_meta[2] |
|
|
info$rstudio_style <- base16_meta[2] |
|
|
|
|
|
info$isDark <- FALSE |
|
|
if (base16_meta[2] == "") { |
|
|
if (base16_meta[2] == "") { |
|
|
|
|
|
info$isDark <- TRUE |
|
|
info$rstudio_style <- "/* rs-theme-is-dark: TRUE */" |
|
|
info$rstudio_style <- "/* rs-theme-is-dark: TRUE */" |
|
|
} |
|
|
} |
|
|
rgx_name <- "/\\*\\s*([[:alpha:][:punct:] ]+) by" |
|
|
rgx_name <- "/\\*\\s*([[:alpha:][:punct:] ]+) by" |