• Stars
    star
    705
  • Rank 61,640 (Top 2 %)
  • Language
    CSS
  • Created almost 10 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

HTML output formats for RMarkdown documents

rmdformats

CRAN_Status_Badge CRAN Downloads R build status

**Quarto users : ** these templates are only suitable for RMarkdown documents. I published one quarto custom format called bookup which is a porting of the robobook template.

This R package provides ready-to-use HTML output formats and templates for RMarkdown documents. The goal is to produce clean documents "out of the box", with or without the RStudio IDE.

Formats gallery

The package provides several HTML output formats. Click on any image to see an HTML output sample.

downcute

Taken from the docute project theme and its adaptation by John Coene. Responsive, with a dynamic table of contents and a dark theme switcher.

downcute example

downcute chaos is a variation created by Zac Garland. It has a slightly different color theme, and defaults to dark mode. To use it, add a downcute_theme: "chaos" option in your YAML preamble.

downcute chaos example

robobook

Adapted from the bookdown theme, with Roboto family fonts. Fully responsive with dynamic table of contents and collapsible navigation.

robobook example

material

Format taken from the Material design theme for Bootstrap 3. Document is split into pages at each <h1> header, and the table of contents allows an animated navigation between these pages (you can use the cards: false preamble parameter to disable the splitting and display all the cards at once).

material example

readthedown

Adapted from the corresponding readtheorg theme of the org-html-themes project, fully responsive with dynamic table of contents and collapsible navigation.

readthedown example

html_clean

Simple and clean template with dynamic table of contents, very similar to the one from the great knitrBootstrap package by Jim Hester.

html_clean example

html_docco

Simple template, no table of contents. CSS heavily inspired from the default one of the docco project.

html_docco example

lockdown

lockdown is an exact copy of the default RMarkdown html_document template, with an added functionality : each time you click on a link to get out, you'll see a friendly reminder to wash your hands and wear a mask. Yes, it is a (bad) attempt at a (bad) joke, sorry !

lockdown example

Features and helpers

Features matrix

Responsive Dynamic TOC Dark mode Thumbnails / Lightbox Code folding Tabsets Bad joke
html_docco x x x x
html_clean x x x x x
readthedown x x x x
material x x x
robobook x x x x x
downcute x x x x x x
lockdown x

Helpers

The package also provides RStudio document templates to easily generate an empty and ready to use rmarkdown file with several configuration directives.

It also provides the pilltabs() helper function, which allows to display a crosstab dynamically. See one of the output samples for a live example.

Installation

You can install the latest stable release from CRAN :

install.packages("rmdformats")

Or the latest development snapshot from GitHub :

install.packages(remotes)  # if necessary
remotes::install_github("juba/rmdformats")

Creating a new document

Just create a new Rmd file and add the following in your YAML preamble :

---
output: rmdformats::<template name>
---

Within RStudio , you can also choose File > New File... > R Markdown..., then select From Template. You should then be able to create a new document from one of the package templates.

Options

Depending on the features provided by the template, you can add the following options to your YAML preamble. Look at the template function help page for a valid list :

  • fig_width : figures width, in inches
  • fig_height : figures height, in inches
  • fig_caption : toggle figure caption rendering
  • highlight : syntax highlighting
  • thumbnails : if TRUE, display content images as thumbnails
  • lightbox : if TRUE, add lightbox effect to content images
  • gallery : if TRUE, add navigation between images when displayed in lightbox
  • use_bookdown : if TRUE, will use bookdown instead of rmarkdown for HTML rendering, thus providing section numbering and cross references.
  • embed_fonts : if TRUE (default), use local files for fonts used in the template instead of links to Google Web fonts. This leads to bigger files but ensures that the fonts are available
  • additional aguments are passed to the base html_document RMarkdown template

Example preamble :

---
title: "My document"
date: "`r Sys.Date()`"
author: John Doe
output:
  rmdformats::downcute:
    self_contained: true
    thumbnails: true
    lightbox: true
    gallery: false
    highlight: tango
---

Credits

  • Magnific popup lightbox plugin
  • The CSS for the html_docco format is heavily inspired from the default one of the docco project.
  • The CSS and JavaScript for readthedown is adapted from the corresponding readtheorg theme of the org-html-themes project, which is itself inspired by the Read the docs Sphinx theme.
  • The CSS and JavaScript for material has been taken from the Material design theme for Bootstrap 3 project and its presentation page.
  • The CSS for robobook is directly derived from the bookdown project template.
  • The CSS for downcute is directly derived from the default theme of the docute project and its adaptation by John Coene for some of its projects documentation.
  • The downcute chaos theme has been created by Zac Garland.
  • JavaScript and HTML code for code folding and tabbed sections are taken from the RStudio's default rmarkdown HTML template.
  • The html_clean styling and features are very similar to the ones from the knitrBootstrap package by Jim Hester.

More Repositories

1

explor

Interfaces for Multivariate Analysis in R
R
186
star
2

pyobsplot

Observable Plot in Jupyter notebooks and Quarto documents
HTML
163
star
3

robservable

Observable notebooks as R htmlwidgets
HTML
157
star
4

scatterD3

R scatter plot htmlwidget based on D3.js
JavaScript
157
star
5

color-theme-tangotango

An emacs color theme based on the tango palette colors
Emacs Lisp
149
star
6

shinyglide

Glide.js component for Shiny apps
R
90
star
7

questionr

R package to make surveys processing easier
R
81
star
8

obsplot

Observable Plot bindings for R
R
59
star
9

rainette

R implementation of the Reinert text clustering method
R
50
star
10

tidyverse

Introduction à R et au tidyverse
SCSS
43
star
11

uniquanti

Small JavaScript app to visualize basic statistics
JavaScript
42
star
12

bookup-html

Bookup custom Quarto HTML format
SCSS
38
star
13

rwos

R interface to Web of Science Web Services API
R
21
star
14

scatterD3_shiny_app

Minimal example shiny app for the scatterD3 package : https://github.com/juba/scatterD3
R
12
star
15

textile-mode

An emacs major mode for Textile markup language editing.
Emacs Lisp
6
star
16

khi2_slides

Présentation sur le test du Khi2
HTML
6
star
17

intro-r

(Obsolète) Introduction à R
PostScript
6
star
18

shiny_prenoms

Shiny app for french first names at birth dataset
R
6
star
19

texplor

Interactive Interfaces for Textual Analysis in R
R
5
star
20

timeline-generator

PDF timeline generator (Ruby, LaTeX, TikZ)
Ruby
5
star
21

presid2012-bureaux-lyon

Résultats du premier tour des présidentielles de 2012 dans les bureaux de vote de Lyon
R
2
star
22

archive_doc_khi2

Archive d'un document d'introduction au test du Khi2
TeX
2
star
23

rgrs

R package that provides functions for beginners and social sciences students or researchers (cross-tabulation, weighting, results export, and maps plotting).
R
2
star
24

presid2012-classif-communes

Classification des communes de France selon leurs votes au premier tour de l'élection présidentielle 2012
R
2
star
25

StableDiffusionNotebook

Stable diffusion custom notebook
Jupyter Notebook
1
star
26

advent-2023

Advent of code 2023
Python
1
star
27

umapscan

UMAP dimensionality reduction and DBSCAN clustering R helper package
R
1
star
28

rmarkdown_rlyon_2014

Slides de présentation de Rmarkdown à RLyon - 20/11/2014
CSS
1
star
29

org-seenthis

Interface between emacs' org-mode and seenthis.net
Emacs Lisp
1
star
30

js-exos

Questions-réponses en html/javascript
JavaScript
1
star