Description Usage Arguments Value Note Examples
View source: R/prettify_PhantomJS.R
Reindent some code using PhantomJS.
1 | 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.
1 2 3 4 5 6 7 8 9 10 11 12 | library(prettifyAddins)
code <- c(
'if test == 1:',
'print "it is one"',
'else:',
'print "it is not one"'
)
## Not run:
cat(reindent_PhantomJS(code, "python"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.