Usage
highlight(file, output = stdout(), detective = simple_detective, renderer,
encoding = "unknown", parser.output = parser(file, encoding = encoding),
styles = detective(parser.output), expr = NULL, final.newline = FALSE,
showPrompts = FALSE, prompt = getOption("prompt"), continue = getOption("continue"),
initial.spaces = TRUE,
size = c("normalsize", "tiny", "scriptsize",
"footnotesize", "small", "large", "Large", "LARGE", "huge",
"Huge"),
...)Arguments
file
code file to parse. This is only used if the parser.output is given
output
where to write the rendered text. If this is anything else than the
default (standard output), the sink function
is used to redirect the standard output to the output. detective
the detective chooses the style to apply to each token, basing its
investigation on the results of the parser renderer
highlight delegates rendering the information to the renderer. This
package includes html and latex renderers. See renderer_html
and renderer_latex encoding
encoding to assume for the file. the argument is directly passed
to the parser. parser.output
output from the parser. If this is given, the
arguments file and encoding are not used styles
result of the detective investigation. A character vector
with as many elements as there are tokens in the parser output
expr
In case we want to render only one expression and not the full parse
tree, this argument can be used to specify which expression
to render. The default (NULL) means render all expressions. This
feature is used by the sweave driver shipped with this packa
final.newline
logical. Indicates if a newline character is added after all tokens.
showPrompts
if TRUE, the highlighted text will show standard and continue prompt
initial.spaces
should initial spaces be displayed or skipped.
size
font size. only respected by the latex renderer so far.
...
additional arguments, currently ignored.