MyNixOS website logo
Description

Clean Class-Less 'R Markdown' HTML Documents.

A collection of clean 'R Markdown' HTML document templates using classy-looking classless CSS styles. These documents use a minimal set of dependencies but still look great, making them suitable for use a package vignettes or for sharing results via email.

cleanrmd

cleanrmd statusbadge CRANstatus R-CMD-check

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.

Installation

You can install the released version of cleanrmd from CRAN:

install.packages("cleanrmd")

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')

Usage

cleanrmd::html_document_clean

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

Syntax highlighting is provided by default by pandoc, where syntax highlighting is performed during during the render, minimizing dependencies. pandoc’s highlighting themes include pygments, tango, espresso, zenburn, kate, monochrome, breezedark, and haddock. 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: prism-coy, prism-dark, prism-funky, prism-okaidia, prism-solarizedlight, prism-tomorrow, and prism-twilight.

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

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()
#>  [1] "almond"            "awsm.css"          "axist"            
#>  [4] "bamboo"            "bullframe"         "holiday"          
#>  [7] "kacit"             "latex.css"         "markdown-splendor"
#> [10] "markdown-retro"    "markdown-air"      "markdown-modest"  
#> [13] "marx"              "minicss"           "new.css"          
#> [16] "no-class"          "picocss"           "sakura"           
#> [19] "sakura-vader"      "semantic"          "simplecss"        
#> [22] "style-sans"        "style-serif"       "stylize"          
#> [25] "superstylin"       "tacit"             "vanilla"          
#> [28] "water"             "water-dark"        "writ"

Themes

The following CSS themes are included in this package and you can preview all 30 themes in one place here.

Metadata

Version

0.1.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows