View source: R/external_highlight.R
external_highlight | R Documentation |
Multi-language source code highlighter
external_highlight( file, outfile = stdout(), theme = "kwrite", lang = NULL, type = "HTML", line_numbers = FALSE, doc = TRUE, code )
file |
Source file to highlight |
outfile |
Destination of the highlighted code.
When |
theme |
One of the themes. See |
lang |
The language in which the code is to be interpreted. If this argument is not given, it will be deduced from the file extension. |
type |
Output format. See |
line_numbers |
if |
doc |
if |
code |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.