html_paged: Create a paged HTML document suitable for printing

View source: R/paged.R

html_pagedR Documentation

Create a paged HTML document suitable for printing

Description

This is an output format based on bookdown::html_document2 (which means you can use those Markdown features added by bookdown). The HTML output document is split into multiple pages via a JavaScript library paged.js. These pages contain elements commonly seen in PDF documents, such as page numbers and running headers.

Usage

html_paged(
  ...,
  css = c("default-fonts", "default-page", "default"),
  theme = NULL,
  template = pkg_resource("html", "paged.html"),
  csl = NULL,
  front_cover = NULL,
  back_cover = NULL
)

Arguments

...

Arguments passed to bookdown::html_document2.

css

A character vector of CSS and Sass file paths. If a path does not contain the ‘.css’, ‘.sass’, or ‘.scss’ extension, it is assumed to be a built-in CSS file. For example, default-fonts means the filepagedown:::pkg_resource('css', 'default-fonts.css'). To see all built-in CSS files, run pagedown:::list_css().

theme

The Bootstrap theme. By default, Bootstrap is not used.

template

The path to the Pandoc template to convert Markdown to HTML.

csl

The path of the Citation Style Language (CSL) file used to format citations and references (see the Pandoc documentation).

front_cover, back_cover

Paths or urls to image files to be used as front or back covers. Theses images are available through CSS variables (see Details).

Details

When a path or an url is passed to the front_cover or back_cover argument, several CSS variables are created. They are named --front-cover and --back-cover and can be used as value for the CSS property background-image. For example, background-image: var(--front-cover);. When a vector of paths or urls is used as a value for front_cover or back_cover, the CSS variables are suffixed with an index: --front-cover-1, --front-cover-2, etc.

Value

An R Markdown output format.

References

https://pagedown.rbind.io


pagedown documentation built on Dec. 28, 2022, 1:16 a.m.