| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/github_document.R |
| 3 |
\name{github_document} |
| 4 |
\alias{github_document} |
| 5 |
\title{Convert to GitHub Flavored Markdown} |
| 6 |
\usage{ |
| 7 |
github_document( |
| 8 |
toc = FALSE, |
| 9 |
toc_depth = 3, |
| 10 |
number_sections = FALSE, |
| 11 |
math_method = "default", |
| 12 |
preserve_yaml = FALSE, |
| 13 |
fig_width = 7, |
| 14 |
fig_height = 5, |
| 15 |
dev = "png", |
| 16 |
df_print = "default", |
| 17 |
includes = NULL, |
| 18 |
md_extensions = NULL, |
| 19 |
hard_line_breaks = TRUE, |
| 20 |
pandoc_args = NULL, |
| 21 |
html_preview = TRUE, |
| 22 |
keep_html = FALSE |
| 23 |
) |
| 24 |
} |
| 25 |
\arguments{ |
| 26 |
\item{toc}{\code{TRUE} to include a table of contents in the output} |
| 27 |
|
| 28 |
\item{toc_depth}{Depth of headers to include in table of contents} |
| 29 |
|
| 30 |
\item{number_sections}{\code{TRUE} to number section headings} |
| 31 |
|
| 32 |
\item{math_method}{\code{"default"} means that \href{https://github.blog/changelog/2022-05-19-render-mathematical-expressions-in-markdown/}{native Github support} |
| 33 |
for math notations using Mathjax syntax will be used. Other possible value |
| 34 |
is \code{"webtex"} where equation will be rendered to an image in the resulting |
| 35 |
Markdown. See \code{\link[=html_document]{html_document()}} for option to change webtex URL. Set \code{math_method}to |
| 36 |
\code{NULL} to opt-out any math treatment.} |
| 37 |
|
| 38 |
\item{preserve_yaml}{Preserve YAML front matter in final document.} |
| 39 |
|
| 40 |
\item{fig_width}{Default width (in inches) for figures} |
| 41 |
|
| 42 |
\item{fig_height}{Default height (in inches) for figures} |
| 43 |
|
| 44 |
\item{dev}{Graphics device to use for figure output (defaults to png)} |
| 45 |
|
| 46 |
\item{df_print}{Method to be used for printing data frames. Valid values |
| 47 |
include "default", "kable", "tibble", and "paged". The "default" method |
| 48 |
uses a corresponding S3 method of \code{print}, typically |
| 49 |
\code{print.data.frame}. The "kable" method uses the |
| 50 |
\code{\link[knitr:kable]{knitr::kable}} function. The "tibble" method uses |
| 51 |
the \pkg{tibble} package to print a summary of the data frame. The "paged" |
| 52 |
method creates a paginated HTML table (note that this method is only valid |
| 53 |
for formats that produce HTML). In addition to the named methods you can |
| 54 |
also pass an arbitrary function to be used for printing data frames. You |
| 55 |
can disable the \code{df_print} behavior entirely by setting the option |
| 56 |
\code{rmarkdown.df_print} to \code{FALSE}. See |
| 57 |
\href{https://yihui.org/rmarkdown/html-document.html#data-frame-printing}{Data |
| 58 |
frame printing section} in bookdown book for examples.} |
| 59 |
|
| 60 |
\item{includes}{Named list of additional content to include within the |
| 61 |
document (typically created using the \code{\link{includes}} function).} |
| 62 |
|
| 63 |
\item{md_extensions}{Markdown extensions to be added or removed from the |
| 64 |
default definition of R Markdown. See the \code{\link{rmarkdown_format}} for |
| 65 |
additional details.} |
| 66 |
|
| 67 |
\item{hard_line_breaks}{\code{TRUE} to generate markdown that uses a simple |
| 68 |
newline to represent a line break (as opposed to two-spaces and a newline).} |
| 69 |
|
| 70 |
\item{pandoc_args}{Additional command line options to pass to pandoc} |
| 71 |
|
| 72 |
\item{html_preview}{\code{TRUE} to also generate an HTML file for the purpose of |
| 73 |
locally previewing what the document will look like on GitHub.} |
| 74 |
|
| 75 |
\item{keep_html}{\code{TRUE} to keep the preview HTML file in the working |
| 76 |
directory. Default is \code{FALSE}.} |
| 77 |
} |
| 78 |
\value{ |
| 79 |
R Markdown output format to pass to \code{\link[=render]{render()}} |
| 80 |
} |
| 81 |
\description{ |
| 82 |
Format for converting from R Markdown to GitHub Flavored Markdown. |
| 83 |
} |
| 84 |
\details{ |
| 85 |
See the \href{https://rmarkdown.rstudio.com/github_document_format.html}{online documentation} for additional details on using the \code{github_document()} |
| 86 |
format. |
| 87 |
} |
| 88 |
\section{About Math support}{ |
| 89 |
Default behavior is to keep any inline equation using \code{$} and any block |
| 90 |
equation using \verb{$$} in the resulting markdown as Github will process those |
| 91 |
using Mathjax. \strong{This feature is only available with Pandoc 2.10.1 and above} |
| 92 |
|
| 93 |
When using \code{"webtex"}, PNG images with a white background are used by default so |
| 94 |
that it shows correctly on Github on both light and dark theme. You can |
| 95 |
choose to only output SVG for better quality by changing the URL used: |
| 96 |
|
| 97 |
\if{html}{\out{<div class="sourceCode yaml">}}\preformatted{output: |
| 98 |
github_document: |
| 99 |
math_method: |
| 100 |
engine: webtex |
| 101 |
url: https://latex.codecogs.com/svg.image? |
| 102 |
}\if{html}{\out{</div>}} |
| 103 |
|
| 104 |
Background or fonts color cannot be changed for now and your equation may not be visible on dark theme. |
| 105 |
|
| 106 |
Using \code{"webtex"} will be the default with Pandoc 2.0.4 until Pandoc 2.10. Before 2.0.4, Github document output does not support math. |
| 107 |
} |
| 108 |
|