HTML Output Formats and Templates for 'rmarkdown' Documents
HTML formats and templates for 'rmarkdown' documents, with some extra
features such as automatic table of contents, lightboxed figures, dynamic
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.
The package provides several HTML output formats. You can click on an image to see a real HTML output sample.
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).
Adapted from the corresponding
readtheorg theme of the org-html-themes project, fully responsive with dynamic table of contents and collapsible navigation.
Simple and clean template with dynamic table of contents, very similar to the one from the great knitrBootstrap package by Jim Hester.
Simple template, no table of contents. CSS heavily inspired from the default one of the docco project.
Features and helpers
Some extra features are available depending on the format :
readthedownis fully responsive, with collapsible navigation
readthedownprovide an automatic and dynamic table of contents
html_doccoprovide automatic thumbnails for figures with lightbox display
- code folding and tabsets are supported like in RStudio's HTML template
The package also provides a
create.doc() function as well as RStudio document
templates to easily generate an empty and ready to use rmarkdown file with
several configuration directives.
Finally, it also provides the
pilltabs() helper function, which allows to display a crosstab dynamically. See one of the output samples for a live example.
You can install the latest stable release from CRAN :
Or the latest development snapshot from GitHub :
install.packages(remotes) # if necessary remotes::install_github("juba/rmdformats")
Creating a new document
New File... >
R Markdown..., then select
You should then be able to create a new document from one of the package
create.doc() function allows you to create a new directory with a clean
ready-to-use RMarkdown file.
create.doc() gets two main arguments :
dirnameis the name of the folder and RMarkdown file to be created
formatis the format name (
By default, a
Makefile file will be created in the new folder for direct
rendering from the command line.
Rendering from within RStudio should be quite simple : just click the
Rendering from R
You can render your document into HTML directly from within R with the
render() function from the
rmarkdown package :
Rendering with the Makefile
If you created your
.Rmd file with the
create.doc() function, you can then
generate HTML or PDF files with :
make html make pdf
You can also clean out any generated files and cache with :
- Magnific popup lightbox plugin
- The code of
create.doc()is heavily inspired by the
create.project()function of the ProjectTemplate package
- The CSS for the
html_doccoformat is heavily inspired from the default one of the docco project.
readthedownis adapted from the corresponding
readtheorgtheme of the org-html-themes project, which is itself inspired by the Read the docs Sphinx theme.
materialhas been taken from the Material design theme for Bootstrap 3 project and its presentation page
html_clean styling and features are very similar to the ones from the great
knitrBootstrap package by Jim
Functions in rmdformats
|readthedown||Convert to an HTML document|
|knit_print.pilltabs||knitr printing function for pilltabs|
|pilltabs||Given a cross-table, outputs HTML code to display several views of with a tabbed interface|
|html_clean||Convert to an HTML document|
|material||Material design - bootstrap HTML output format|
|html_docco||Convert to an HTML document|
|create.doc||Create a new directory with a clean RMarkdown file|
|print.pilltabs||Printing function for pilltabs|
Vignettes of rmdformats
Last month downloads
|License||GPL (>= 2)|
|Packaged||2020-03-11 08:21:40 UTC; julien|
|Date/Publication||2020-03-11 11:20:02 UTC|
Include our badge in your README