cleanrmd is a no-frills, lightweight HTML format for R Markdown, using class-less CSS.
This package was greatly inspired by Yuval Greenfield’s blog post: The Next CSS Frontier - Classless.
You can install the released version of cleanrmd from CRAN:
You can install the latest development version from GitHub:
# install.packages("remotes") remotes::install_github("gadenbuie/cleanrmd")
or from gadenbuie.r-universe.dev:
options(repos = c( gadenbuie = 'https://gadenbuie.r-universe.dev', CRAN = 'https://cloud.r-project.org' )) install.packages('cleanrmd')
Create a new R Markdown document using the Clean HTML R Markdown
template in RStudio, or add the following to your
.Rmd YAML header.
output: cleanrmd::html_document_clean: theme: no-class
To explore the available themes, set
output: cleanrmd::html_document_clean: theme: NULL
Syntax highlighting is provided by default by pandoc, where syntax
highlighting is performed during during the render, minimizing
dependencies. pandoc’s highlighting themes include
default highlighting theme is
arrow, provided by the
rmarkdown package in addition to
html_document_clean() can also use
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
MathJax and FontAwesome are also available but disabled by default.
To enable either feature, you can set
enable Font Awesome icons.
output: cleanrmd::html_document_clean: mathjax: default use_fontawesome: true
Just the theme #
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() #>  "almond" "awsm.css" "axist" #>  "bamboo" "bullframe" "holiday" #>  "kacit" "latex.css" "markdown-splendor" #>  "markdown-retro" "markdown-air" "markdown-modest" #>  "marx" "minicss" "new.css" #>  "no-class" "picocss" "sakura" #>  "sakura-vader" "semantic" "simplecss" #>  "style-sans" "style-serif" "stylize" #>  "superstylin" "tacit" "vanilla" #>  "water" "water-dark" "writ"
The following CSS themes are included in this package and you can preview all 30 themes in one place here.