mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 12:37:30 +02:00
renaming to cut function to cut_var to distinct from the base-version - UI improvements - nice code formatting.
This commit is contained in:
parent
8469a5ca64
commit
361296531e
30 changed files with 1248 additions and 1686 deletions
25
R/syntax_highlight.R
Normal file
25
R/syntax_highlight.R
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
## Inpiration:
|
||||
##
|
||||
## https://stackoverflow.com/questions/47445260/how-to-enable-syntax-highlighting-in-r-shiny-app-with-htmloutput
|
||||
|
||||
prismCodeBlock <- function(code) {
|
||||
tagList(
|
||||
HTML(html_code_wrap(code)),
|
||||
tags$script("Prism.highlightAll()")
|
||||
)
|
||||
}
|
||||
|
||||
prismDependencies <- tags$head(
|
||||
tags$script(src = "https://cdnjs.cloudflare.com/ajax/libs/prism/1.8.4/prism.min.js"),
|
||||
tags$link(rel = "stylesheet", type = "text/css",
|
||||
href = "https://cdnjs.cloudflare.com/ajax/libs/prism/1.8.4/themes/prism.min.css")
|
||||
)
|
||||
|
||||
prismRDependency <- tags$head(
|
||||
tags$script(src = "https://cdnjs.cloudflare.com/ajax/libs/prism/1.8.4/components/prism-r.min.js")
|
||||
)
|
||||
|
||||
html_code_wrap <- function(string,lang="r"){
|
||||
glue::glue("<pre><code class='language-{lang}'>{string}
|
||||
</code></pre>")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue