external_highlight: Multi-language source code highlighter

Description Usage Arguments Value References See Also

View source: R/external_highlight.R

Description

Multi language source code highlighter

Usage

1
2
3
4
5
6
7
    external_highlight(file, outfile = stdout(), theme = "kwrite", 
        lang = NULL, 
        type = "HTML", 
        line_numbers = FALSE, 
        doc = TRUE, 
        code
        )

Arguments

file

Source file to highlight.

outfile

Destination of the highlighted code. When NULL, the code is simply returned as a character vector

theme

One of the themes. See highlight_themes for the list of available themes.

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 highlight_output_types for the list of supported output types.

line_numbers

if TRUE, the result will include line numbers

doc

if TRUE, the result is a stand alone document, otherwise, just a portion to include in a document.

code

If code is given, then the source code is not read from the file.

Value

Nothing if outfile is given, with the side effect of writing into the file.

The result as a character vector if outfile is NULL

References

Based on the highlight library from http://www.andre-simon.de/index.html

See Also

highlight to highlight R code using the information from the parser.


highlight documentation built on May 2, 2019, 4:58 p.m.