highlighter | R Documentation |
Highlights code
highlighter(
code,
language = "r",
theme = "default",
plugins = NULL,
width = "100%",
height = "auto",
elementId = NULL
)
code |
The code to be highlighted |
language |
The programming language chosen to be highlighted |
theme |
A character. Indicating which theme will be used |
plugins |
Optional. A list of plugins to be used |
width |
Optional. The width to be used by the widget |
height |
Optional. The height to be used by the widget |
elementId |
Optional. The DOM element id to be used by the widget |
An object of class highlighter
get_available_languages()
for available languages,
get_available_themes()
for available themes
# Highlight R code
if (interactive()) {
highlighter("print('Hello, world!')", language = "r")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.