Learn R Programming

highr (version 0.11)

hi_andre: A wrapper to Andre Simon's Highlight

Description

This function calls Highlight to syntax highlight a code fragment.

Usage

hi_andre(code, language, format = "html")

Value

A character string for the syntax highlighted code.

Arguments

code

a character string of the source code

language

the input language (c, cpp, python, r, ...); see system('highlight -p')

format

the output format (html, latex, ...)

References

Andre Simon's Highlight package https://gitlab.com/saalen/highlight.

Examples

Run this code
if (FALSE) {
hi_andre("1+1", language = "R")
hi_andre("void main() {\nreturn(0)\n}", language = "c", format = "latex")
}

Run the code above in your browser using DataLab