Skip to content

Commit

Permalink
add missing themes to code highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHWade committed Aug 31, 2024
1 parent dee7541 commit 602c9f5
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions R/app_chat_style.R
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ get_highlightjs_theme <- function() {
clean_theme_name <- tolower(gsub(" \\{rsthemes\\}$", "", rstudio_theme))

theme_mapping <- list(
# Original mappings
"a11y-dark" = "a11y-dark",
"a11y-light" = "a11y-light",
"base16 3024" = "base16/3024",
Expand Down Expand Up @@ -339,13 +340,25 @@ get_highlightjs_theme <- function() {
"solarized dark" = "solarized-dark",
"solarized light" = "solarized-light",
"yule rstudio (reduced motion)" = "github",
"yule rstudio" = "github"
"yule rstudio" = "github",
"textmate" = "github",
"cobalt" = "cobalt",
"eclipse" = "eclipse",
"vibrant ink" = "vibrant-ink",
"clouds" = "clouds",
"clouds midnight" = "tomorrow-night-blue",
"merbivore" = "merbivore",
"ambiance" = "ambiance",
"chaos" = "chaos",
"tomorrow night blue" = "tomorrow-night-blue",
"tomorrow night bright" = "tomorrow-night-bright",
"tomorrow night eighties" = "tomorrow-night-eighties"
)

theme <- theme_mapping[[clean_theme_name]] %||% "github-dark"
glue::glue("https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.10.0/build/styles/{theme}.min.css") # nolint
glue::glue("https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.10.0/build/styles/{theme}.min.css")

Check warning on line 359 in R/app_chat_style.R

View workflow job for this annotation

GitHub Actions / lint

file=R/app_chat_style.R,line=359,col=101,[line_length_linter] Lines should not be more than 100 characters. This line is 106 characters.
} else {
cli::cli_inform("Failed to get RStudio theme. Using default 'github' theme.")
glue::glue("https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.10.0/build/styles/github-dark.min.css") # nolint
cli::cli_inform("Failed to get RStudio theme. Using default 'github-dark' theme.")
glue::glue("https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.10.0/build/styles/github-dark.min.css")

Check warning on line 362 in R/app_chat_style.R

View workflow job for this annotation

GitHub Actions / lint

file=R/app_chat_style.R,line=362,col=101,[line_length_linter] Lines should not be more than 100 characters. This line is 110 characters.
}
}

0 comments on commit 602c9f5

Please sign in to comment.