Commit ecd97600 authored by Gjalt-Jorn Peters's avatar Gjalt-Jorn Peters

Separate function or the CSS

parent 69ad2b99
Pipeline #94809575 failed with stages
in 11 minutes and 15 seconds
......@@ -171,44 +171,9 @@ collect_coded_fragments <- function(x,
}
if (add_html_tags) {
res <- add_html_tags(res);
### Load stylesheets
bootstrapCSS <-
paste0(readLines(system.file("css", "bootstrap.min.css", package="rock")),
collapse="\n");
basicCSS <-
paste0(readLines(system.file("css", "basic.css", package="rock")),
collapse="\n");
if (file.exists(template)) {
templateCSS <-
paste0(readLines(template),
collapse="\n");
} else if (file.exists(system.file("css", paste0(template, ".css"), package="rock"))) {
templateCSS <-
paste0(readLines(system.file("css", "default.css", package="rock")),
collapse="\n");
} else {
templateCSS <-
paste0(readLines(system.file("css", "default.css", package="rock")),
collapse="\n");
}
### Merge stylesheets
fullCSS <-
paste0("\n<style\n>",
bootstrapCSS,
"\n\n",
basicCSS,
"\n\n",
templateCSS,
"\n</style>\n");
res <- paste0(fullCSS,
res <- paste0(rock::css(template=template),
"\n\n",
res);
rock::add_html_tags(res));
}
if (is.null(output)) {
......
css <- function(template = "default") {
### Load stylesheets
bootstrapCSS <-
paste0(readLines(system.file("css", "bootstrap.min.css", package="rock")),
collapse="\n");
basicCSS <-
paste0(readLines(system.file("css", "basic.css", package="rock")),
collapse="\n");
if (file.exists(template)) {
templateCSS <-
paste0(readLines(template),
collapse="\n");
} else if (file.exists(system.file("css", paste0(template, ".css"), package="rock"))) {
templateCSS <-
paste0(readLines(system.file("css", "default.css", package="rock")),
collapse="\n");
} else {
templateCSS <-
paste0(readLines(system.file("css", "default.css", package="rock")),
collapse="\n");
}
### Merge stylesheets
fullCSS <-
paste0("\n<style\n>",
bootstrapCSS,
"\n\n",
basicCSS,
"\n\n",
templateCSS,
"\n</style>\n");
return(fullCSS);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment