View source: R/prettify_PhantomJS.R
reindent_PhantomJS | R Documentation |
Reindent some code using PhantomJS.
reindent_PhantomJS(contents = NA, language = NA, tabSize = NULL)
contents |
the code to be reindented; there are three possibilities for
this argument:
|
language |
the language of the code, such as |
tabSize |
number of spaces of the indentation (usually |
The reindented code in a character string.
This function requires the 'phantomjs' command-line utility.
library(prettifyAddins)
code <- c(
'if test == 1:',
'print "it is one"',
'else:',
'print "it is not one"'
)
if(Sys.which("phantomjs") != "") {
cat(reindent_PhantomJS(code, "python"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.