| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/html_document_base.R |
| 3 |
\name{html_document_base} |
| 4 |
\alias{html_document_base} |
| 5 |
\title{Base output format for HTML-based output formats} |
| 6 |
\usage{ |
| 7 |
html_document_base( |
| 8 |
theme = NULL, |
| 9 |
self_contained = TRUE, |
| 10 |
lib_dir = NULL, |
| 11 |
math_method = "default", |
| 12 |
mathjax = "default", |
| 13 |
pandoc_args = NULL, |
| 14 |
template = "default", |
| 15 |
dependency_resolver = NULL, |
| 16 |
copy_resources = FALSE, |
| 17 |
extra_dependencies = NULL, |
| 18 |
css = NULL, |
| 19 |
bootstrap_compatible = FALSE, |
| 20 |
... |
| 21 |
) |
| 22 |
} |
| 23 |
\arguments{ |
| 24 |
\item{theme}{One of the following: |
| 25 |
\itemize{ |
| 26 |
\item A \code{\link[bslib:bs_theme]{bslib::bs_theme()}} object (or a list of \code{\link[bslib:bs_theme]{bslib::bs_theme()}} argument values) |
| 27 |
\itemize{ |
| 28 |
\item Use this option for custom themes using Bootstrap 4 or 3. |
| 29 |
\item In this case, any \code{.scss}/\code{.sass} files provided to the \code{css} |
| 30 |
parameter may utilize the \code{theme}'s underlying Sass utilities |
| 31 |
(e.g., variables, mixins, etc). |
| 32 |
} |
| 33 |
\item \code{NULL} for no theme (i.e., no \code{\link[=html_dependency_bootstrap]{html_dependency_bootstrap()}}). |
| 34 |
\item A character string specifying a \href{https://bootswatch.com/3/}{Bootswatch 3} |
| 35 |
theme name (for backwards-compatibility). |
| 36 |
}} |
| 37 |
|
| 38 |
\item{self_contained}{Produce a standalone HTML file with no external |
| 39 |
dependencies, using data: URIs to incorporate the contents of linked |
| 40 |
scripts, stylesheets, images, and videos. Note that even for self contained |
| 41 |
documents MathJax is still loaded externally (this is necessary because of |
| 42 |
its size).} |
| 43 |
|
| 44 |
\item{lib_dir}{Directory to copy dependent HTML libraries (e.g. jquery, |
| 45 |
bootstrap, etc.) into. By default this will be the name of the document with |
| 46 |
\verb{_files} appended to it.} |
| 47 |
|
| 48 |
\item{math_method}{Math rendering engine to use. This will define the math method to use with Pandoc. |
| 49 |
\itemize{ |
| 50 |
\item It can be a string for the engine, one of "mathjax", "mathml", "webtex", "katex", "gladtex", or "r-katex" |
| 51 |
or "default" for \code{mathjax}. |
| 52 |
\item It can be a list of |
| 53 |
\itemize{ |
| 54 |
\item \code{engine}: one of |
| 55 |
"mathjax", "mathml", "webtex", "katex", or "gladtex". |
| 56 |
\item \code{url}: A specific url to use with \code{mathjax}, \code{katex} or \code{webtex}. |
| 57 |
Note that for \code{engine = "mathjax"}, \code{url = "local"} will use a local version of MathJax (which is |
| 58 |
copied into the output directory). |
| 59 |
} |
| 60 |
} |
| 61 |
|
| 62 |
For example, |
| 63 |
|
| 64 |
\if{html}{\out{<div class="sourceCode yaml">}}\preformatted{output: |
| 65 |
html_document: |
| 66 |
math_method: |
| 67 |
engine: katex |
| 68 |
url: https://cdn.jsdelivr.net/npm/[email protected]/dist/ |
| 69 |
}\if{html}{\out{</div>}} |
| 70 |
|
| 71 |
See \href{https://pandoc.org/MANUAL.html#math-rendering-in-html}{Pandoc's Manual about Math in HTML} for the details |
| 72 |
about Pandoc supported methods. |
| 73 |
|
| 74 |
Using \code{math_method = "r-katex"} will opt-in server side rendering using |
| 75 |
KaTeX thanks to \href{https://docs.ropensci.org/katex/}{katex} R package. This is |
| 76 |
useful compared to \code{math_method = "katex"} to have no JS dependency, only a |
| 77 |
CSS dependency for styling equation.} |
| 78 |
|
| 79 |
\item{mathjax}{Include mathjax. The "default" option uses an https URL from a |
| 80 |
MathJax CDN. The "local" option uses a local version of MathJax (which is |
| 81 |
copied into the output directory). You can pass an alternate URL or pass |
| 82 |
\code{NULL} to exclude MathJax entirely.} |
| 83 |
|
| 84 |
\item{pandoc_args}{Additional command line options to pass to pandoc} |
| 85 |
|
| 86 |
\item{template}{Pandoc template to use for rendering. Pass "default" to use |
| 87 |
the rmarkdown package default template; pass \code{NULL} to use pandoc's |
| 88 |
built-in template; pass a path to use a custom template that you've created. |
| 89 |
Note that if you don't use the "default" template then some features of |
| 90 |
\code{html_document} won't be available (see the Templates section below for |
| 91 |
more details).} |
| 92 |
|
| 93 |
\item{dependency_resolver}{A dependency resolver} |
| 94 |
|
| 95 |
\item{copy_resources}{Copy resources} |
| 96 |
|
| 97 |
\item{extra_dependencies}{Extra dependencies as a list of the |
| 98 |
\code{html_dependency} class objects typically generated by |
| 99 |
\code{\link[htmltools:htmlDependency]{htmltools::htmlDependency()}}.} |
| 100 |
|
| 101 |
\item{css}{CSS and/or Sass files to include. Files with an extension of .sass |
| 102 |
or .scss are compiled to CSS via \code{sass::sass()}. Also, if \code{theme} is a |
| 103 |
\code{\link[bslib:bs_theme]{bslib::bs_theme()}} object, Sass code may reference the relevant Bootstrap |
| 104 |
Sass variables, functions, mixins, etc.} |
| 105 |
|
| 106 |
\item{bootstrap_compatible}{Bootstrap compatible} |
| 107 |
|
| 108 |
\item{...}{Ignored} |
| 109 |
} |
| 110 |
\value{ |
| 111 |
HTML base output format. |
| 112 |
} |
| 113 |
\description{ |
| 114 |
Creates an HTML base output format suitable for passing as the |
| 115 |
\code{base_format} argument of the \code{\link{output_format}} function. |
| 116 |
} |