This function calls Highlight to syntax highlight a code fragment.
hi_andre(code, language, format = "html")
a character string of the source code
the input language (c, cpp, python, r, ...); see system('highlight -p')
system('highlight -p')
the output format (html, latex, ...)
A character string for the syntax highlighted code.
Andre Simon's Highlight package http://www.andre-simon.de.
# NOT RUN { 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 DataCamp Workspace