Debian Codegraph @

man/md_document.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/md_document.R
3 \name{md_document}
4 \alias{md_document}
5 \title{Convert to a markdown document}
6 \usage{
7 md_document(
8 variant = "markdown_strict",
9 preserve_yaml = FALSE,
10 toc = FALSE,
11 toc_depth = 3,
12 number_sections = FALSE,
13 standalone = FALSE,
14 fig_width = 7,
15 fig_height = 5,
16 fig_retina = NULL,
17 dev = "png",
18 df_print = "default",
19 includes = NULL,
20 md_extensions = NULL,
21 pandoc_args = NULL,
22 ext = ".md"
23 )
24 }
25 \arguments{
26 \item{variant}{Markdown variant to produce (defaults to "markdown_strict").
27 Other valid values are "commonmark", "gfm", "commonmark_x", "markdown_mmd",
28 markdown_phpextra", "markdown_github", or even "markdown" (which produces
29 pandoc markdown). You can also compose custom markdown variants, see the
30 \href{https://pandoc.org/MANUAL.html}{pandoc online documentation} for
31 details.}
32
33 \item{preserve_yaml}{Preserve YAML front matter in final document.}
34
35 \item{toc}{\code{TRUE} to include a table of contents in the output}
36
37 \item{toc_depth}{Depth of headers to include in table of contents}
38
39 \item{number_sections}{\code{TRUE} to number section headings}
40
41 \item{standalone}{Set to \code{TRUE} to include title, date and other metadata
42 field in addition to Rmd content as a body.}
43
44 \item{fig_width}{Default width (in inches) for figures}
45
46 \item{fig_height}{Default height (in inches) for figures}
47
48 \item{fig_retina}{Scaling to perform for retina displays. Defaults to
49 \code{NULL} which performs no scaling. A setting of 2 will work for all
50 widely used retina displays, but will also result in the output of
51 \verb{<img>} tags rather than markdown images due to the need to set the
52 width of the image explicitly.}
53
54 \item{dev}{Graphics device to use for figure output (defaults to png)}
55
56 \item{df_print}{Method to be used for printing data frames. Valid values
57 include "default", "kable", "tibble", and "paged". The "default" method
58 uses a corresponding S3 method of \code{print}, typically
59 \code{print.data.frame}. The "kable" method uses the
60 \code{\link[knitr:kable]{knitr::kable}} function. The "tibble" method uses
61 the \pkg{tibble} package to print a summary of the data frame. The "paged"
62 method creates a paginated HTML table (note that this method is only valid
63 for formats that produce HTML). In addition to the named methods you can
64 also pass an arbitrary function to be used for printing data frames. You
65 can disable the \code{df_print} behavior entirely by setting the option
66 \code{rmarkdown.df_print} to \code{FALSE}. See
67 \href{https://yihui.org/rmarkdown/html-document.html#data-frame-printing}{Data
68 frame printing section} in bookdown book for examples.}
69
70 \item{includes}{Named list of additional content to include within the
71 document (typically created using the \code{\link{includes}} function).}
72
73 \item{md_extensions}{Markdown extensions to be added or removed from the
74 default definition of R Markdown. See the \code{\link{rmarkdown_format}} for
75 additional details.}
76
77 \item{pandoc_args}{Additional command line options to pass to pandoc}
78
79 \item{ext}{Extension of the output file (defaults to ".md").}
80 }
81 \value{
82 R Markdown output format to pass to \code{\link[=render]{render()}}
83 }
84 \description{
85 Format for converting from R Markdown to another variant of markdown (e.g.
86 strict markdown or github flavored markdown)
87 }
88 \details{
89 See the \href{https://yihui.org/rmarkdown/markdown-document.html}{online documentation}
90 for additional details on using the \code{md_document()} format.
91
92 R Markdown documents can have optional metadata that is used to generate a
93 document header that includes the title, author, and date. For more details
94 see the documentation on R Markdown \link[=rmd_metadata]{metadata}.
95 }
96 \examples{
97 \dontrun{
98 library(rmarkdown)
99
100 render("input.Rmd", md_document())
101
102 render("input.Rmd", md_document(variant = "markdown_github"))
103 }
104 }