Maintainer: | Julien Barnier <julien.barnier@cnrs.fr> |
Version: | 1.0.4 |
Date: | 2022-05-10 |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Encoding: | UTF-8 |
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. |
Imports: | knitr, rmarkdown, bookdown, htmltools |
Suggests: | questionr, DT, palmerpenguins, ggplot2 |
URL: | https://github.com/juba/rmdformats |
BugReports: | https://github.com/juba/rmdformats/issues |
RoxygenNote: | 7.1.2 |
NeedsCompilation: | no |
Packaged: | 2022-05-17 08:05:52 UTC; julien |
Author: | Julien Barnier [aut, cre] |
Repository: | CRAN |
Date/Publication: | 2022-05-17 08:50:03 UTC |
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"),
...
)
Arguments
fig_width |
Default width (in inches) for figures |
fig_height |
Default width (in inches) for figures |
fig_caption |
|
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 |
pandoc_args |
arguments passed to the pandoc_args argument of rmarkdown |
md_extensions |
arguments passed to the md_extensions argument of rmarkdown |
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 |
... |
Additional function arguments passed to R Markdown |
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 |
|
highlight |
Syntax highlighting style. Supported styles include
"default", "tango", "pygments", "kate", "monochrome", "espresso",
"zenburn", "haddock", and "textmate". Pass |
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 |
pandoc_args |
arguments passed to the pandoc_args argument of rmarkdown |
md_extensions |
arguments passed to the md_extensions argument of rmarkdown |
mathjax |
set to NULL to disable Mathjax insertion |
... |
Additional function arguments passed to R Markdown |
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 |
|
highlight |
Syntax highlighting style. Supported styles include
"default", "tango", "pygments", "kate", "monochrome", "espresso",
"zenburn", "haddock", and "textmate". Pass |
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 |
pandoc_args |
arguments passed to the pandoc_args argument of rmarkdown |
md_extensions |
arguments passed to the md_extensions argument of rmarkdown |
mathjax |
set to NULL to disable Mathjax insertion |
... |
Additional function arguments passed to rmarkdown |
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 |
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 |
|
highlight |
Syntax highlighting style. Supported styles include
"default", "tango", "pygments", "kate", "monochrome", "espresso",
"zenburn", "haddock", and "textmate". Pass |
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 |
pandoc_args |
arguments passed to the pandoc_args argument of rmarkdown |
md_extensions |
arguments passed to the md_extensions argument of rmarkdown |
mathjax |
set to NULL to disable Mathjax insertion |
... |
Additional function arguments passed to R Markdown |
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 |
... |
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 |
|
highlight |
Syntax highlighting style. Supported styles include
"default", "tango", "pygments", "kate", "monochrome", "espresso",
"zenburn", "haddock", and "textmate". Pass |
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 |
pandoc_args |
arguments passed to the pandoc_args argument of rmarkdown |
md_extensions |
arguments passed to the md_extensions argument of rmarkdown |
mathjax |
set to NULL to disable Mathjax insertion |
... |
Additional function arguments passed to R Markdown |
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 |
|
highlight |
Syntax highlighting style. Supported styles include
"default", "tango", "pygments", "kate", "monochrome", "espresso",
"zenburn", "haddock", and "textmate". Pass |
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 |
pandoc_args |
arguments passed to the pandoc_args argument of rmarkdown |
md_extensions |
arguments passed to the md_extensions argument of rmarkdown |
mathjax |
set to NULL to disable Mathjax insertion |
... |
Additional function arguments passed to R Markdown |
Details
CSS adapted from the bookdown project, with Roboto family fonts.
Value
R Markdown output format to pass to render