Package 'rmdformats'

Title: HTML Output Formats and Templates for 'rmarkdown' Documents
Description: HTML formats and templates for 'rmarkdown' documents, with some extra features such as automatic table of contents, lightboxed figures, dynamic crosstab helper.
Authors: Julien Barnier [aut, cre]
Maintainer: Julien Barnier <[email protected]>
License: GPL (>= 2)
Version: 1.0.4.9000
Built: 2024-11-13 04:13:58 UTC
Source: https://github.com/juba/rmdformats

Help Index


Convert to an HTML document

Description

Format for converting from R Markdown to an HTML document.

Usage

downcute(
  fig_width = 8,
  fig_height = 5,
  fig_caption = TRUE,
  lightbox = FALSE,
  thumbnails = FALSE,
  gallery = FALSE,
  toc_depth = 2,
  embed_fonts = TRUE,
  use_bookdown = FALSE,
  pandoc_args = NULL,
  md_extensions = NULL,
  mathjax = "rmdformats",
  highlight = NULL,
  default_style = c("light", "dark"),
  downcute_theme = c("default", "chaos"),
  style_switcher = TRUE,
  ...
)

Arguments

fig_width

Default width (in inches) for figures

fig_height

Default width (in inches) for figures

fig_caption

TRUE to render figures with captions

lightbox

if TRUE, add lightbox effect to content images

thumbnails

if TRUE display content images as thumbnails

gallery

if TRUE and lightbox is TRUE, add a gallery navigation between images in lightbox display

toc_depth

adjust table of contents depth

embed_fonts

if TRUE, use local files for fonts used in the template. This leads to bigger files but ensures that these fonts are available. If FALSE they are downloaded from Google Web Fonts.

use_bookdown

if TRUE, uses html_document2 instead of html_document, thus providing numbered sections and cross references

pandoc_args

arguments passed to the pandoc_args argument of rmarkdown html_document

md_extensions

arguments passed to the md_extensions argument of rmarkdown html_document

mathjax

set to NULL to disable Mathjax insertion

highlight

syntax highlighting, forced to NULL as highlighting is done via prism.js

default_style

specify default display style, "light" or "dark"

downcute_theme

document template theme

style_switcher

if TRUE (default), display a toggle button to switch between light and dark styles

...

Additional function arguments passed to R Markdown html_document

Details

CSS taken from the docute project and adaptations made by John Coene. Please note that as syntax highlighting is done with the Prism JavaScript library, using the 'highlight' argument here will have no effect.

Value

R Markdown output format to pass to render


Convert to an HTML document

Description

Format for converting from R Markdown to an HTML document.

Usage

html_clean(
  fig_width = 6,
  fig_height = 6,
  fig_caption = TRUE,
  highlight = "kate",
  lightbox = TRUE,
  thumbnails = TRUE,
  gallery = FALSE,
  toc = TRUE,
  toc_depth = 2,
  use_bookdown = FALSE,
  pandoc_args = NULL,
  md_extensions = NULL,
  mathjax = "rmdformats",
  ...
)

Arguments

fig_width

Default width (in inches) for figures

fig_height

Default width (in inches) for figures

fig_caption

TRUE to render figures with captions

highlight

Syntax highlighting style. Supported styles include "default", "tango", "pygments", "kate", "monochrome", "espresso", "zenburn", "haddock", and "textmate". Pass NULL to prevent syntax highlighting.

lightbox

if TRUE, add lightbox effect to content images

thumbnails

if TRUE display content images as thumbnails

gallery

if TRUE and lightbox is TRUE, add a gallery navigation between images in lightbox display

toc

if TRUE, display a table of contents

toc_depth

adjust table of contents depth

use_bookdown

if TRUE, uses html_document2 instead of html_document, thus providing numbered sections and cross references

pandoc_args

arguments passed to the pandoc_args argument of rmarkdown html_document

md_extensions

arguments passed to the md_extensions argument of rmarkdown html_document

mathjax

set to NULL to disable Mathjax insertion

...

Additional function arguments passed to R Markdown html_document

Details

Styling and features are very similar to the ones from the great knitrBootstrap package by Jim Hester : https://github.com/jimhester/knitrBootstrap

Value

R Markdown output format to pass to render


Convert to an HTML document

Description

Format for converting from R Markdown to an HTML document.

Usage

html_docco(
  fig_width = 6,
  fig_height = 6,
  fig_caption = TRUE,
  highlight = "kate",
  lightbox = TRUE,
  thumbnails = TRUE,
  gallery = FALSE,
  use_bookdown = FALSE,
  pandoc_args = NULL,
  md_extensions = NULL,
  mathjax = "rmdformats",
  ...
)

Arguments

fig_width

Default width (in inches) for figures

fig_height

Default width (in inches) for figures

fig_caption

TRUE to render figures with captions

highlight

Syntax highlighting style. Supported styles include "default", "tango", "pygments", "kate", "monochrome", "espresso", "zenburn", "haddock", and "textmate". Pass NULL to prevent syntax highlighting.

lightbox

if TRUE, add lightbox effect to content images

thumbnails

if TRUE display content images as thumbnails

gallery

if TRUE and lightbox is TRUE, add a gallery navigation between images in lightbox display

use_bookdown

if TRUE, uses html_document2 instead of html_document, thus providing numbered sections and cross references

pandoc_args

arguments passed to the pandoc_args argument of rmarkdown html_document

md_extensions

arguments passed to the md_extensions argument of rmarkdown html_document

mathjax

set to NULL to disable Mathjax insertion

...

Additional function arguments passed to rmarkdown html_document

Details

The CSS is heavily inspired from the default one of the docco project : https://ashkenas.com/docco/.

Value

R Markdown output format to pass to render


Convert to an HTML document

Description

Format for converting from R Markdown to an HTML document.

Usage

lockdown(...)

Arguments

...

Additional function arguments passed to R Markdown html_document

Details

TODO

Value

R Markdown output format to pass to render


Material design - bootstrap HTML output format

Description

Format for converting from R Markdown to an HTML document with a material design theme.

Usage

material(
  fig_width = 6,
  fig_height = 6,
  fig_caption = TRUE,
  highlight = "kate",
  lightbox = TRUE,
  thumbnails = TRUE,
  gallery = FALSE,
  cards = TRUE,
  use_bookdown = FALSE,
  pandoc_args = NULL,
  md_extensions = NULL,
  mathjax = "rmdformats",
  ...
)

Arguments

fig_width

Default width (in inches) for figures

fig_height

Default width (in inches) for figures

fig_caption

TRUE to render figures with captions

highlight

Syntax highlighting style. Supported styles include "default", "tango", "pygments", "kate", "monochrome", "espresso", "zenburn", "haddock", and "textmate". Pass NULL to prevent syntax highlighting.

lightbox

if TRUE, add lightbox effect to content images

thumbnails

if TRUE display content images as thumbnails

gallery

if TRUE and lightbox is TRUE, add a gallery navigation between images in lightbox display

cards

if TRUE, sections will be presented as distinct and animated cards

use_bookdown

if TRUE, uses html_document2 instead of html_document, thus providing numbered sections and cross references

pandoc_args

arguments passed to the pandoc_args argument of rmarkdown html_document

md_extensions

arguments passed to the md_extensions argument of rmarkdown html_document

mathjax

set to NULL to disable Mathjax insertion

...

Additional function arguments passed to R Markdown html_document

Details

JavaScript and CSS taken and adapted from the Material design theme for Bootstrap 3 project : https://github.com/FezVrasta/bootstrap-material-design.

Value

R Markdown output format to pass to render


Given a cross-table, outputs HTML code to display several views of with a tabbed interface

Description

Given a two dimensions contingency table, this function outputs HTML code to display, within a dynamic tabbed interface, the count, row percentages, column percentages and chi-squared residuals tables.

Usage

pilltabs(
  tab,
  count = TRUE,
  rows = TRUE,
  cols = TRUE,
  chisq = TRUE,
  resid = TRUE,
  row.names = TRUE
)

Arguments

tab

a two dimensions table object

count

whether or not to display the count table

rows

whether or not to display the row percentages table

cols

whether or not to display the column percentages table

chisq

whether or not to display the table chi-squared test results

resid

whether or not to display the chi-squared residuals table

row.names

whether or not to display the table row names

Details

The function is intended to be called inside an rmarkdown document.

Value

No value is returned.

Examples

data(airquality)
tab <- table(airquality$Month, airquality$Ozone > 25)
pilltabs(tab)

Printing functions for pilltabs

Description

Not to be used directly

Usage

## S3 method for class 'pilltabs'
print(x, ...)

## S3 method for class 'pilltabs'
knit_print(x, ...)

Arguments

x

data to be printed, generated by pilltabs

...

arguments passed to other methods


Convert to an HTML document

Description

Format for converting from R Markdown to an HTML document.

Usage

readthedown(
  fig_width = 8,
  fig_height = 5,
  fig_caption = TRUE,
  highlight = "kate",
  lightbox = FALSE,
  thumbnails = FALSE,
  gallery = FALSE,
  toc_depth = 2,
  embed_fonts = TRUE,
  use_bookdown = FALSE,
  pandoc_args = NULL,
  md_extensions = NULL,
  mathjax = "rmdformats",
  ...
)

Arguments

fig_width

Default width (in inches) for figures

fig_height

Default width (in inches) for figures

fig_caption

TRUE to render figures with captions

highlight

Syntax highlighting style. Supported styles include "default", "tango", "pygments", "kate", "monochrome", "espresso", "zenburn", "haddock", and "textmate". Pass NULL to prevent syntax highlighting.

lightbox

if TRUE, add lightbox effect to content images

thumbnails

if TRUE display content images as thumbnails

gallery

if TRUE and lightbox is TRUE, add a gallery navigation between images in lightbox display

toc_depth

adjust table of contents depth

embed_fonts

if TRUE, use local files for fonts used in the template. This leads to bigger files but ensures that these fonts are available. If FALSE they are downloaded from Google Web Fonts.

use_bookdown

if TRUE, uses html_document2 instead of html_document, thus providing numbered sections and cross references

pandoc_args

arguments passed to the pandoc_args argument of rmarkdown html_document

md_extensions

arguments passed to the md_extensions argument of rmarkdown html_document

mathjax

set to NULL to disable Mathjax insertion

...

Additional function arguments passed to R Markdown html_document

Details

CSS adapted from the readtheorg theme of the org-html-themes project : https://github.com/fniessen/org-html-themes, which is itself inspired by the Read the docs theme : https://readthedocs.org/.

Value

R Markdown output format to pass to render


Convert to an HTML document

Description

Format for converting from R Markdown to an HTML document.

Usage

robobook(
  fig_width = 8,
  fig_height = 5,
  fig_caption = TRUE,
  highlight = "kate",
  lightbox = FALSE,
  thumbnails = FALSE,
  gallery = FALSE,
  toc_depth = 2,
  embed_fonts = TRUE,
  use_bookdown = FALSE,
  pandoc_args = NULL,
  md_extensions = NULL,
  mathjax = "rmdformats",
  ...
)

Arguments

fig_width

Default width (in inches) for figures

fig_height

Default width (in inches) for figures

fig_caption

TRUE to render figures with captions

highlight

Syntax highlighting style. Supported styles include "default", "tango", "pygments", "kate", "monochrome", "espresso", "zenburn", "haddock", and "textmate". Pass NULL to prevent syntax highlighting.

lightbox

if TRUE, add lightbox effect to content images

thumbnails

if TRUE display content images as thumbnails

gallery

if TRUE and lightbox is TRUE, add a gallery navigation between images in lightbox display

toc_depth

adjust table of contents depth

embed_fonts

if TRUE, use local files for fonts used in the template. This leads to bigger files but ensures that these fonts are available. If FALSE they are downloaded from Google Web Fonts.

use_bookdown

if TRUE, uses html_document2 instead of html_document, thus providing numbered sections and cross references

pandoc_args

arguments passed to the pandoc_args argument of rmarkdown html_document

md_extensions

arguments passed to the md_extensions argument of rmarkdown html_document

mathjax

set to NULL to disable Mathjax insertion

...

Additional function arguments passed to R Markdown html_document

Details

CSS adapted from the bookdown project, with Roboto family fonts.

Value

R Markdown output format to pass to render