Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove exercise icons #436

Merged
merged 3 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 31 additions & 1 deletion R/knitr-hooks.R
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,44 @@ install_knitr_hooks <- function() {
} else {
cap_engine <- knitr_engine(options$engine)

# use logo shipped within learnr pkg (currently none)
cap_engine_file <- system.file(file.path("internals", "icons", paste0(cap_engine, ".svg")), package = "learnr")
if (file.exists(cap_engine_file)) {
as.character(htmltools::div(
class = "tutorial_engine_icon",
htmltools::HTML(readLines(cap_engine_file))
))
} else {
paste0(options$engine, " code")
cap_engine_val <-
switch(cap_engine,
"bash" = "Bash",
"c" = "C",
"coffee" = "CoffeeScript",
"cc" = "C++",
"css" = "CSS",
"go" = "Go",
"groovy" = "Groovy",
"haskell" = "Haskell",
"js" = "JavaScript",
"mysql" = "MySQL",
"node" = "Node.js",
"octave" = "Octave",
"psql" = "PostgreSQL",
"python" = "Python",
"r" = "R",
"rcpp" = "Rcpp",
"cpp11" = "cpp11",
"rscript" = "Rscript",
schloerke marked this conversation as resolved.
Show resolved Hide resolved
"ruby" = "Ruby",
"perl" = "Perl",
"sass" = "Sass",
"scala" = "Scala",
"scss" = "SCSS",
"sql" = "SQL",
# else, return as the user provided
options$engine
)
paste0(cap_engine_val, " code")
}
}
ui_options <- list(
Expand Down
1 change: 0 additions & 1 deletion inst/internals/icons/bash.svg

This file was deleted.

1 change: 0 additions & 1 deletion inst/internals/icons/c.svg

This file was deleted.

1 change: 0 additions & 1 deletion inst/internals/icons/cc.svg

This file was deleted.

1 change: 0 additions & 1 deletion inst/internals/icons/coffee.svg

This file was deleted.

1 change: 0 additions & 1 deletion inst/internals/icons/css.svg

This file was deleted.

1 change: 0 additions & 1 deletion inst/internals/icons/go.svg

This file was deleted.

1 change: 0 additions & 1 deletion inst/internals/icons/groovy.svg

This file was deleted.

1 change: 0 additions & 1 deletion inst/internals/icons/haskell.svg

This file was deleted.

1 change: 0 additions & 1 deletion inst/internals/icons/js.svg

This file was deleted.

1 change: 0 additions & 1 deletion inst/internals/icons/mysql.svg

This file was deleted.

1 change: 0 additions & 1 deletion inst/internals/icons/node.svg

This file was deleted.