| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/html_fragment.R |
| 3 |
\name{html_fragment} |
| 4 |
\alias{html_fragment} |
| 5 |
\title{Convert to an HTML fragment.} |
| 6 |
\usage{ |
| 7 |
html_fragment( |
| 8 |
number_sections = FALSE, |
| 9 |
section_divs = TRUE, |
| 10 |
fig_width = 7, |
| 11 |
fig_height = 5, |
| 12 |
fig_retina = 2, |
| 13 |
fig_caption = TRUE, |
| 14 |
dev = "png", |
| 15 |
df_print = "default", |
| 16 |
mathjax = TRUE, |
| 17 |
includes = NULL, |
| 18 |
keep_md = FALSE, |
| 19 |
md_extensions = NULL, |
| 20 |
pandoc_args = NULL, |
| 21 |
... |
| 22 |
) |
| 23 |
} |
| 24 |
\arguments{ |
| 25 |
\item{number_sections}{\code{TRUE} to number section headings} |
| 26 |
|
| 27 |
\item{section_divs}{Wrap sections in \verb{<div>} tags, and attach identifiers to the |
| 28 |
enclosing \verb{<div>} rather than the header itself.} |
| 29 |
|
| 30 |
\item{fig_width}{Default width (in inches) for figures} |
| 31 |
|
| 32 |
\item{fig_height}{Default height (in inches) for figures} |
| 33 |
|
| 34 |
\item{fig_retina}{Scaling to perform for retina displays (defaults to 2, which |
| 35 |
currently works for all widely used retina displays). Set to \code{NULL} to |
| 36 |
prevent retina scaling. Note that this will always be \code{NULL} when |
| 37 |
\code{keep_md} is specified (this is because \code{fig_retina} relies on |
| 38 |
outputting HTML directly into the markdown document).} |
| 39 |
|
| 40 |
\item{fig_caption}{\code{TRUE} to render figures with captions} |
| 41 |
|
| 42 |
\item{dev}{Graphics device to use for figure output (defaults to png)} |
| 43 |
|
| 44 |
\item{df_print}{Method to be used for printing data frames. Valid values |
| 45 |
include "default", "kable", "tibble", and "paged". The "default" method |
| 46 |
uses a corresponding S3 method of \code{print}, typically |
| 47 |
\code{print.data.frame}. The "kable" method uses the |
| 48 |
\code{\link[knitr:kable]{knitr::kable}} function. The "tibble" method uses |
| 49 |
the \pkg{tibble} package to print a summary of the data frame. The "paged" |
| 50 |
method creates a paginated HTML table (note that this method is only valid |
| 51 |
for formats that produce HTML). In addition to the named methods you can |
| 52 |
also pass an arbitrary function to be used for printing data frames. You |
| 53 |
can disable the \code{df_print} behavior entirely by setting the option |
| 54 |
\code{rmarkdown.df_print} to \code{FALSE}. See |
| 55 |
\href{https://yihui.org/rmarkdown/html-document.html#data-frame-printing}{Data |
| 56 |
frame printing section} in bookdown book for examples.} |
| 57 |
|
| 58 |
\item{mathjax}{\code{TRUE} to convert $ and $$ math blocks into MathJax |
| 59 |
compatible output. Note that you'll still need to ensure that the page |
| 60 |
where the fragment is included loads the required MathJax scripts.} |
| 61 |
|
| 62 |
\item{includes}{Named list of additional content to include within the |
| 63 |
document (typically created using the \code{\link{includes}} function).} |
| 64 |
|
| 65 |
\item{keep_md}{Keep the markdown file generated by knitting.} |
| 66 |
|
| 67 |
\item{md_extensions}{Markdown extensions to be added or removed from the |
| 68 |
default definition of R Markdown. See the \code{\link{rmarkdown_format}} for |
| 69 |
additional details.} |
| 70 |
|
| 71 |
\item{pandoc_args}{Additional command line options to pass to pandoc} |
| 72 |
|
| 73 |
\item{...}{Additional arguments passed to \code{\link{html_document}}} |
| 74 |
} |
| 75 |
\value{ |
| 76 |
R Markdown output format to pass to \code{\link{render}} |
| 77 |
} |
| 78 |
\description{ |
| 79 |
An html fragment is suitable for inclusion into an external html page. See |
| 80 |
\code{\link{html_document}} for full details - this is a minor variation that |
| 81 |
assumes you will include the output into an existing document (e.g. a blog |
| 82 |
post). |
| 83 |
} |
| 84 |
\details{ |
| 85 |
See the \href{https://yihui.org/rmarkdown/html-document.html}{online |
| 86 |
documentation} for additional details on using the \code{html_fragment} |
| 87 |
format. |
| 88 |
} |