View source: R/prettify_Shiny.R
prettify_Shiny | R Documentation |
Prettify some code using a Shiny app.
prettify_Shiny(contents = NA, language = NA, tabSize = NULL, themeInfo = NULL)
contents |
the code to be prettified; there are three possibilities for
this argument:
|
language |
the language of the code, such as |
tabSize |
number of spaces of the indentation (usually |
themeInfo |
this argument is not important, it controls the theme of
the Shiny app;
it must be |
The pretty code in a character string.
library(prettifyAddins)
code <- c(
"function f(x){",
"return x+1",
"}"
)
if(interactive()){
cat(prettify_Shiny(code, "javascript"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.