# Simple way to output code as-is to knitr
kat <- knitr::asis_output
# Function to wrap example code between ``` before katting
kat_code <- function(code, language="r") {
result <- c(
paste0("```",language, "\n"),
code,
"\n```")
kat(result)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.