Multi-language source code highlighter
external_highlight(file, outfile = stdout(), theme = "kwrite",
lang = NULL, type = "HTML", line_numbers = FALSE, doc = TRUE, code)
Source file to highlight
Destination of the highlighted code.
When NULL
, the code is simply returned as a character vector
One of the themes. See highlight_themes
for the list
of available themes.
The language in which the code is to be interpreted. If this argument is not given, it will be deduced from the file extension.
Output format. See highlight_output_types
for the list
of supported output types.
if TRUE
, the result will include line numbers
if TRUE
, the result is a stand alone document, otherwise, just a
portion to include in a document
If given, then the source code is not read from the file
Nothing if outfile
is given, with the side effect of writing into the file.
The result as a character vector if outfile is NULL
highlight
to highlight R code using the information from the parser