This is a minimal example of using highlightr to produce an PDF document from Markdown.
library(highlightr) text <- c("This is a good test with some bad words.", "The word 'bad' has red background and white font colour.", "The word 'good' has #77dd77 (green) background, font colour #00008b (blue).", "Both 'bad' and 'good' are bold and italic", "The word 'important' is bold and 'urgent' is italic.") dict <- as_dict(data.frame( feature = c("good", "bad", "important", "urgent"), bg_colour = c("#77dd77", "red", "", ""), txt_colour = c("#00008b", "white", "", ""), bold = c(TRUE, TRUE, TRUE, FALSE), italic = c(TRUE, TRUE, FALSE, TRUE), strike_out = TRUE, # is currently ignored stringsAsFactors = FALSE )) highlight(text, dict, output = "tex")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.