Nothing
knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(highlighter)
We can use the highglighter
function in order to render and highlight code.
By default the function will highlight the syntax of R code.
highlighter("some_variable <- 3")
If we want we can specify the language using the language
parameter.
highlighter("const someVariable = 3;", language = "js")
We can pass the path to a local file using the highlight_file
function
# Specifying the language to be used highlight_file("<path_to_your_file>", language = "r") # Auto guessing the language to be highlighted when the language # parameter is not specified. highlight_file("<path_to_your_file>")
Specifying a theme to be used. You can get the available themes by
means of the following function: get_available_themes()
# Specifying the language to be used and the theme highlight_file("<path_to_your_file>", language = "r", theme = "dark")
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.