Learn R Programming

prettydoc (version 0.4.1)

html_pretty: Creating Pretty HTML from R Markdown

Description

This function is an alternative to the html_document and html_vignette formats to create HTML document from R Markdown. It generates small yet pretty HTML pages that are suitable for publishing project pages and package vignettes. See the online documentation for more details.

Usage

html_pretty(
  theme = "cayman",
  highlight = NULL,
  css = NULL,
  math = c("mathjax", "katex"),
  fig_retina = NULL,
  keep_md = FALSE,
  readme = FALSE,
  compressed_css = TRUE,
  ...
)

Arguments

theme

Character string to specify the document theme. Currently supported themes are "cayman", "tactile", "architect", "leonids", and "hpstr".

highlight

Character string to specify the syntax highlight theme. Supported values are NULL (use Pandoc default), "github", and "vignette".

css

Additional CSS file to be merged in the document. It will NOT overwrite the CSS from the themes.

math

The engine to render math expressions. Possible values are "mathjax" and "katex". The katex engines supports offline (no internet connection) rendering of math expressions.

fig_retina

The same argument in html_document but with a different default value (NULL to disable retina scaling)

keep_md

Keep the markdown file generated by knitting. This is the same argument in html_vignette.

readme

Use this vignette as the package README.md file. This is the same argument in html_vignette.

compressed_css

Whether the compressed CSS should be used.

Additional arguments passed to html_document.

Value

R Markdown output format to pass to render.

Examples

Run this code
# NOT RUN {
doc = system.file("rmarkdown", "templates", "html_pretty_vignette",
                  "skeleton", "skeleton.Rmd", package = "prettydoc")
rmarkdown::render(doc, html_pretty(), output_dir = tempdir())
# }

Run the code above in your browser using DataLab