Create a new R Markdown document using the Clean HTML R Markdown template in RStudio,
or add the following to your .Rmd YAML header to use
cleanrmd::html_document_clean.
output: cleanrmd::html_document_clean: theme: no-class
To explore the available themes, set theme to NULL.
output: cleanrmd::html_document_clean: theme: NULL
combine_code <- function(x) { knitr::combine_words(x, before = "`") }
Syntax highlighting is provided by default by pandoc,
where syntax highlighting is performed during during the render,
minimizing dependencies.
pandoc's highlighting themes include
r combine_code(cleanrmd:::pandoc_highlight_styles()[-1:-3]).
The default highlighting theme is arrow, provided by the rmarkdown package in addition to the rstudio theme.
html_document_clean() can also use Prism for highlighting.
In this case, highlighting is performed in the browser
and the dependencies are downloaded as needed.
To use Prism, set theme: prism
or use one of the following value to choose a specific Prism theme:
r combine_code(cleanrmd:::prism_themes()[-1]).
MathJax and FontAwesome are also available but disabled by default. To enable either feature, you can set mathjax to local or default, as in rmarkdown::html_document(). Set use_fontawesome to TRUE to enable Font Awesome icons.
output: cleanrmd::html_document_clean: mathjax: default use_fontawesome: true
You can also load the CSS theme dependencies in other places where htmltools can be used to provide HTML dependencies, such as Shiny apps.
To include a theme in your app or page, use
cleanrmd::use_cleanrmd(theme = "new.css")
To view the list of theme options view the help pages of cleanrmd_themes() or use its output:
cleanrmd::cleanrmd_themes()
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.