hi_andre: A wrapper to Andre Simon's Highlight

View source: R/highlight.R

hi_andreR Documentation

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")

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, ...)

Value

A character string for the syntax highlighted code.

References

Andre Simon's Highlight package http://www.andre-simon.de.

Examples

## Not run: 
hi_andre("1+1", language = "R")
hi_andre("void main() {\nreturn(0)\n}", language = "c", format = "latex")

## End(Not run)

yihui/highr documentation built on Nov. 13, 2023, 11:15 p.m.